Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-rewrite-flowtyped-modules

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-rewrite-flowtyped-modules - npm Package Compare versions

Comparing version 0.0.3 to 0.0.5

.github/workflows/npm-publish.yml

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc