{"name":"webpack-sources","version":"2.0.0-beta.5","description":"Source code handling classes for webpack","main":"./lib/index.js","scripts":{"pretest":"yarn lint","test":"mocha --full-trace --check-leaks","travis":"yarn cover --report lcovonly","lint":"eslint lib test","precover":"yarn lint","cover":"istanbul cover node_modules/mocha/bin/_mocha"},"dependencies":{"source-list-map":"^2.0.1","source-map":"~0.6.1"},"devDependencies":{"coveralls":"^3.0.2","eslint":"^5.12.0","eslint-config-prettier":"^3.5.0","eslint-plugin-mocha":"^5.2.1","eslint-plugin-node":"^8.0.1","eslint-plugin-nodeca":"^1.0.3","eslint-plugin-prettier":"^3.0.1","istanbul":"^0.4.1","mocha":"^5.2.0","prettier":"^1.15.3","should":"^13.2.3","sourcemap-validator":"^1.1.0"},"engines":{"node":">=10.13.0"},"repository":{"type":"git","url":"git+https://github.com/webpack/webpack-sources.git"},"keywords":["webpack","source-map"],"author":{"name":"Tobias Koppers @sokra"},"license":"MIT","bugs":{"url":"https://github.com/webpack/webpack-sources/issues"},"homepage":"https://github.com/webpack/webpack-sources#readme","readme":"# webpack-sources\n\nContains multiple classes which represent a `Source`. A `Source` can be asked for source code, size, source map and hash.\n\n## `Source`\n\nBase class for all sources.\n\n### Public methods\n\nAll methods should be considered as expensive as they may need to do computations.\n\n#### `source`\n\n```js\nSource.prototype.source() -> String | Buffer\n```\n\nReturns the represented source code as string or Buffer (for binary Sources).\n\n#### `buffer`\n\n```js\nSource.prototype.buffer() -> Buffer\n```\n\nReturns the represented source code as Buffer. Strings are converted to utf-8.\n\n#### `size`\n\n```js\nSource.prototype.size() -> Number\n```\n\nReturns the size in bytes of the represented source code.\n\n#### `map`\n\n```js\nSource.prototype.map(options?: Object) -> Object | null\n```\n\nReturns the SourceMap of the represented source code as JSON. May return `null` if no SourceMap is available.\n\nThe `options` object can contain the following keys:\n\n- `columns: Boolean` (default `true`): If set to false the implementation may omit mappings for columns.\n- `module: Boolean` (default `true`): If set to false the implementation may omit inner mappings for modules.\n\n#### `sourceAndMap`\n\n```js\nSource.prototype.sourceAndMap(options?: Object) -> {\n\tsource: String | Buffer,\n\tmap: Object\n}\n```\n\nReturns both, source code (like `Source.prototype.source()` and SourceMap (like `Source.prototype.map()`). This method could have better performance than calling `source()` and `map()` separately.\n\nSee `map()` for `options`.\n\n#### `updateHash`\n\n```js\nSource.prototype.updateHash(hash: Hash) -> void\n```\n\nUpdates the provided `Hash` object with the content of the represented source code. (`Hash` is an object with an `update` method, which is called with string values)\n\n## `RawSource`\n\nRepresents source code without SourceMap.\n\n```js\nnew RawSource(sourceCode: String)\n```\n\n## `OriginalSource`\n\nRepresents source code, which is a copy of the original file.\n\n```js\nnew OriginalSource(\n\tsourceCode: String,\n\tname: String\n)\n```\n\n- `sourceCode`: The source code.\n- `name`: The filename of the original source code.\n\nOriginalSource tries to create column mappings if requested, by splitting the source code at typical statement borders (`;`, `{`, `}`).\n\n## `SourceMapSource`\n\nRepresents source code with SourceMap, optionally having an additional SourceMap for the original source.\n\n```js\nnew SourceMapSource(\n\tsourceCode: String,\n\tname: String,\n\tsourceMap: Object | String,\n\toriginalSource?: String,\n\tinnerSourceMap?: Object | String,\n\tremoveOriginalSource?: boolean\n)\n```\n\n- `sourceCode`: The source code.\n- `name`: The filename of the original source code.\n- `sourceMap`: The SourceMap for the source code.\n- `originalSource`: The source code of the original file. Can be omitted if the `sourceMap` already contains the original source code.\n- `innerSourceMap`: The SourceMap for the `originalSource`/`name`.\n- `removeOriginalSource`: Removes the source code for `name` from the final map, keeping only the deeper mappings for that file.\n\nThe `SourceMapSource` supports \"identity\" mappings for the `innerSourceMap`.\nWhen original source matches generated source for a mapping it's assumed to be mapped char by char allowing to keep finer mappings from `sourceMap`.\n\n\n## `CachedSource`\n\nDecorates a `Source` and caches returned results of `map`, `source`, `buffer`, `size` and `sourceAndMap` in memory. `updateHash` is not cached.\nIt tries to reused cached results from other methods to avoid calculations, i. e. when `source` is already cached, calling `size` will get the size from the cached source, calling `sourceAndMap` will only call `map` on the wrapped Source.\n\n```js\nnew CachedSource(source: Source)\n```\n\n## `PrefixSource`\n\nPrefix every line of the decorated `Source` with a provided string.\n\n```js\nnew PrefixSource(\n\tprefix: String,\n\tsource: Source\n)\n```\n\n## `ConcatSource`\n\nConcatenate multiple `Source`s or strings to a single source.\n\n```js\nnew ConcatSource(\n\t...items?: Source | String\n)\n```\n\n### Public methods\n\n#### `add`\n\n```js\nConcatSource.prototype.add(item: Source | String)\n```\n\nAdds an item to the source.\n\n## `ReplaceSource`\n\nDecorates a `Source` with replacements and insertions of source code.\n\nThe `ReplaceSource` supports \"identity\" mappings for child source.\nWhen original source matches generated source for a mapping it's assumed to be mapped char by char allowing to split mappings at replacements/insertions.\n\n### Public methods\n\n#### `replace`\n\n```js\nReplaceSource.prototype.replace(\n\tstart: Number,\n\tend: Number,\n\treplacement: String\n)\n```\n\nReplaces chars from `start` (0-indexed, inclusive) to `end` (0-indexed, inclusive) with `replacement`.\n\nLocations represents locations in the original source and are not influenced by other replacements or insertions.\n\n#### `insert`\n\n```js\nReplaceSource.prototype.insert(\n\tpos: Number,\n\tinsertion: String\n)\n```\n\nInserts the `insertion` before char `pos` (0-indexed).\n\nLocation represents location in the original source and is not influenced by other replacements or insertions.\n\n#### `original`\n\nGet decorated `Source`.\n","readmeFilename":"README.md","gitHead":"913329a70ef7f28482e0186faef6831a298a0db2","_id":"webpack-sources@2.0.0-beta.5","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"dist":{"integrity":"sha512-Y0NWr3nIeJbHzQciKPjWkERbRrmqZPhE4t8K5qOzl4dhJViIdBnvutCCAQ9PKj6MC8lo4Wytu+SZ9Ct8vhX/cQ==","shasum":"aac603d9fdf04ce96276cf845cd9bb9afd660c4a","tarball":"http://registry-npm.ywwl.com/webpack-sources/download/webpack-sources-2.0.0-beta.5.tgz","fileCount":15,"unpackedSize":41622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdrvdZCRA9TVsSAnZWagAAeRcP/idcdTNY+ns2lozmJfc8\nbHM2jVcT45kK/uoyE1cvgLmQExG/m97cgvwLC/n+4WlP6pTW+gJVECqcoqhh\nRMUsCNa5ZVaTTt5gUGymhdB+3b7I2B2VAATSEyxbsjNzUyUVr5r/zUDS3LAO\nA+UNIkzb9fZBdFT8jQdFxLcViq4+00XpEtLAkr6nnOae61vPffbeom9Bsotb\nQdvfMOCiYhHh8C0UknX8wKADIiTAaTiJqFjMpx0aUvevHNXunYgXY9mohpNo\nO0GodZyAQQpZgtc313091qIpMt/lflLIWD7621SccOfBeS1U1m6ZV6eho71i\nIUUPFpV0WCkno7xrvhVvaiFZeCWZ8iMKWSNnWhG3JFkWxd6FXEAwEVPUumEE\n2SC/up5QksrJ256Veab7j0+E6fyTj4YSQ8NcGAdjgye9u5M7BA+cvaQ9sbxf\nC5MrCyuaQODoYEv/bv3Y6JY6GV4y6TUlfFRmLBCcc+z3j0EBYEg85hlWwlDM\ndV+7kJK2kQGkSWu767DXGazJCtqCceowl5wshluoklk+J+JGXs/RiUD3hNhi\nFBXxcQN9+t8GKt6fZZza/cg73tyW+CEP0LD6zG5VZfnxiQrKE5XxEbj7QN5q\nQdC9fy6AN7qwSm7KZQSWSwav+U+DGSqxBmTG3uMCa3L/JCiiAt2R/0NLWvgC\nucaa\r\n=5s9k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwcNDpSxgZhMrng6oWH8qDMfhnrd9BDYSWfG9d4FKwOAIhAKyfulmH1ApwGrOMN2GjgZWLhPwLoSldJfbvxCB8pfw4"}],"size":10502,"noattachment":false,"key":"/webpack-sources/-/webpack-sources-2.0.0-beta.5.tgz"},"maintainers":[{"name":"bebraw","email":"bebraw@gmail.com"},{"name":"jhnns","email":"mail@johannesewald.de"},{"name":"sokra","email":"tobias.koppers@googlemail.com"},{"name":"spacek33z","email":"kees@webduck.nl"},{"name":"thelarkinn","email":"sean.larkin@cuw.edu"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-sources_2.0.0-beta.5_1571747671817_0.22840850453452033"},"_hasShrinkwrap":false,"publish_time":1571747671973,"_cnpm_publish_time":1571747671973,"dist-tags":{"beta":"2.0.0-beta.10","latest":"3.7.0"}}