gulp-rewrite-flowtyped-modules
Advanced tools
Comparing version 0.0.3 to 0.0.5
{ | ||
"name": "gulp-rewrite-flowtyped-modules", | ||
"description": "A flow-syntax-aware module dependency rewriter gulp plugin.", | ||
"version": "0.0.3", | ||
"version": "0.0.5", | ||
"main": "src/index.js", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -13,3 +13,3 @@ # gulp-rewrite-flowtyped-modules | ||
[fbjs](https://github.com/facebook/fbjs) package. The difference here is that | ||
it isn't done through Babel, and can therefore keep flow types intact. | ||
it isn't done through [`flow-parser`](https://www.npmjs.com/package/flow-parser), and therefore keeps flow types intact. | ||
@@ -16,0 +16,0 @@ ## Options |
@@ -9,3 +9,3 @@ 'use strict'; | ||
* | ||
* prefix: module prefix defualts to './', (not used when modules are mapped) | ||
* prefix: module prefix defaults to './', (not used when modules are mapped) | ||
* map: module => rewriteModule map | ||
@@ -54,6 +54,5 @@ * flow: options to pass to the flow-parser on parse(...) | ||
const module = this._opts.map[ast.value] || this._opts.prefix + ast.value; | ||
const quote = ast.raw[0]; // grab the quote off the string | ||
const [beg, end] = ast.range; | ||
this._dst += this._src.substring(this._idx, beg) + quote + module + quote; | ||
this._idx = end; | ||
const replacement = ast.raw[0] + module + ast.raw[0]; // add quotes | ||
this._dst += this._src.substring(this._idx, ast.range[0]) + replacement; | ||
this._idx = ast.range[1]; | ||
} | ||
@@ -60,0 +59,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6015
7
66