parent
f5a81e71bd
commit
211c9802a5
@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
module.exports = File;
|
module.exports = File;
|
||||||
|
|
||||||
var SHEBANG_REGEX = /^\#\!.*/;
|
|
||||||
|
|
||||||
var sourceMapToComment = require("source-map-to-comment");
|
var sourceMapToComment = require("source-map-to-comment");
|
||||||
|
var shebangRegex = require("shebang-regex");
|
||||||
var isFunction = require("lodash/lang/isFunction");
|
var isFunction = require("lodash/lang/isFunction");
|
||||||
var transform = require("./index");
|
var transform = require("./index");
|
||||||
var generate = require("../generation");
|
var generate = require("../generation");
|
||||||
@ -247,12 +246,13 @@ File.prototype.getModuleFormatter = function (type) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
File.prototype.parseShebang = function (code) {
|
File.prototype.parseShebang = function (code) {
|
||||||
var shebangMatch = code.match(SHEBANG_REGEX);
|
var shebangMatch = shebangRegex.exec(code);
|
||||||
|
|
||||||
if (shebangMatch) {
|
if (shebangMatch) {
|
||||||
this.shebang = shebangMatch[0];
|
this.shebang = shebangMatch[0];
|
||||||
|
|
||||||
// remove shebang
|
// remove shebang
|
||||||
code = code.replace(SHEBANG_REGEX, "");
|
code = code.replace(shebangRegex, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
|||||||
@ -60,6 +60,7 @@
|
|||||||
"regenerator-babel": "0.8.10-2",
|
"regenerator-babel": "0.8.10-2",
|
||||||
"regexpu": "^1.1.1",
|
"regexpu": "^1.1.1",
|
||||||
"repeating": "^1.1.2",
|
"repeating": "^1.1.2",
|
||||||
|
"shebang-regex": "^1.0.0",
|
||||||
"slash": "^1.0.0",
|
"slash": "^1.0.0",
|
||||||
"source-map": "^0.1.43",
|
"source-map": "^0.1.43",
|
||||||
"source-map-support": "^0.2.9",
|
"source-map-support": "^0.2.9",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user