{"name":"webpack-sources","version":"2.0.0-beta.0","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)\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\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\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":"6438e9022885426431f581c8437855d17b6e0e44","_id":"webpack-sources@2.0.0-beta.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"dist":{"integrity":"sha512-d7mJcjNdNa0hTOzGNdhIM/lVU+Xp1UxTVh42rEjH2/0U/deiaUXJtzj1npqo4TJzEjnXHaIvrMDgWwM/mpiQMw==","shasum":"f57b7a466f015132c70d8125d6d36993968854d5","tarball":"http://registry-npm.ywwl.com/webpack-sources/download/webpack-sources-2.0.0-beta.0.tgz","fileCount":14,"unpackedSize":32584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQixoCRA9TVsSAnZWagAAN6oQAIRMmn2d7v7TIVnRFaGN\nQUqCpysiN/yvtshHq/CavgqCrqT6g+2trPSANQKUDf/h/i4kLyxTHEMD3Ydz\n1lrGxqtYnGYyx6JZZGFDFMiFQNk8ysZuKTE18tp7Lolvxwix77DvDYW5kSWj\nZAysEfr5x90s0EqW/NvfTgR3JrGoSP1GepGC8StxMYUIDMceLjxD4uFwl4AG\nRKc6qtha3gWZeuXBpr+gBovAofpozJoQGH23BkQSykj+Tc1UPo+nmnoPjkhJ\nSxu6eg0lYfMYZo44LWIbGhrNYym6BH82rPusmSfAmj0H1c+vQ3+ujPkkE/UC\nlsvUVSRzobsyDxe4JHbp/FFtIuyXQkzqkCbgb0QVDMoYK+1FexI0Xvhv9U0w\nGTVyK512SMOK2fXg7C1P8NYKcAdaqDbYdj4KHDe69XGC0lWOY+99sF2FATMP\n+7CFS3V1NMoQ/6O4EZUtznepxKRiKiZI0ghZZAN24EnUuFPiMjf1NK/a8Irg\n2wiDva7tPd/N0CtCTKhtIX9HmBSb1VPsj8NiGCNZaktrL8roKqBM3+IG+x75\n29s+Ti6Fj48xqgtzU+EW0pcMyQ00mjF91iHanCwIZwLc2iF1MNh0gs5ji5Yr\nW/4FpH0xLFBHS7HZw9TxJb5midlMp54VlRW0Zr4TT5LFxYODMWf66faFcf9l\nD8NN\r\n=t/t1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICSb51pAsoydLHLnWv+91y9XUNrhMTl0R4mOhnArwovgAiEArnFb9gTvZqL2jqe5tx6SgDl5sOvLgxfvvjE1LSxXI3g="}],"size":8642,"noattachment":false,"key":"/webpack-sources/-/webpack-sources-2.0.0-beta.0.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.0_1547840615877_0.9774733786111278"},"_hasShrinkwrap":false,"publish_time":1547840615990,"_cnpm_publish_time":1547840615990,"dist-tags":{"beta":"2.0.0-beta.10","latest":"3.7.0"}}