MCPcopy
hub / github.com/less/less.js / constructor

Method constructor

packages/less/lib/less/source-map-output.js:3–29  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

1export default function (environment) {
2 class SourceMapOutput {
3 constructor(options) {
4 this._css = [];
5 this._rootNode = options.rootNode;
6 this._contentsMap = options.contentsMap;
7 this._contentsIgnoredCharsMap = options.contentsIgnoredCharsMap;
8 if (options.sourceMapFilename) {
9 this._sourceMapFilename = options.sourceMapFilename.replace(/\\/g, '/');
10 }
11 this._outputFilename = options.outputFilename ? options.outputFilename.replace(/\\/g, '/') : options.outputFilename;
12 this.sourceMapURL = options.sourceMapURL;
13 if (options.sourceMapBasepath) {
14 this._sourceMapBasepath = options.sourceMapBasepath.replace(/\\/g, '/');
15 }
16 if (options.sourceMapRootpath) {
17 this._sourceMapRootpath = options.sourceMapRootpath.replace(/\\/g, '/');
18 if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== '/') {
19 this._sourceMapRootpath += '/';
20 }
21 } else {
22 this._sourceMapRootpath = '';
23 }
24 this._outputSourceFiles = options.outputSourceFiles;
25 this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator();
26
27 this._lineNumber = 0;
28 this._column = 0;
29 }
30
31 removeBasepath(path) {
32 if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) {

Callers

nothing calls this directly

Calls 1

getSourceMapGeneratorMethod · 0.80

Tested by

no test coverage detected