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

babel-plugin-mockable-imports

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-mockable-imports - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

6

CHANGELOG.md

@@ -8,2 +8,8 @@ # Changelog

## [1.4.0] - 2019-05-08
- Ignore Babel-generated CommonJS imports (https://github.com/robertknight/babel-plugin-mockable-imports/pull/8).
The plugin uses the heuristic that CommonJS imports are auto-generated if
the variable name starts with an underscore.
## [1.3.0] - 2019-04-11

@@ -10,0 +16,0 @@

@@ -135,3 +135,10 @@ 'use strict';

const id = path.node.id;
if (id.type === 'Identifier') {
if (id.name.startsWith('_')) {
// Assume that imports with an underscore-prefixed name have been
// automatically generated by Babel. Do not make them mockable.
return;
}
const symbol = '<CJS>';

@@ -138,0 +145,0 @@ imports.push({

6

package.json
{
"name": "babel-plugin-mockable-imports",
"version": "1.3.1",
"version": "1.4.0",
"description": "Babel plugin for mocking ES imports",
"main": "index.js",
"scripts": {
"checkformatting": "prettier --check **/*.js",
"build": "babel helpers.js --out-dir lib",
"lint": "eslint --ignore-pattern lib/* .",
"format": "prettier --write **/*.js",
"test": "mocha",
"test": "mocha && npm run lint && npm run checkformatting",
"prepublishOnly": "npm run build"

@@ -11,0 +13,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