{"name":"webpack-sources","version":"2.0.0-beta.3","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":">=6.11.5"},"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":"d240fb8092fd0a4e9c1b5ec72bbc3d54d41a338c","_id":"webpack-sources@2.0.0-beta.3","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-ncnvMMP5B/DDkqgPVG8eXTFD+Yk1ch6AKcyRRlvB9B/4DL1exaF1Xh78Y7xcTXwhpVsL2051KSEfl8MkP75yzg==","shasum":"4da69f67f34e3a3d1633a82b6db8a6995f4a7f13","tarball":"http://registry-npm.ywwl.com/webpack-sources/download/webpack-sources-2.0.0-beta.3.tgz","fileCount":15,"unpackedSize":39540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSETZCRA9TVsSAnZWagAAwCkP/05jvTBYCNY9Ep1eIPOe\nHZMUoc3krUY97f2DNoP1XtgIy76rc1ZVlJvTqy4mGsIlXBZ0kHMR0MYnXBEv\n4a/PY5/knuDkgBiZCNuy8Uiia5XdYuDsa4OwJHTHslMC/5esm0hzsqwmkXAE\nQcVyZzJ52fhmXmFOrVgE/veX7O+Nm8DEhGDtX1JLFQ4GL23PkZ4lghuqo2bo\n1ra3YBQzlwBaZveYLVffxmG7D8ef0DGl4nlNTUdw3I3pWxiKS2SNXzPnhuo6\nYRPTfLlbudjJFAKg61TE6VlRKHNqREivR3KbBELVBhNOJqv0DEtbCwlqwUiP\n73QsqYvJx8n1t29lQzNOFuwHdBxtLe4PmGEFjZGuXQCwnjZjoqgsIdWTcFV4\nVLuP6pvpExJt6d/33Qa4tBOCfWHVl5Mt8EzGg54dLp+EXI3FhrYktQWOS0d3\nqr1rDumoUnyd2cYKVwocRbBM5Q0qmRziiVKlQiGZ0VENdL259FOQD9R2+aMs\nPLVDb5b4G4U6cMtQzp/B9hI6gxsrOThMaY3Zin3LCg/gWwgIcEL2sY4RFFnS\neyOtQTPpahvj6DU0//nnjoVvR//tsY4fgXRvlBOyesmr0hqpYB2pM1xCOgq1\nQviRXtI/QWcJhoJ297DntaNdCDSs/UTidfaxn7ao7OZbhDFEmKRIanDw/9Qo\nruHD\r\n=wmpS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG9rIi+frWUFYlDEnpQ1BhwpRB/fJeca2KpQrcpBhMtOAiAzUz2A1z9kZKefflEPjCT/vwno7GzcpCV1kHnQbUjcYQ=="}],"size":10243,"noattachment":false,"key":"/webpack-sources/-/webpack-sources-2.0.0-beta.3.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"}],"_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-sources_2.0.0-beta.3_1565017305135_0.6160441220609603"},"_hasShrinkwrap":false,"publish_time":1565017305305,"_cnpm_publish_time":1565017305305,"dist-tags":{"beta":"2.0.0-beta.10","latest":"3.7.0"}}