| | |
| | | |
| | | #### `source` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | Source.prototype.source() -> String | Buffer |
| | | ``` |
| | |
| | | |
| | | #### `buffer` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | Source.prototype.buffer() -> Buffer |
| | | ``` |
| | |
| | | |
| | | #### `size` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | Source.prototype.size() -> Number |
| | | ``` |
| | |
| | | |
| | | #### `map` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | Source.prototype.map(options?: Object) -> Object | null |
| | | ``` |
| | |
| | | |
| | | #### `sourceAndMap` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | Source.prototype.sourceAndMap(options?: Object) -> { |
| | | source: String | Buffer, |
| | |
| | | |
| | | #### `updateHash` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | Source.prototype.updateHash(hash: Hash) -> void |
| | | ``` |
| | |
| | | |
| | | Represents source code without SourceMap. |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | new RawSource(sourceCode: String | Buffer) |
| | | ``` |
| | |
| | | |
| | | Represents source code, which is a copy of the original file. |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | new OriginalSource( |
| | | sourceCode: String | Buffer, |
| | |
| | | |
| | | Represents source code with SourceMap, optionally having an additional SourceMap for the original source. |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | new SourceMapSource( |
| | | sourceCode: String | Buffer, |
| | |
| | | Decorates a `Source` and caches returned results of `map`, `source`, `buffer`, `size` and `sourceAndMap` in memory. `updateHash` is not cached. |
| | | It 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. |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | new CachedSource(source: Source) |
| | | new CachedSource(source: Source | () => Source, cachedData?: CachedData) |
| | |
| | | |
| | | Prefix every line of the decorated `Source` with a provided string. |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | new PrefixSource( |
| | | prefix: String, |
| | |
| | | |
| | | Concatenate multiple `Source`s or strings to a single source. |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | new ConcatSource( |
| | | ...items?: Source | String |
| | |
| | | |
| | | #### `add` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | ConcatSource.prototype.add(item: Source | String) |
| | | ``` |
| | |
| | | |
| | | #### `replace` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | ReplaceSource.prototype.replace( |
| | | start: Number, |
| | |
| | | |
| | | #### `insert` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | ReplaceSource.prototype.insert( |
| | | pos: Number, |
| | |
| | | |
| | | #### static `from` |
| | | |
| | | <!-- eslint-skip --> |
| | | ```typescript |
| | | CompatSource.from(sourceLike: any | Source) |
| | | ``` |