babel-plugin-transform-magic-currying
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -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>", |
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
10782
23
252