Sha256: 69c68f781b369b19dc08638be4b3da3845b736586ae858becfd9cd7ab6e57d68

Contents?: true

Size: 822 Bytes

Versions: 7

Compression:

Stored size: 822 Bytes

Contents

/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
var getNumberOfLines = require("./helpers").getNumberOfLines;

function CodeNode(generatedCode) {
	this.generatedCode = generatedCode;
}
module.exports = CodeNode;

CodeNode.prototype.clone = function() {
	return new CodeNode(this.generatedCode);
}

CodeNode.prototype.getGeneratedCode = function() {
	return this.generatedCode;
};

CodeNode.prototype.getMappings = function(mappingsContext) {
	var lines = getNumberOfLines(this.generatedCode);
	return Array(lines+1).join(";");
};

CodeNode.prototype.addGeneratedCode = function(generatedCode) {
	this.generatedCode += generatedCode;
};

CodeNode.prototype.mapGeneratedCode = function(fn) {
	this.generatedCode = fn(this.generatedCode);
};

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
ilog-0.4.1 node_modules/source-list-map/lib/CodeNode.js
ilog-0.4.0 node_modules/source-list-map/lib/CodeNode.js
ilog-0.3.3 node_modules/source-list-map/lib/CodeNode.js
lanes-0.8.0 node_modules/source-list-map/lib/CodeNode.js
gulp_assets-1.0.0.pre.5 template/node_modules/webpack/node_modules/webpack-core/node_modules/source-list-map/lib/CodeNode.js
gulp_assets-1.0.0.pre.4 template/node_modules/webpack/node_modules/webpack-core/node_modules/source-list-map/lib/CodeNode.js
gulp_assets-1.0.0.pre.3 template/node_modules/webpack/node_modules/webpack-core/node_modules/source-list-map/lib/CodeNode.js