{"name":"webpack-sources","version":"1.2.0","description":"Source code handling classes for webpack","main":"./lib/index.js","scripts":{"pretest":"npm run lint && npm run beautify-lint","test":"mocha --full-trace --check-leaks","travis":"npm run cover -- --report lcovonly","lint":"eslint lib test","beautify-lint":"beautify-lint lib/**.js test/**.js","beautify":"beautify-rewrite lib/**.js test/**.js","precover":"npm run lint && npm run beautify-lint","cover":"istanbul cover node_modules/mocha/bin/_mocha","publish-patch":"npm test && npm version patch && git push && git push --tags && npm publish"},"dependencies":{"source-list-map":"^2.0.0","source-map":"~0.6.1"},"devDependencies":{"beautify-lint":"^1.0.3","codecov.io":"^0.1.6","coveralls":"^2.11.6","eslint":"^3.19.0","eslint-plugin-nodeca":"^1.0.3","istanbul":"^0.4.1","js-beautify":"^1.5.10","mocha":"^3.4.2","should":"^11.2.1"},"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","gitHead":"30d2a800c36906a0f28e62dac8b8cb239d1403c5","_id":"webpack-sources@1.2.0","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"sokra","email":"tobias.koppers@googlemail.com"},"dist":{"integrity":"sha512-9BZwxR85dNsjWz3blyxdOhTgtnQvv3OEs5xofI0wPYTwu5kaWxS08UuD1oI7WLBLpRO+ylf0ofnXLXWmGb2WMw==","shasum":"18181e0d013fce096faf6f8e6d41eeffffdceac2","tarball":"http://registry-npm.ywwl.com/webpack-sources/download/webpack-sources-1.2.0.tgz","fileCount":14,"unpackedSize":30017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhoz0CRA9TVsSAnZWagAA5CMQAID/Qatt3Rfz+cLxZLM4\nacb1ecA7wgV55iqAABKuo73vdjHTdLZiDHU7aoEURVLD8LQP3K0G59zoDVXo\nJcrP/44vp0bPabcwavJjADMKJ5i7Z79X5zrkrgzLsP32c+XoR9iU8/6ABV3y\nDtLVKE5rgZlU9+E8kerUuyc5hsedIXyEnn6KKGSJY2Y6OjGXHjVWEC/5J4/e\nRhsoW3x5958eavxc+tkheftiZu/sx/3Tkxz3devSqn8eHN7JI7vADUd4kUsg\n/tPrV9MwuDrm+rQ8kpc1F9QlclatUzg+eHvEWSIpvZyJiMq/2vEA4g2pIghk\n87uM/5EZWBSpNKRvHhpnOg4vKVdzBsjCYa7epQ0MzEhnUHfXerMVOogDzSO8\nD52h/13RSuVJqCY7OU2pO2x/4PQXes76/A7xrGwTHgF9aL25RiL4b2JGnUKO\nSPXcrzh6dJE5cMIvBoPcOa1A9YeXOOYLuGrnklG76rYq+C12EpqFMz+uoa+r\nBsTFFBcJoDI6Wzh1+rKPR3spe9g5+VtdBGIyM+jijNYzCiBtYl5xW503LIt7\nwdhr6HOfyr9tndJnfUO5s26ZUkqYviVm5DELY9g8HiXvGl9KuImjhD/Gh5bh\nkfZCOCByDQiW/C6B0InFxzbHhE/lKxN0QFAvQBA9mp5neGT1WDyU6V2AQBvq\nPMDt\r\n=zF3m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBEwU7RH4wpTaUNHDZbREcZwf2o+jTurrQ8OwVMh2soHAiAiMFmWxj7g0RKJiixFljxPF1/Iz/Ec2qVmjVdmTfN2SQ=="}],"size":7982,"noattachment":false,"key":"/webpack-sources/-/webpack-sources-1.2.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_1.2.0_1535544563641_0.6014773428826166"},"_hasShrinkwrap":false,"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```typescript\nSource.prototype.source() -> String | Buffer\n```\n\nReturns the represented source code as string or Buffer (for binary Sources).\n\n#### `buffer`\n\n```typescript\nSource.prototype.buffer() -> Buffer\n```\n\nReturns the represented source code as Buffer. Strings are converted to utf-8.\n\n#### `size`\n\n```typescript\nSource.prototype.size() -> Number\n```\n\nReturns the size in bytes of the represented source code.\n\n#### `map`\n\n```typescript\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\n#### `sourceAndMap`\n\n```typescript\nSource.prototype.sourceAndMap(options?: Object) -> {\n\tsource: String | Buffer,\n\tmap: Object | null\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```typescript\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```typescript\nnew RawSource(sourceCode: String | Buffer)\n```\n\n## `OriginalSource`\n\nRepresents source code, which is a copy of the original file.\n\n```typescript\nnew OriginalSource(\n\tsourceCode: String | Buffer,\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```typescript\nnew SourceMapSource(\n\tsourceCode: String | Buffer,\n\tname: String,\n\tsourceMap: Object | String | Buffer,\n\toriginalSource?: String | Buffer,\n\tinnerSourceMap?: Object | String | Buffer,\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## `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```typescript\nnew CachedSource(source: Source)\nnew CachedSource(source: Source | () => Source, cachedData?: CachedData)\n```\n\nInstead of passing a `Source` object directly one can pass an function that returns a `Source` object. The function is only called when needed and once.\n\n### Public methods\n\n#### `getCachedData()`\n\nReturns the cached data for passing to the constructor. All cached entries are converted to Buffers and strings are avoided.\n\n#### `original()`\n\nReturns the original `Source` object.\n\n#### `originalLazy()`\n\nReturns the original `Source` object or a function returning these.\n\n## `PrefixSource`\n\nPrefix every line of the decorated `Source` with a provided string.\n\n```typescript\nnew PrefixSource(\n\tprefix: String,\n\tsource: Source | String | Buffer\n)\n```\n\n## `ConcatSource`\n\nConcatenate multiple `Source`s or strings to a single source.\n\n```typescript\nnew ConcatSource(\n\t...items?: Source | String\n)\n```\n\n### Public methods\n\n#### `add`\n\n```typescript\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```typescript\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```typescript\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\n## `CompatSource`\n\nConverts a Source-like object into a real Source object.\n\n### Public methods\n\n#### static `from`\n\n```typescript\nCompatSource.from(sourceLike: any | Source)\n```\n\nIf `sourceLike` is a real Source it returns it unmodified. Otherwise it returns it wrapped in a CompatSource.\n","publish_time":1535544563738,"_cnpm_publish_time":1535544563738,"dist-tags":{"beta":"2.0.0-beta.10","latest":"3.7.0"}}