From 1c5e6e7430aa31a3a0193a9577b742a456649965 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sat, 6 May 2017 22:21:16 -0400 Subject: [PATCH] rename all (almost) .js files --- rename.js | 9 +++++ src/generators/{Generator.js => Generator.ts} | 22 ++++++------ src/generators/dom/{Block.js => Block.ts} | 2 +- src/generators/dom/{index.js => index.ts} | 14 ++++---- .../dom/{preprocess.js => preprocess.ts} | 4 +-- src/generators/dom/shared.ts | 35 +++++++++++++++++++ src/generators/dom/{visit.js => visit.ts} | 2 +- .../Component/{Attribute.js => Attribute.ts} | 0 .../Component/{Binding.js => Binding.ts} | 4 +-- .../Component/{Component.js => Component.ts} | 12 +++---- .../{EventHandler.js => EventHandler.ts} | 0 .../dom/visitors/Component/{Ref.js => Ref.ts} | 0 .../visitors/{EachBlock.js => EachBlock.ts} | 2 +- .../Element/{Attribute.js => Attribute.ts} | 4 +-- .../Element/{Binding.js => Binding.ts} | 6 ++-- .../Element/{Element.js => Element.ts} | 16 ++++----- .../{EventHandler.js => EventHandler.ts} | 2 +- .../dom/visitors/Element/{Ref.js => Ref.ts} | 0 .../{addTransitions.js => addTransitions.ts} | 0 ...uteValue.js => getStaticAttributeValue.ts} | 0 .../visitors/Element/{lookup.js => lookup.ts} | 0 .../Element/meta/{Window.js => Window.ts} | 2 +- .../dom/visitors/{IfBlock.js => IfBlock.ts} | 2 +- .../{MustacheTag.js => MustacheTag.ts} | 0 .../{RawMustacheTag.js => RawMustacheTag.ts} | 0 .../dom/visitors/{Text.js => Text.ts} | 0 .../dom/visitors/{YieldTag.js => YieldTag.ts} | 0 src/generators/dom/visitors/index.js | 17 --------- src/generators/dom/visitors/index.ts | 17 +++++++++ .../binding/{getSetter.js => getSetter.ts} | 0 .../{Block.js => Block.ts} | 2 +- .../{index.js => index.ts} | 6 ++-- .../{visit.js => visit.ts} | 2 +- .../visitors/{Comment.js => Comment.ts} | 0 .../visitors/{Component.js => Component.ts} | 4 +-- .../visitors/{EachBlock.js => EachBlock.ts} | 2 +- .../visitors/{Element.js => Element.ts} | 8 ++--- .../visitors/{IfBlock.js => IfBlock.ts} | 2 +- .../{MustacheTag.js => MustacheTag.ts} | 0 .../{RawMustacheTag.js => RawMustacheTag.ts} | 0 .../visitors/{Text.js => Text.ts} | 0 .../visitors/{YieldTag.js => YieldTag.ts} | 0 .../server-side-rendering/visitors/index.js | 19 ---------- .../server-side-rendering/visitors/index.ts | 19 ++++++++++ .../visitors/meta/{Window.js => Window.ts} | 0 .../shared/{processCss.js => processCss.ts} | 0 .../utils/{getGlobals.js => getGlobals.ts} | 0 .../shared/utils/{getIntro.js => getIntro.ts} | 2 +- .../shared/utils/{getOutro.js => getOutro.ts} | 2 +- .../shared/utils/{walkHtml.js => walkHtml.ts} | 0 src/index.ts | 6 ++-- src/parse/index.ts | 6 ++-- src/parse/state/mustache.ts | 4 +-- src/parse/state/tag.ts | 4 +-- src/utils/{CodeBuilder.js => CodeBuilder.ts} | 0 src/utils/{__test__.js => __test__.ts} | 2 +- ...ateWithScopes.js => annotateWithScopes.ts} | 0 ...lattenReference.js => flattenReference.ts} | 0 .../{getCodeFrame.js => getCodeFrame.ts} | 0 ...{globalWhitelist.js => globalWhitelist.ts} | 0 src/utils/{isReference.js => isReference.ts} | 0 ...oidElementName.js => isVoidElementName.ts} | 0 src/utils/{namespaces.js => namespaces.ts} | 0 src/utils/{patterns.js => patterns.ts} | 0 src/utils/{removeNode.js => removeNode.ts} | 0 .../{reservedNames.js => reservedNames.ts} | 0 src/utils/{toSource.js => toSource.ts} | 0 src/utils/{trim.js => trim.ts} | 2 +- src/validate/html/{index.js => index.ts} | 6 ++-- ...{validateElement.js => validateElement.ts} | 2 +- ...ventHandler.js => validateEventHandler.ts} | 4 +-- .../{validateWindow.js => validateWindow.ts} | 8 ++--- src/validate/{index.js => index.ts} | 6 ++-- src/validate/js/{index.js => index.ts} | 10 +++--- .../{components.js => components.ts} | 4 +-- .../{computed.js => computed.ts} | 4 +-- .../js/propValidators/{data.js => data.ts} | 0 .../propValidators/{events.js => events.ts} | 4 +-- .../propValidators/{helpers.js => helpers.ts} | 4 +-- src/validate/js/propValidators/index.js | 27 -------------- src/validate/js/propValidators/index.ts | 27 ++++++++++++++ .../propValidators/{methods.js => methods.ts} | 8 ++--- .../{namespace.js => namespace.ts} | 4 +-- .../{oncreate.js => oncreate.ts} | 2 +- .../{ondestroy.js => ondestroy.ts} | 2 +- .../{onrender.js => onrender.ts} | 2 +- .../{onteardown.js => onteardown.ts} | 2 +- .../{transitions.js => transitions.ts} | 4 +-- ...ckForAccessors.js => checkForAccessors.ts} | 0 ...omputedKeys.js => checkForComputedKeys.ts} | 0 .../{checkForDupes.js => checkForDupes.ts} | 0 ...sOrArguments.js => usesThisOrArguments.ts} | 2 +- .../utils/{FuzzySet.js => FuzzySet.ts} | 0 .../utils/{fuzzymatch.js => fuzzymatch.ts} | 2 +- src/validate/utils/{list.js => list.ts} | 0 95 files changed, 221 insertions(+), 177 deletions(-) create mode 100644 rename.js rename src/generators/{Generator.js => Generator.ts} (96%) rename src/generators/dom/{Block.js => Block.ts} (99%) rename src/generators/dom/{index.js => index.ts} (96%) rename src/generators/dom/{preprocess.js => preprocess.ts} (98%) create mode 100644 src/generators/dom/shared.ts rename src/generators/dom/{visit.js => visit.ts} (76%) rename src/generators/dom/visitors/Component/{Attribute.js => Attribute.ts} (100%) rename src/generators/dom/visitors/Component/{Binding.js => Binding.ts} (97%) rename src/generators/dom/visitors/Component/{Component.js => Component.ts} (95%) rename src/generators/dom/visitors/Component/{EventHandler.js => EventHandler.ts} (100%) rename src/generators/dom/visitors/Component/{Ref.js => Ref.ts} (100%) rename src/generators/dom/visitors/{EachBlock.js => EachBlock.ts} (99%) rename src/generators/dom/visitors/Element/{Attribute.js => Attribute.ts} (97%) rename src/generators/dom/visitors/Element/{Binding.js => Binding.ts} (98%) rename src/generators/dom/visitors/Element/{Element.js => Element.ts} (91%) rename src/generators/dom/visitors/Element/{EventHandler.js => EventHandler.ts} (99%) rename src/generators/dom/visitors/Element/{Ref.js => Ref.ts} (100%) rename src/generators/dom/visitors/Element/{addTransitions.js => addTransitions.ts} (100%) rename src/generators/dom/visitors/Element/{getStaticAttributeValue.js => getStaticAttributeValue.ts} (100%) rename src/generators/dom/visitors/Element/{lookup.js => lookup.ts} (100%) rename src/generators/dom/visitors/Element/meta/{Window.js => Window.ts} (99%) rename src/generators/dom/visitors/{IfBlock.js => IfBlock.ts} (99%) rename src/generators/dom/visitors/{MustacheTag.js => MustacheTag.ts} (100%) rename src/generators/dom/visitors/{RawMustacheTag.js => RawMustacheTag.ts} (100%) rename src/generators/dom/visitors/{Text.js => Text.ts} (100%) rename src/generators/dom/visitors/{YieldTag.js => YieldTag.ts} (100%) delete mode 100644 src/generators/dom/visitors/index.js create mode 100644 src/generators/dom/visitors/index.ts rename src/generators/dom/visitors/shared/binding/{getSetter.js => getSetter.ts} (100%) rename src/generators/server-side-rendering/{Block.js => Block.ts} (92%) rename src/generators/server-side-rendering/{index.js => index.ts} (96%) rename src/generators/server-side-rendering/{visit.js => visit.ts} (75%) rename src/generators/server-side-rendering/visitors/{Comment.js => Comment.ts} (100%) rename src/generators/server-side-rendering/visitors/{Component.js => Component.ts} (95%) rename src/generators/server-side-rendering/visitors/{EachBlock.js => EachBlock.ts} (96%) rename src/generators/server-side-rendering/visitors/{Element.js => Element.ts} (90%) rename src/generators/server-side-rendering/visitors/{IfBlock.js => IfBlock.ts} (93%) rename src/generators/server-side-rendering/visitors/{MustacheTag.js => MustacheTag.ts} (100%) rename src/generators/server-side-rendering/visitors/{RawMustacheTag.js => RawMustacheTag.ts} (100%) rename src/generators/server-side-rendering/visitors/{Text.js => Text.ts} (100%) rename src/generators/server-side-rendering/visitors/{YieldTag.js => YieldTag.ts} (100%) delete mode 100644 src/generators/server-side-rendering/visitors/index.js create mode 100644 src/generators/server-side-rendering/visitors/index.ts rename src/generators/server-side-rendering/visitors/meta/{Window.js => Window.ts} (100%) rename src/generators/shared/{processCss.js => processCss.ts} (100%) rename src/generators/shared/utils/{getGlobals.js => getGlobals.ts} (100%) rename src/generators/shared/utils/{getIntro.js => getIntro.ts} (98%) rename src/generators/shared/utils/{getOutro.js => getOutro.ts} (94%) rename src/generators/shared/utils/{walkHtml.js => walkHtml.ts} (100%) rename src/utils/{CodeBuilder.js => CodeBuilder.ts} (100%) rename src/utils/{__test__.js => __test__.ts} (98%) rename src/utils/{annotateWithScopes.js => annotateWithScopes.ts} (100%) rename src/utils/{flattenReference.js => flattenReference.ts} (100%) rename src/utils/{getCodeFrame.js => getCodeFrame.ts} (100%) rename src/utils/{globalWhitelist.js => globalWhitelist.ts} (100%) rename src/utils/{isReference.js => isReference.ts} (100%) rename src/utils/{isVoidElementName.js => isVoidElementName.ts} (100%) rename src/utils/{namespaces.js => namespaces.ts} (100%) rename src/utils/{patterns.js => patterns.ts} (100%) rename src/utils/{removeNode.js => removeNode.ts} (100%) rename src/utils/{reservedNames.js => reservedNames.ts} (100%) rename src/utils/{toSource.js => toSource.ts} (100%) rename src/utils/{trim.js => trim.ts} (85%) rename src/validate/html/{index.js => index.ts} (91%) rename src/validate/html/{validateElement.js => validateElement.ts} (98%) rename src/validate/html/{validateEventHandler.js => validateEventHandler.ts} (90%) rename src/validate/html/{validateWindow.js => validateWindow.ts} (85%) rename src/validate/{index.js => index.ts} (92%) rename src/validate/js/{index.js => index.ts} (89%) rename src/validate/js/propValidators/{components.js => components.ts} (92%) rename src/validate/js/propValidators/{computed.js => computed.ts} (95%) rename src/validate/js/propValidators/{data.js => data.ts} (100%) rename src/validate/js/propValidators/{events.js => events.ts} (86%) rename src/validate/js/propValidators/{helpers.js => helpers.ts} (96%) delete mode 100644 src/validate/js/propValidators/index.js create mode 100644 src/validate/js/propValidators/index.ts rename src/validate/js/propValidators/{methods.js => methods.ts} (83%) rename src/validate/js/propValidators/{namespace.js => namespace.ts} (84%) rename src/validate/js/propValidators/{oncreate.js => oncreate.ts} (81%) rename src/validate/js/propValidators/{ondestroy.js => ondestroy.ts} (81%) rename src/validate/js/propValidators/{onrender.js => onrender.ts} (85%) rename src/validate/js/propValidators/{onteardown.js => onteardown.ts} (84%) rename src/validate/js/propValidators/{transitions.js => transitions.ts} (89%) rename src/validate/js/utils/{checkForAccessors.js => checkForAccessors.ts} (100%) rename src/validate/js/utils/{checkForComputedKeys.js => checkForComputedKeys.ts} (100%) rename src/validate/js/utils/{checkForDupes.js => checkForDupes.ts} (100%) rename src/validate/js/utils/{usesThisOrArguments.js => usesThisOrArguments.ts} (89%) rename src/validate/utils/{FuzzySet.js => FuzzySet.ts} (100%) rename src/validate/utils/{fuzzymatch.js => fuzzymatch.ts} (84%) rename src/validate/utils/{list.js => list.ts} (100%) diff --git a/rename.js b/rename.js new file mode 100644 index 0000000000..ad3804e39d --- /dev/null +++ b/rename.js @@ -0,0 +1,9 @@ +const glob = require( 'glob' ); +const fs = require( 'fs' ); + +glob.sync( 'src/**/*.js' ).forEach( file => { + console.log( file ); + const js = fs.readFileSync( file, 'utf-8' ); + fs.writeFileSync( file.replace( /\.js$/, '.ts' ), js ); + fs.unlinkSync( file ); +}); \ No newline at end of file diff --git a/src/generators/Generator.js b/src/generators/Generator.ts similarity index 96% rename from src/generators/Generator.js rename to src/generators/Generator.ts index 7a316adc85..c854806f5b 100644 --- a/src/generators/Generator.js +++ b/src/generators/Generator.ts @@ -1,15 +1,15 @@ import MagicString, { Bundle } from 'magic-string'; import { walk } from 'estree-walker'; -import isReference from '../utils/isReference.js'; -import flattenReference from '../utils/flattenReference.js'; -import globalWhitelist from '../utils/globalWhitelist.js'; -import reservedNames from '../utils/reservedNames.js'; -import namespaces from '../utils/namespaces.js'; -import { removeNode, removeObjectKey } from '../utils/removeNode.js'; -import getIntro from './shared/utils/getIntro.js'; -import getOutro from './shared/utils/getOutro.js'; -import processCss from './shared/processCss.js'; -import annotateWithScopes from '../utils/annotateWithScopes.js'; +import isReference from '../utils/isReference.ts'; +import flattenReference from '../utils/flattenReference.ts'; +import globalWhitelist from '../utils/globalWhitelist.ts'; +import reservedNames from '../utils/reservedNames.ts'; +import namespaces from '../utils/namespaces.ts'; +import { removeNode, removeObjectKey } from '../utils/removeNode.ts'; +import getIntro from './shared/utils/getIntro.ts'; +import getOutro from './shared/utils/getOutro.ts'; +import processCss from './shared/processCss.ts'; +import annotateWithScopes from '../utils/annotateWithScopes.ts'; const test = typeof global !== 'undefined' && global.__svelte_test; @@ -39,7 +39,7 @@ export default class Generator { this.usesRefs = false; // allow compiler to deconflict user's `import { get } from 'whatever'` and - // Svelte's builtin `import { get, ... } from 'svelte/shared.js'`; + // Svelte's builtin `import { get, ... } from 'svelte/shared.ts'`; this.importedNames = new Set(); this.aliases = new Map(); this._usedNames = new Set( [ name ] ); diff --git a/src/generators/dom/Block.js b/src/generators/dom/Block.ts similarity index 99% rename from src/generators/dom/Block.js rename to src/generators/dom/Block.ts index 83841b738d..a7775bd355 100644 --- a/src/generators/dom/Block.js +++ b/src/generators/dom/Block.ts @@ -1,4 +1,4 @@ -import CodeBuilder from '../../utils/CodeBuilder.js'; +import CodeBuilder from '../../utils/CodeBuilder.ts'; import deindent from '../../utils/deindent.js'; export default class Block { diff --git a/src/generators/dom/index.js b/src/generators/dom/index.ts similarity index 96% rename from src/generators/dom/index.js rename to src/generators/dom/index.ts index cb331fd96a..e4fa2c6f71 100644 --- a/src/generators/dom/index.js +++ b/src/generators/dom/index.ts @@ -1,14 +1,14 @@ import MagicString from 'magic-string'; import { parseExpressionAt } from 'acorn'; -import annotateWithScopes from '../../utils/annotateWithScopes.js'; -import isReference from '../../utils/isReference.js'; +import annotateWithScopes from '../../utils/annotateWithScopes.ts'; +import isReference from '../../utils/isReference.ts'; import { walk } from 'estree-walker'; import deindent from '../../utils/deindent.js'; -import CodeBuilder from '../../utils/CodeBuilder.js'; -import visit from './visit.js'; -import shared from './shared.js'; -import Generator from '../Generator.js'; -import preprocess from './preprocess.js'; +import CodeBuilder from '../../utils/CodeBuilder.ts'; +import visit from './visit.ts'; +import shared from './shared.ts'; +import Generator from '../Generator.ts'; +import preprocess from './preprocess.ts'; class DomGenerator extends Generator { constructor ( parsed, source, name, options ) { diff --git a/src/generators/dom/preprocess.js b/src/generators/dom/preprocess.ts similarity index 98% rename from src/generators/dom/preprocess.js rename to src/generators/dom/preprocess.ts index 522a682074..0de5c21040 100644 --- a/src/generators/dom/preprocess.js +++ b/src/generators/dom/preprocess.ts @@ -1,5 +1,5 @@ -import Block from './Block.js'; -import { trimStart, trimEnd } from '../../utils/trim.js'; +import Block from './Block.ts'; +import { trimStart, trimEnd } from '../../utils/trim.ts'; import { assign } from '../../shared/index.js'; function isElseIf ( node ) { diff --git a/src/generators/dom/shared.ts b/src/generators/dom/shared.ts new file mode 100644 index 0000000000..a368a0e580 --- /dev/null +++ b/src/generators/dom/shared.ts @@ -0,0 +1,35 @@ +// this file is auto-generated, do not edit it +export default { + "appendNode": "function appendNode ( node, target ) {\n\ttarget.appendChild( node );\n}", + "insertNode": "function insertNode ( node, target, anchor ) {\n\ttarget.insertBefore( node, anchor );\n}", + "detachNode": "function detachNode ( node ) {\n\tnode.parentNode.removeChild( node );\n}", + "detachBetween": "function detachBetween ( before, after ) {\n\twhile ( before.nextSibling && before.nextSibling !== after ) {\n\t\tbefore.parentNode.removeChild( before.nextSibling );\n\t}\n}", + "destroyEach": "function destroyEach ( iterations, detach, start ) {\n\tfor ( var i = start; i < iterations.length; i += 1 ) {\n\t\tif ( iterations[i] ) iterations[i].destroy( detach );\n\t}\n}", + "createElement": "function createElement ( name ) {\n\treturn document.createElement( name );\n}", + "createSvgElement": "function createSvgElement ( name ) {\n\treturn document.createElementNS( 'http://www.w3.org/2000/svg', name );\n}", + "createText": "function createText ( data ) {\n\treturn document.createTextNode( data );\n}", + "createComment": "function createComment () {\n\treturn document.createComment( '' );\n}", + "addEventListener": "function addEventListener ( node, event, handler ) {\n\tnode.addEventListener( event, handler, false );\n}", + "removeEventListener": "function removeEventListener ( node, event, handler ) {\n\tnode.removeEventListener( event, handler, false );\n}", + "setAttribute": "function setAttribute ( node, attribute, value ) {\n\tnode.setAttribute( attribute, value );\n}", + "setXlinkAttribute": "function setXlinkAttribute ( node, attribute, value ) {\n\tnode.setAttributeNS( 'http://www.w3.org/1999/xlink', attribute, value );\n}", + "getBindingGroupValue": "function getBindingGroupValue ( group ) {\n\tvar value = [];\n\tfor ( var i = 0; i < group.length; i += 1 ) {\n\t\tif ( group[i].checked ) value.push( group[i].__value );\n\t}\n\treturn value;\n}", + "differs": "function differs ( a, b ) {\n\treturn ( a !== b ) || ( a && ( typeof a === 'object' ) || ( typeof a === 'function' ) );\n}", + "dispatchObservers": "function dispatchObservers ( component, group, newState, oldState ) {\n\tfor ( var key in group ) {\n\t\tif ( !( key in newState ) ) continue;\n\n\t\tvar newValue = newState[ key ];\n\t\tvar oldValue = oldState[ key ];\n\n\t\tif ( differs( newValue, oldValue ) ) {\n\t\t\tvar callbacks = group[ key ];\n\t\t\tif ( !callbacks ) continue;\n\n\t\t\tfor ( var i = 0; i < callbacks.length; i += 1 ) {\n\t\t\t\tvar callback = callbacks[i];\n\t\t\t\tif ( callback.__calling ) continue;\n\n\t\t\t\tcallback.__calling = true;\n\t\t\t\tcallback.call( component, newValue, oldValue );\n\t\t\t\tcallback.__calling = false;\n\t\t\t}\n\t\t}\n\t}\n}", + "get": "function get ( key ) {\n\treturn key ? this._state[ key ] : this._state;\n}", + "fire": "function fire ( eventName, data ) {\n\tvar handlers = eventName in this._handlers && this._handlers[ eventName ].slice();\n\tif ( !handlers ) return;\n\n\tfor ( var i = 0; i < handlers.length; i += 1 ) {\n\t\thandlers[i].call( this, data );\n\t}\n}", + "observe": "function observe ( key, callback, options ) {\n\tvar group = ( options && options.defer ) ? this._observers.post : this._observers.pre;\n\n\t( group[ key ] || ( group[ key ] = [] ) ).push( callback );\n\n\tif ( !options || options.init !== false ) {\n\t\tcallback.__calling = true;\n\t\tcallback.call( this, this._state[ key ] );\n\t\tcallback.__calling = false;\n\t}\n\n\treturn {\n\t\tcancel: function () {\n\t\t\tvar index = group[ key ].indexOf( callback );\n\t\t\tif ( ~index ) group[ key ].splice( index, 1 );\n\t\t}\n\t};\n}", + "observeDev": "function observeDev ( key, callback, options ) {\n\tvar c = ( key = '' + key ).search( /[^\\w]/ );\n\tif ( c > -1 ) {\n\t\tvar message = \"The first argument to component.observe(...) must be the name of a top-level property\";\n\t\tif ( c > 0 ) message += \", i.e. '\" + key.slice( 0, c ) + \"' rather than '\" + key + \"'\";\n\n\t\tthrow new Error( message );\n\t}\n\n\treturn observe.call( this, key, callback, options );\n}", + "on": "function on ( eventName, handler ) {\n\tif ( eventName === 'teardown' ) return this.on( 'destroy', handler );\n\n\tvar handlers = this._handlers[ eventName ] || ( this._handlers[ eventName ] = [] );\n\thandlers.push( handler );\n\n\treturn {\n\t\tcancel: function () {\n\t\t\tvar index = handlers.indexOf( handler );\n\t\t\tif ( ~index ) handlers.splice( index, 1 );\n\t\t}\n\t};\n}", + "onDev": "function onDev ( eventName, handler ) {\n\tif ( eventName === 'teardown' ) {\n\t\tconsole.warn( \"Use component.on('destroy', ...) instead of component.on('teardown', ...) which has been deprecated and will be unsupported in Svelte 2\" );\n\t\treturn this.on( 'destroy', handler );\n\t}\n\n\treturn on.call( this, eventName, handler );\n}", + "set": "function set ( newState ) {\n\tthis._set( assign( {}, newState ) );\n\tthis._root._flush();\n}", + "_flush": "function _flush () {\n\tif ( !this._renderHooks ) return;\n\n\twhile ( this._renderHooks.length ) {\n\t\tthis._renderHooks.pop()();\n\t}\n}", + "proto": "{\n\tget: get,\n\tfire: fire,\n\tobserve: observe,\n\ton: on,\n\tset: set,\n\t_flush: _flush\n}", + "protoDev": "{\n\tget: get,\n\tfire: fire,\n\tobserve: observeDev,\n\ton: onDev,\n\tset: set,\n\t_flush: _flush\n}", + "linear": "function linear ( t ) {\n\treturn t;\n}", + "generateKeyframes": "function generateKeyframes ( a, b, delta, duration, ease, fn, node, style ) {\n\tvar id = '__svelte' + ~~( Math.random() * 1e9 ); // TODO make this more robust\n\tvar keyframes = '@keyframes ' + id + '{\\n';\n\n\tfor ( var p = 0; p <= 1; p += 16.666 / duration ) {\n\t\tvar t = a + delta * ease( p );\n\t\tkeyframes += ( p * 100 ) + '%{' + fn( t ) + '}\\n';\n\t}\n\n\tkeyframes += '100% {' + fn( b ) + '}\\n}';\n\tstyle.textContent += keyframes;\n\n\tdocument.head.appendChild( style );\n\n\tnode.style.animation = node.style.animation.split( ',' )\n\t\t.filter( function ( anim ) {\n\t\t\t// when introing, discard old animations if there are any\n\t\t\treturn anim && ( delta < 0 || !/__svelte/.test( anim ) );\n\t\t})\n\t\t.concat( id + ' ' + duration + 'ms linear 1 forwards' )\n\t\t.join( ', ' );\n}", + "wrapTransition": "function wrapTransition ( node, fn, params, intro, outgroup ) {\n\tvar obj = fn( node, params );\n\tvar duration = obj.duration || 300;\n\tvar ease = obj.easing || linear;\n\n\t// TODO share