(string: string, options: MagicStringOptions = {})
| 79 | declare stats: Stats |
| 80 | |
| 81 | constructor(string: string, options: MagicStringOptions = {}) { |
| 82 | const chunk = new Chunk(0, string.length, string) |
| 83 | |
| 84 | Object.defineProperties(this, { |
| 85 | original: { writable: true, value: string }, |
| 86 | outro: { writable: true, value: '' }, |
| 87 | intro: { writable: true, value: '' }, |
| 88 | firstChunk: { writable: true, value: chunk }, |
| 89 | lastChunk: { writable: true, value: chunk }, |
| 90 | lastSearchedChunk: { writable: true, value: chunk }, |
| 91 | byStart: { writable: true, value: {} }, |
| 92 | byEnd: { writable: true, value: {} }, |
| 93 | filename: { writable: true, value: options.filename }, |
| 94 | indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, |
| 95 | sourcemapLocations: { writable: true, value: new BitSet() }, |
| 96 | storedNames: { writable: true, value: {} }, |
| 97 | indentStr: { writable: true, value: undefined }, |
| 98 | ignoreList: { writable: true, value: options.ignoreList }, |
| 99 | offset: { writable: true, value: options.offset || 0 }, |
| 100 | }) |
| 101 | |
| 102 | if (DEBUG) { |
| 103 | Object.defineProperty(this, 'stats', { value: new Stats() }) |
| 104 | } |
| 105 | |
| 106 | this.byStart[0] = chunk |
| 107 | this.byEnd[string.length] = chunk |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false. |
nothing calls this directly
no outgoing calls
no test coverage detected