Bones/node_modules/magic-string/dist/magic-string.es6.js.map

1 line
65 KiB
Plaintext
Raw Normal View History

2017-05-17 13:45:25 -04:00
{"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\tt