Template Upload

This commit is contained in:
SOUTHERNCO\x2mjbyrn committed 2017-05-17 13:45:25 -04:00
1 parent 415b9c25f3
commit 7efe7605b8
11476 files changed
+2170865 -34

No files matched your search

File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"magic-string.cjs.js","sources":["../src/Chunk.js","../src/utils/btoa.js","../src/utils/SourceMap.js","../src/utils/guessIndent.js","../src/utils/getLocator.js","../src/utils/encodeMappings.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/MagicString.js","../src/utils/hasOwnProp.js","../src/Bundle.js","../src/index.js"],"sourcesContent":["export default function Chunk ( start, end, content ) {\n\tthis.start = start;\n\tthis.end = end;\n\tthis.original = content;\n\n\tthis.intro = '';\n\tthis.outro = '';\n\n\tthis.content = content;\n\tthis.storeName = false;\n\tthis.edited = false;\n\n\t// we make these non-enumerable, for sanity while debugging\n\tObject.defineProperties( this, {\n\t\tprevious: { writable: true, value: null },\n\t\tnext: { writable: true, value: null }\n\t});\n}\n\nChunk.prototype = {\n\tappend ( content ) {\n\t\tthis.outro += content;\n\t},\n\n\tclone () {\n\t\tconst chunk = new Chunk( this.start, this.end, this.original );\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t},\n\n\tcontains ( index ) {\n\t\treturn this.start < index && index < this.end;\n\t},\n\n\teachNext ( fn ) {\n\t\tlet chunk = this;\n\t\twhile ( chunk ) {\n\t\t\tfn( chunk );\n\t\t\tchunk = chunk.next;\n\t\t}\n\t},\n\n\teachPrevious ( fn ) {\n\t\tlet chunk = this;\n\t\twhile ( chunk ) {\n\t\t\tfn( chunk );\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t},\n\n\tedit ( content, storeName ) {\n\t\tthis.content = content;\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t},\n\n\tprepend ( content ) {\n\t\tthis.intro = content + this.intro;\n\t},\n\n\tsplit ( index ) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice( 0, sliceIndex );\n\t\tconst originalAfter = this.original.slice( sliceIndex );\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk( index, this.end, originalAfter );\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif ( this.edited ) {\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit( '', false );\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif ( newChunk.next ) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t},\n\n\ttoString () {\n\t\treturn this.intro + this.content + this.outro;\n\t},\n\n\ttrimEnd ( rx ) {\n\t\tthis.outro = this.outro.replace( rx, '' );\n\t\tif ( this.outro.length ) return true;\n\n\t\tconst trimmed = this.content.replace( rx, '' );\n\n\t\tif ( trimmed.length ) {\n\t\t\tif ( trimmed !== this.content ) {\n\t\t\t\tthis.split( this.start + trimmed.length ).edit( '', false );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit( '', false );\n\n\t\t\tthis.intro = this.intro.replace( rx, '' );\n\t\t\tif ( this.intro.length ) return true;\n\t\t}\n\t},\n\n\ttrimStart ( rx ) {\n\t\tthis.intro = this.intro.replace( rx, '' );\n\t\tif ( this.intro.length ) return true;\n\n\t\tconst trimmed = this.content.replace( rx, '' );\n\n\t\tif ( trimmed.length ) {\n\t\t\tif ( trimmed !== this.content ) {\n\t\t\t\tthis.split( this.end - trimmed.length );\n\t\t\t\tthis.edit( '', false );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit( '', false );\n\n\t\t\tthis.outro = this.outro.replace( rx, '' );\n\t\t\tif ( this.outro.length ) return true;\n\t\t}\n\t}\n};\n","let _btoa;\n\nif ( typeof window !== 'undefined' && typeof window.btoa === 'function' ) {\n\t_btoa = window.btoa;\n} else if ( typeof Buffer === 'function' ) {\n\t_btoa = str => new Buffer( str ).toString( 'base64' );\n} else {\n\t_btoa = () => {\n\t\tthrow new Error( 'Unsupported environment: `window.btoa` or `Buffer` should be supported.' );\n\t};\n}\n\nexport default _btoa;\n","import btoa from './btoa.js';\n\nexport default function SourceMap ( properties ) {\n\tthis.version = 3;\n\n\tthis.file = properties.file;\n\tthis.sources = properties.sources;\n\tthis.sourcesContent = properties.sourcesContent;\n\tthis.names = properties.names;\n\tthis.mappings = properties.mappings;\n}\n\nSourceMap.prototype = {\n\ttoString () {\n\t\treturn JSON.stringify( this );\n\t},\n\n\ttoUrl () {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa( this.toString() );\n\t}\n};\n","export default function guessIndent ( code ) {\n\tconst lines = code.split( '\\n' );\n\n\tconst tabbed = lines.filter( line => /^\\t+/.test( line ) );\n\tconst spaced = lines.filter( line => /^ {2,}/.test( line ) );\n\n\tif ( tabbed.length === 0 && spaced.length === 0 ) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif ( tabbed.length >= spacedLine truncated
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"magic-string.es6.js","sources":["../src/Chunk.js","../src/utils/btoa.js","../src/utils/SourceMap.js","../src/utils/guessIndent.js","../src/utils/getLocator.js","../src/utils/encodeMappings.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/MagicString.js","../src/utils/hasOwnProp.js","../src/Bundle.js","../src/index.js"],"sourcesContent":["export default function Chunk ( start, end, content ) {\n\tthis.start = start;\n\tthis.end = end;\n\tthis.original = content;\n\n\tthis.intro = '';\n\tthis.outro = '';\n\n\tthis.content = content;\n\tthis.storeName = false;\n\tthis.edited = false;\n\n\t// we make these non-enumerable, for sanity while debugging\n\tObject.defineProperties( this, {\n\t\tprevious: { writable: true, value: null },\n\t\tnext: { writable: true, value: null }\n\t});\n}\n\nChunk.prototype = {\n\tappend ( content ) {\n\t\tthis.outro += content;\n\t},\n\n\tclone () {\n\t\tconst chunk = new Chunk( this.start, this.end, this.original );\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t},\n\n\tcontains ( index ) {\n\t\treturn this.start < index && index < this.end;\n\t},\n\n\teachNext ( fn ) {\n\t\tlet chunk = this;\n\t\twhile ( chunk ) {\n\t\t\tfn( chunk );\n\t\t\tchunk = chunk.next;\n\t\t}\n\t},\n\n\teachPrevious ( fn ) {\n\t\tlet chunk = this;\n\t\twhile ( chunk ) {\n\t\t\tfn( chunk );\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t},\n\n\tedit ( content, storeName ) {\n\t\tthis.content = content;\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t},\n\n\tprepend ( content ) {\n\t\tthis.intro = content + this.intro;\n\t},\n\n\tsplit ( index ) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice( 0, sliceIndex );\n\t\tconst originalAfter = this.original.slice( sliceIndex );\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk( index, this.end, originalAfter );\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif ( this.edited ) {\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit( '', false );\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif ( newChunk.next ) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t},\n\n\ttoString () {\n\t\treturn this.intro + this.content + this.outro;\n\t},\n\n\ttrimEnd ( rx ) {\n\t\tthis.outro = this.outro.replace( rx, '' );\n\t\tif ( this.outro.length ) return true;\n\n\t\tconst trimmed = this.content.replace( rx, '' );\n\n\t\tif ( trimmed.length ) {\n\t\t\tif ( trimmed !== this.content ) {\n\t\t\t\tthis.split( this.start + trimmed.length ).edit( '', false );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit( '', false );\n\n\t\t\tthis.intro = this.intro.replace( rx, '' );\n\t\t\tif ( this.intro.length ) return true;\n\t\t}\n\t},\n\n\ttrimStart ( rx ) {\n\t\tthis.intro = this.intro.replace( rx, '' );\n\t\tif ( this.intro.length ) return true;\n\n\t\tconst trimmed = this.content.replace( rx, '' );\n\n\t\tif ( trimmed.length ) {\n\t\t\tif ( trimmed !== this.content ) {\n\t\t\t\tthis.split( this.end - trimmed.length );\n\t\t\t\tthis.edit( '', false );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit( '', false );\n\n\t\t\tthis.outro = this.outro.replace( rx, '' );\n\t\t\tif ( this.outro.length ) return true;\n\t\t}\n\t}\n};\n","let _btoa;\n\nif ( typeof window !== 'undefined' && typeof window.btoa === 'function' ) {\n\t_btoa = window.btoa;\n} else if ( typeof Buffer === 'function' ) {\n\t_btoa = str => new Buffer( str ).toString( 'base64' );\n} else {\n\t_btoa = () => {\n\t\tthrow new Error( 'Unsupported environment: `window.btoa` or `Buffer` should be supported.' );\n\t};\n}\n\nexport default _btoa;\n","import btoa from './btoa.js';\n\nexport default function SourceMap ( properties ) {\n\tthis.version = 3;\n\n\tthis.file = properties.file;\n\tthis.sources = properties.sources;\n\tthis.sourcesContent = properties.sourcesContent;\n\tthis.names = properties.names;\n\tthis.mappings = properties.mappings;\n}\n\nSourceMap.prototype = {\n\ttoString () {\n\t\treturn JSON.stringify( this );\n\t},\n\n\ttoUrl () {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa( this.toString() );\n\t}\n};\n","export default function guessIndent ( code ) {\n\tconst lines = code.split( '\\n' );\n\n\tconst tabbed = lines.filter( line => /^\\t+/.test( line ) );\n\tconst spaced = lines.filter( line => /^ {2,}/.test( line ) );\n\n\tif ( tabbed.length === 0 && spaced.length === 0 ) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif ( tabbed.length >= spacedLine truncated
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"magic-string.umd.js","sources":["../src/Chunk.js","../src/utils/btoa.js","../src/utils/SourceMap.js","../src/utils/guessIndent.js","../node_modules/vlq/src/vlq.js","../src/utils/getLocator.js","../src/utils/encodeMappings.js","../src/utils/getRelativePath.js","../src/utils/isObject.js","../src/MagicString.js","../src/utils/hasOwnProp.js","../src/Bundle.js","../src/index.js"],"sourcesContent":["export default function Chunk ( start, end, content ) {\n\tthis.start = start;\n\tthis.end = end;\n\tthis.original = content;\n\n\tthis.intro = '';\n\tthis.outro = '';\n\n\tthis.content = content;\n\tthis.storeName = false;\n\tthis.edited = false;\n\n\t// we make these non-enumerable, for sanity while debugging\n\tObject.defineProperties( this, {\n\t\tprevious: { writable: true, value: null },\n\t\tnext: { writable: true, value: null }\n\t});\n}\n\nChunk.prototype = {\n\tappend ( content ) {\n\t\tthis.outro += content;\n\t},\n\n\tclone () {\n\t\tconst chunk = new Chunk( this.start, this.end, this.original );\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t},\n\n\tcontains ( index ) {\n\t\treturn this.start < index && index < this.end;\n\t},\n\n\teachNext ( fn ) {\n\t\tlet chunk = this;\n\t\twhile ( chunk ) {\n\t\t\tfn( chunk );\n\t\t\tchunk = chunk.next;\n\t\t}\n\t},\n\n\teachPrevious ( fn ) {\n\t\tlet chunk = this;\n\t\twhile ( chunk ) {\n\t\t\tfn( chunk );\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t},\n\n\tedit ( content, storeName ) {\n\t\tthis.content = content;\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t},\n\n\tprepend ( content ) {\n\t\tthis.intro = content + this.intro;\n\t},\n\n\tsplit ( index ) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice( 0, sliceIndex );\n\t\tconst originalAfter = this.original.slice( sliceIndex );\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk( index, this.end, originalAfter );\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif ( this.edited ) {\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit( '', false );\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif ( newChunk.next ) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t},\n\n\ttoString () {\n\t\treturn this.intro + this.content + this.outro;\n\t},\n\n\ttrimEnd ( rx ) {\n\t\tthis.outro = this.outro.replace( rx, '' );\n\t\tif ( this.outro.length ) return true;\n\n\t\tconst trimmed = this.content.replace( rx, '' );\n\n\t\tif ( trimmed.length ) {\n\t\t\tif ( trimmed !== this.content ) {\n\t\t\t\tthis.split( this.start + trimmed.length ).edit( '', false );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit( '', false );\n\n\t\t\tthis.intro = this.intro.replace( rx, '' );\n\t\t\tif ( this.intro.length ) return true;\n\t\t}\n\t},\n\n\ttrimStart ( rx ) {\n\t\tthis.intro = this.intro.replace( rx, '' );\n\t\tif ( this.intro.length ) return true;\n\n\t\tconst trimmed = this.content.replace( rx, '' );\n\n\t\tif ( trimmed.length ) {\n\t\t\tif ( trimmed !== this.content ) {\n\t\t\t\tthis.split( this.end - trimmed.length );\n\t\t\t\tthis.edit( '', false );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit( '', false );\n\n\t\t\tthis.outro = this.outro.replace( rx, '' );\n\t\t\tif ( this.outro.length ) return true;\n\t\t}\n\t}\n};\n","let _btoa;\n\nif ( typeof window !== 'undefined' && typeof window.btoa === 'function' ) {\n\t_btoa = window.btoa;\n} else if ( typeof Buffer === 'function' ) {\n\t_btoa = str => new Buffer( str ).toString( 'base64' );\n} else {\n\t_btoa = () => {\n\t\tthrow new Error( 'Unsupported environment: `window.btoa` or `Buffer` should be supported.' );\n\t};\n}\n\nexport default _btoa;\n","import btoa from './btoa.js';\n\nexport default function SourceMap ( properties ) {\n\tthis.version = 3;\n\n\tthis.file = properties.file;\n\tthis.sources = properties.sources;\n\tthis.sourcesContent = properties.sourcesContent;\n\tthis.names = properties.names;\n\tthis.mappings = properties.mappings;\n}\n\nSourceMap.prototype = {\n\ttoString () {\n\t\treturn JSON.stringify( this );\n\t},\n\n\ttoUrl () {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa( this.toString() );\n\t}\n};\n","export default function guessIndent ( code ) {\n\tconst lines = code.split( '\\n' );\n\n\tconst tabbed = lines.filter( line => /^\\t+/.test( line ) );\n\tconst spaced = lines.filter( line => /^ {2,}/.test( line ) );\n\n\tif ( tabbed.length === 0 && spaced.length === 0 ) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go onLine truncated