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

babel-plugin-transform-magic-currying

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-magic-currying - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

test/fixtures/ignored-functions/actual.js

12

lib/index.js

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -30,3 +30,3 @@ Object.defineProperty(exports, "__esModule", {

if (hasDirective(node, "no curry") || node.id.name === "_magicCurrying") {
if (hasDirective(node, "no curry") || ignoredFunctionNames.includes(node.id.name)) {
return; // All is already done

@@ -48,3 +48,3 @@ }

if (hasDirective(node, "no curry") || node.id !== null && (node.id.name === "_magicCurrying" || node.id.name === "_magicCurrying_fn") || t.isCallExpression(parent) && parent.callee.name === "_magicCurrying") {
if (hasDirective(node, "no curry") || node.id !== null && ignoredFunctionNames.includes(node.id.name) || t.isCallExpression(parent) && parent.callee.name === "_magicCurrying") {
return; // All is already done

@@ -91,3 +91,3 @@ }

var _babelTemplate = require("babel-template");
var _babelTemplate = require('babel-template');

@@ -98,2 +98,4 @@ var _babelTemplate2 = _interopRequireDefault(_babelTemplate);

var buildMagicCurryingGlobalFunction = (0, _babelTemplate2.default)("\n function _magicCurrying(fn) {\n return function _magicCurrying_fn() {\n var params = Array.prototype.slice.call(arguments);\n if (params.length >= fn.length) {\n return fn.apply(this, params);\n }\n return function _magicCurrying() {\n var next = Array.prototype.slice.call(arguments);\n return _magicCurrying_fn.apply(this, params.concat(next));\n };\n };\n }\n");
var buildMagicCurryingGlobalFunction = (0, _babelTemplate2.default)('\n function _magicCurrying(fn) {\n return function _magicCurrying_fn() {\n var params = Array.prototype.slice.call(arguments);\n if (params.length >= fn.length) {\n return fn.apply(this, params);\n }\n return function _magicCurrying() {\n var next = Array.prototype.slice.call(arguments);\n return _magicCurrying_fn.apply(this, params.concat(next));\n };\n };\n }\n');
var ignoredFunctionNames = ['_magicCurrying', '_magicCurrying_fn', '_interopRequireDefault'];
{
"name": "babel-plugin-transform-magic-currying",
"version": "0.0.1",
"version": "0.0.2",
"description": "Babel transform plugin for magic auto currying",

@@ -5,0 +5,0 @@ "author": "Quentin Gerodel <me@quentingerodel.eu>",

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