wallet-core/node_modules/webpack-sources/lib/RawSource.js

39 lines
691 B
JavaScript
Raw Normal View History

2017-05-03 15:35:00 +02:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
2017-08-14 05:01:11 +02:00
"use strict";
2017-05-03 15:35:00 +02:00
var Source = require("./Source");
var SourceNode = require("source-map").SourceNode;
var SourceListMap = require("source-list-map").SourceListMap;
2017-08-14 05:01:11 +02:00
class RawSource extends Source {
constructor(value) {
super();
this._value = value;
}
2017-05-03 15:35:00 +02:00
2017-08-14 05:01:11 +02:00
source() {
return this._value;
}
2017-05-03 15:35:00 +02:00
2017-08-14 05:01:11 +02:00
map(options) {
return null;
}
2017-05-03 15:35:00 +02:00
2017-08-14 05:01:11 +02:00
node(options) {
return new SourceNode(null, null, null, this._value);
}
2017-05-03 15:35:00 +02:00
2017-08-14 05:01:11 +02:00
listMap(options) {
return new SourceListMap(this._value);
}
2017-05-03 15:35:00 +02:00
2017-08-14 05:01:11 +02:00
updateHash(hash) {
hash.update(this._value);
}
}
2017-05-03 15:35:00 +02:00
2017-08-14 05:01:11 +02:00
module.exports = RawSource;