{"name":"webpack-sources","version":"2.0.0-beta.2","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":"95c52e67c16671e6426a9176d36d8fae3d561c0b","_id":"webpack-sources@2.0.0-beta.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"dist":{"integrity":"sha512-1TtHKmyK/G6F61c78cwJueyexc2A2mHHC7L+oQ7g9j09cM40M4zUDij37IB9+gVvXBC5jGcJ6HQwmwV0skVvVA==","shasum":"9e820680e6fa0d05b228754fe95e27fba63b8521","tarball":"http://registry-npm.ywwl.com/webpack-sources/download/webpack-sources-2.0.0-beta.2.tgz","fileCount":15,"unpackedSize":39512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdSBd8CRA9TVsSAnZWagAAvNEP/i6WsIqOhA4J16gnqRIO\nXOWO4try2mUOaKC/q+dvmgGhdo6ZRx3ipSvGHkkfwrn7ov7hfi60fLlkaLTf\nl/IrlmLW8iHmQbuqeXaBhbGyhRrt3efFgnEvRwX3KuHndfm5T4TcaZKvBoBU\nLydcahkgqOISUqXXuEFlHGeSOmLDVWJakAwuh86UKIe62kpJjumzn+51xqx5\n7ZsmtdzNVtOy7LSWJcoe2pZ5tpT2Xic2AS31OfQGys8TSBXxlWW8WCzcKliQ\nFwu9zf9XBTSYfUTqK3/rvjb2FWJQjx1DN1f4SmPlgOqlJnnn7etIorfimEH5\nYGfGTBx410PahN3PmNix5dyB/XKyJnKsrzstzBG+m4pt0yHjy4/gBZRqeQB+\nx0CQmydRFLiJkTlPuClOsVVDNH/8xMCh5zl6xQRmNiuhNVjgCgSXGRSVbhFE\njyV218cWD/yJzgwgVmq/4Wgm4wUSkofKdtiI8v3YrD8pMQP1GGwQC/l3OqGQ\ny4EO4kHPobtCIVZzdqt2yVQyGdqiZira4mr9TOA6zz/bb+AKIhWza0fEnGxe\nAhZna6U3I2oYO27e51RLCCn00zELulZ3vmkbuAzL+ecfcbKmBZdn+m01e/Hf\noDb48z8vBb+0L76kYNaBlFh6QugpLXCIiEaNC4BtMk3vRe08E7gpdfRCQ9wH\n7SjV\r\n=rGpj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDpthw6xNgdCR8T64dcHc5Bm3yG35skghQyiTjYUVw4fAiEAkjxmyYqlMfKWuOj8EJwNfhsd4++GjW4CH9RttMvep7I="}],"size":10246,"noattachment":false,"key":"/webpack-sources/-/webpack-sources-2.0.0-beta.2.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.2_1565005691693_0.007510184343851867"},"_hasShrinkwrap":false,"publish_time":1565005691786,"_cnpm_publish_time":1565005691786,"dist-tags":{"beta":"2.0.0-beta.10","latest":"3.7.0"}}