func-params
Advanced tools
Comparing version 0.9.13 to 0.9.14
@@ -48,8 +48,12 @@ /* | ||
[ "babelify", { | ||
presets: [ "es2015", "es2016", "es2017", "stage-3", "stage-2" ], | ||
plugins: [ [ "transform-runtime", { | ||
presets: [ | ||
[ "@babel/preset-env", { | ||
"targets": { | ||
"browsers": "last 8 versions, > 1%, ie 11" | ||
} | ||
} ] | ||
], | ||
plugins: [ [ "@babel/transform-runtime", { | ||
"helpers": false, | ||
"polyfill": false, | ||
"regenerator": false, | ||
"moduleName": "babel-runtime" | ||
"regenerator": false | ||
} ] ] | ||
@@ -77,8 +81,12 @@ } ], | ||
[ "babelify", { | ||
presets: [ "es2015", "es2016", "es2017", "stage-3", "stage-2" ], | ||
plugins: [ [ "transform-runtime", { | ||
presets: [ | ||
[ "@babel/preset-env", { | ||
"targets": { | ||
"node": "8.0.0" | ||
} | ||
} ] | ||
], | ||
plugins: [ [ "@babel/transform-runtime", { | ||
"helpers": false, | ||
"polyfill": false, | ||
"regenerator": false, | ||
"moduleName": "babel-runtime" | ||
"regenerator": false | ||
} ] ] | ||
@@ -85,0 +93,0 @@ } ] |
@@ -27,3 +27,3 @@ /* | ||
(function (global){ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).CacheLRU=e()}}(function(){return function(){return function e(t,n,i){function r(u,s){if(!n[u]){if(!t[u]){var l="function"==typeof _dereq_&&_dereq_;if(!s&&l)return l(u,!0);if(o)return o(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var a=n[u]={exports:{}};t[u][0].call(a.exports,function(e){return r(t[u][1][e]||e)},a,a.exports,e,t,n,i)}return n[u].exports}for(var o="function"==typeof _dereq_&&_dereq_,u=0;u<i.length;u++)r(i[u]);return r}}()({1:[function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._index={},this._LRU={newer:null},this._MRU={older:null},this._LRU.newer=this._MRU,this._MRU.older=this._LRU,this._cur=0,this._max=1/0,this._dispose=function(){},this}return i(e,[{key:"limit",value:function(e){var t=this._max;return arguments.length>0&&(this._max=e,this._purge()),t}},{key:"dispose",value:function(e){return this._dispose=e,this}},{key:"length",value:function(){return this._cur}},{key:"keys",value:function(){return this.each(function(e,t){this.push(t)},[])}},{key:"values",value:function(){return this.each(function(e){this.push(e)},[])}},{key:"each",value:function(e,t){arguments<2&&(t=this);for(var n=0,i=this._MRU.older;i!==this._LRU;)e.call(t,i.val,i.key,n++),i=i.older;return t}},{key:"has",value:function(e){return void 0!==this._index[e]}},{key:"peek",value:function(e){var t=this._index[e];if(void 0!==t){if(!(t.expires<Date.now()))return t.val;this.del(t.key)}}},{key:"touch",value:function(e){var t=this._index[e];if(void 0===t)throw new Error("touch: no such item");return this._promote(t),this}},{key:"get",value:function(e){var t=this._index[e];if(void 0!==t){if(!(t.expires<Date.now()))return this._promote(t),t.val;this.del(t.key)}}},{key:"set",value:function(e,t,n){arguments.length<3&&(n=1/0),n+=Date.now();var i=this._index[e];if(void 0===i)i={older:null,newer:null,key:e,val:t,expires:n},this._index[e]=i,this._attach(i),this._cur++,this._purge();else{var r=i.val;i.val=t,this._promote(i),this._dispose.call(void 0,i.key,r,"set")}return this}},{key:"del",value:function(e){var t=this._index[e];if(void 0===t)throw new Error("del: no such item");return delete this._index[e],this._detach(t),this._cur--,this._dispose.call(void 0,e,t.val,"del"),this}},{key:"clear",value:function(){for(;this._cur>0;)this.del(this._LRU.newer.key);return this}},{key:"_purge",value:function(){for(;this._cur>this._max;)this.del(this._LRU.newer.key)}},{key:"_promote",value:function(e){this._detach(e),this._attach(e)}},{key:"_detach",value:function(e){e.older.newer=e.newer,e.newer.older=e.older,e.older=null,e.newer=null}},{key:"_attach",value:function(e){e.older=this._MRU.older,e.newer=this._MRU,e.newer.older=e,e.older.newer=e}}]),e}();t.exports=r},{}]},{},[1])(1)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).CacheLRU=e()}}(function(){return function(){return function e(t,i,n){function r(u,s){if(!i[u]){if(!t[u]){var l="function"==typeof _dereq_&&_dereq_;if(!s&&l)return l(u,!0);if(o)return o(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var a=i[u]={exports:{}};t[u][0].call(a.exports,function(e){return r(t[u][1][e]||e)},a,a.exports,e,t,i,n)}return i[u].exports}for(var o="function"==typeof _dereq_&&_dereq_,u=0;u<n.length;u++)r(n[u]);return r}}()({1:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var r=function(){function e(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._index={},this._LRU={newer:null},this._MRU={older:null},this._LRU.newer=this._MRU,this._MRU.older=this._LRU,this._cur=0,this._max=1/0,this._dispose=function(){},this}return function(e,t,i){t&&n(e.prototype,t),i&&n(e,i)}(e,[{key:"limit",value:function(e){var t=this._max;return arguments.length>0&&(this._max=e,this._purge()),t}},{key:"dispose",value:function(e){return this._dispose=e,this}},{key:"length",value:function(){return this._cur}},{key:"keys",value:function(){return this.each(function(e,t){this.push(t)},[])}},{key:"values",value:function(){return this.each(function(e){this.push(e)},[])}},{key:"each",value:function(e,t){arguments<2&&(t=this);for(var i=0,n=this._MRU.older;n!==this._LRU;)e.call(t,n.val,n.key,i++),n=n.older;return t}},{key:"has",value:function(e){return void 0!==this._index[e]}},{key:"peek",value:function(e){var t=this._index[e];if(void 0!==t){if(!(t.expires<Date.now()))return t.val;this.del(t.key)}}},{key:"touch",value:function(e){var t=this._index[e];if(void 0===t)throw new Error("touch: no such item");return this._promote(t),this}},{key:"get",value:function(e){var t=this._index[e];if(void 0!==t){if(!(t.expires<Date.now()))return this._promote(t),t.val;this.del(t.key)}}},{key:"set",value:function(e,t,i){arguments.length<3&&(i=1/0),i+=Date.now();var n=this._index[e];if(void 0===n)n={older:null,newer:null,key:e,val:t,expires:i},this._index[e]=n,this._attach(n),this._cur++,this._purge();else{var r=n.val;n.val=t,this._promote(n),this._dispose.call(void 0,n.key,r,"set")}return this}},{key:"del",value:function(e){var t=this._index[e];if(void 0===t)throw new Error("del: no such item");return delete this._index[e],this._detach(t),this._cur--,this._dispose.call(void 0,e,t.val,"del"),this}},{key:"clear",value:function(){for(;this._cur>0;)this.del(this._LRU.newer.key);return this}},{key:"_purge",value:function(){for(;this._cur>this._max;)this.del(this._LRU.newer.key)}},{key:"_promote",value:function(e){this._detach(e),this._attach(e)}},{key:"_detach",value:function(e){e.older.newer=e.newer,e.newer.older=e.older,e.older=null,e.newer=null}},{key:"_attach",value:function(e){e.older=this._MRU.older,e.newer=this._MRU,e.newer.older=e,e.older.newer=e}}]),e}();t.exports=r},{}]},{},[1])(1)}); | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -35,4 +35,4 @@ },{}],2:[function(_dereq_,module,exports){ | ||
},{}],3:[function(_dereq_,module,exports){ | ||
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tokenizr=_dereq_("tokenizr"),CacheLRU=_dereq_("cache-lru"),cache=new CacheLRU;function funcParams(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=void 0;try{n=e.toString()}catch(e){n="function () {}"}var c=n;if(r){var o=cache.get(c);if("object"===(void 0===o?"undefined":_typeof(o))&&o instanceof Array)return o}n=(n=(n=n.replace(/^\s*class\s.*?constructor/,"").replace(/^\s*class\s.*/,"function () {}").replace(/^\s*([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*=>)/,"($1)$2").replace(/\r?\n/g," ").replace(/ {2,}/g," ")).replace(/`(?:\\`|[^\r\n])*?`/g,"").replace(/'(?:\\'|[^\r\n])*?'/g,"").replace(/"(?:\\"|[^\r\n])*?"/g,"").replace(/\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\/\/[^\r\n]*\r?\n/g,"")).replace(/^.*?\(/,"(");var t=new Tokenizr,u=0;t.rule(/\(/,function(e,r){0===u?e.ignore():e.accept(),u++}),t.rule(/\)/,function(e,r){0===--u?(e.ignore(),e.stop()):e.accept()}),t.rule(/(?:.|[ \t\r\n]+)/,function(e,r){e.accept()}),t.input(n),n="",t.tokens().forEach(function(e){n+=e.value}),(t=new Tokenizr).rule(/\(/,function(e,r){e.ignore(),e.push("parenthesis")}),t.rule("parenthesis",/\)/,function(e,r){e.ignore(),e.pop()}),t.rule("parenthesis",/[^)]+?/,function(e,r){e.ignore()}),t.rule(/\{/,function(e,r){e.ignore(),e.push("braces")}),t.rule("braces",/\}/,function(e,r){e.ignore(),e.pop()}),t.rule("braces",/[^}]+?/,function(e,r){e.ignore()}),t.rule(/\[/,function(e,r){e.ignore(),e.push("brackets")}),t.rule("brackets",/\]/,function(e,r){e.ignore(),e.pop()}),t.rule("brackets",/[^\]]+?/,function(e,r){e.ignore()}),t.rule(/(?:.|[ \t\r\n]+)/,function(e,r){e.accept()}),t.input(n),n="",t.tokens().forEach(function(e){n+=e.value});var a=[];return""!==(n=n.replace(/^\s+$/,""))&&n.split(/\s*,\s*/).forEach(function(e){e=e.replace(/=.*$/,"").replace(/^\s+/,"").replace(/\s+$/,""),a.push(e)}),r&&cache.set(c,a),a}module.exports=funcParams; | ||
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Tokenizr=_dereq_("tokenizr"),CacheLRU=_dereq_("cache-lru"),cache=new CacheLRU;function funcParams(e){var r,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{r=e.toString()}catch(e){r="function () {}"}var c=r;if(n){var o=cache.get(c);if("object"===_typeof(o)&&o instanceof Array)return o}r=(r=(r=r.replace(/^\s*class\s.*?constructor/,"").replace(/^\s*class\s.*/,"function () {}").replace(/^\s*([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*=>)/,"($1)$2").replace(/\r?\n/g," ").replace(/ {2,}/g," ")).replace(/`(?:\\`|[^\r\n])*?`/g,"").replace(/'(?:\\'|[^\r\n])*?'/g,"").replace(/"(?:\\"|[^\r\n])*?"/g,"").replace(/\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\/\/[^\r\n]*\r?\n/g,"")).replace(/^.*?\(/,"(");var t=new Tokenizr,u=0;t.rule(/\(/,function(e,r){0===u?e.ignore():e.accept(),u++}),t.rule(/\)/,function(e,r){0===--u?(e.ignore(),e.stop()):e.accept()}),t.rule(/(?:.|[ \t\r\n]+)/,function(e,r){e.accept()}),t.input(r),r="",t.tokens().forEach(function(e){r+=e.value}),(t=new Tokenizr).rule(/\(/,function(e,r){e.ignore(),e.push("parenthesis")}),t.rule("parenthesis",/\)/,function(e,r){e.ignore(),e.pop()}),t.rule("parenthesis",/[^)]+?/,function(e,r){e.ignore()}),t.rule(/\{/,function(e,r){e.ignore(),e.push("braces")}),t.rule("braces",/\}/,function(e,r){e.ignore(),e.pop()}),t.rule("braces",/[^}]+?/,function(e,r){e.ignore()}),t.rule(/\[/,function(e,r){e.ignore(),e.push("brackets")}),t.rule("brackets",/\]/,function(e,r){e.ignore(),e.pop()}),t.rule("brackets",/[^\]]+?/,function(e,r){e.ignore()}),t.rule(/(?:.|[ \t\r\n]+)/,function(e,r){e.accept()}),t.input(r),r="",t.tokens().forEach(function(e){r+=e.value});var a=[];return""!==(r=r.replace(/^\s+$/,""))&&r.split(/\s*,\s*/).forEach(function(e){e=e.replace(/=.*$/,"").replace(/^\s+/,"").replace(/\s+$/,""),a.push(e)}),n&&cache.set(c,a),a}module.exports=funcParams; | ||
},{"cache-lru":1,"tokenizr":2}]},{},[3])(3) | ||
}); |
@@ -28,4 +28,2 @@ /* | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/* | ||
@@ -56,124 +54,137 @@ ** func-params -- Run-Time Function Parameter Name Determination | ||
/* external dependency */ | ||
var Tokenizr = require("tokenizr"); | ||
var CacheLRU = require("cache-lru"); | ||
const Tokenizr = require("tokenizr"); | ||
const CacheLRU = require("cache-lru"); | ||
/* create global cache */ | ||
var cache = new CacheLRU(); | ||
const cache = new CacheLRU(); | ||
/* the API function */ | ||
function funcParams(fn) { | ||
var caching = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; | ||
/* determine function source code */ | ||
var src = void 0; | ||
try { | ||
src = fn.toString(); | ||
} catch (ex) { | ||
src = "function () {}"; | ||
} | ||
function funcParams(fn, caching = true) { | ||
/* determine function source code */ | ||
let src; | ||
/* optionally fetch from cache */ | ||
var key = src; | ||
if (caching) { | ||
var _args = cache.get(key); | ||
if ((typeof _args === "undefined" ? "undefined" : _typeof(_args)) === "object" && _args instanceof Array) return _args; | ||
} | ||
try { | ||
src = fn.toString(); | ||
} catch (ex) { | ||
src = "function () {}"; | ||
} | ||
/* optionally fetch from cache */ | ||
/* PASS 1: PREPROCESSING | ||
- replace special case of "class ..." functions | ||
- replace special case of "a => ..." fat arrow functions | ||
- replace newlines with single spaces */ | ||
src = src.replace(/^\s*class\s.*?constructor/, "").replace(/^\s*class\s.*/, "function () {}").replace(/^\s*([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*=>)/, "($1)$2").replace(/\r?\n/g, " ").replace(/ {2,}/g, " "); | ||
/* PASS 2: STRING STRIPPING | ||
- strip double-quoted strings | ||
- strip single-quoted strings | ||
- strip multiline strings */ | ||
src = src.replace(/`(?:\\`|[^\r\n])*?`/g, "").replace(/'(?:\\'|[^\r\n])*?'/g, "").replace(/"(?:\\"|[^\r\n])*?"/g, "").replace(/\/\*(?:.|[\r\n])*?\*\//g, "").replace(/\/\/[^\r\n]*\r?\n/g, ""); | ||
let key = src; | ||
/* PASS 3: INNER STRIPPING | ||
- cut at end of argument list (to not parse more than necessary) */ | ||
src = src.replace(/^.*?\(/, "("); | ||
var lexer = new Tokenizr(); | ||
var level = 0; | ||
lexer.rule(/\(/, function (ctx, match) { | ||
if (level === 0) ctx.ignore();else ctx.accept(); | ||
level++; | ||
}); | ||
lexer.rule(/\)/, function (ctx, match) { | ||
level--; | ||
if (level === 0) { | ||
ctx.ignore(); | ||
ctx.stop(); | ||
} else ctx.accept(); | ||
}); | ||
lexer.rule(/(?:.|[ \t\r\n]+)/, function (ctx, match) { | ||
ctx.accept(); | ||
}); | ||
lexer.input(src); | ||
src = ""; | ||
lexer.tokens().forEach(function (token) { | ||
src += token.value; | ||
}); | ||
if (caching) { | ||
let args = cache.get(key); | ||
if (typeof args === "object" && args instanceof Array) return args; | ||
} | ||
/* PASS 1: PREPROCESSING | ||
- replace special case of "class ..." functions | ||
- replace special case of "a => ..." fat arrow functions | ||
- replace newlines with single spaces */ | ||
/* PASS 4: OUTER STRIPPING | ||
- strip parenthesis groups (as they can contain commas) | ||
- strip braces groups (as they can contain commas) | ||
- strop bracket groups (as they can contain commas) */ | ||
lexer = new Tokenizr(); | ||
lexer.rule(/\(/, function (ctx, match) { | ||
ctx.ignore();ctx.push("parenthesis"); | ||
src = src.replace(/^\s*class\s.*?constructor/, "").replace(/^\s*class\s.*/, "function () {}").replace(/^\s*([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*=>)/, "($1)$2").replace(/\r?\n/g, " ").replace(/ {2,}/g, " "); | ||
/* PASS 2: STRING STRIPPING | ||
- strip double-quoted strings | ||
- strip single-quoted strings | ||
- strip multiline strings */ | ||
src = src.replace(/`(?:\\`|[^\r\n])*?`/g, "").replace(/'(?:\\'|[^\r\n])*?'/g, "").replace(/"(?:\\"|[^\r\n])*?"/g, "").replace(/\/\*(?:.|[\r\n])*?\*\//g, "").replace(/\/\/[^\r\n]*\r?\n/g, ""); | ||
/* PASS 3: INNER STRIPPING | ||
- cut at end of argument list (to not parse more than necessary) */ | ||
src = src.replace(/^.*?\(/, "("); | ||
let lexer = new Tokenizr(); | ||
let level = 0; | ||
lexer.rule(/\(/, (ctx, match) => { | ||
if (level === 0) ctx.ignore();else ctx.accept(); | ||
level++; | ||
}); | ||
lexer.rule(/\)/, (ctx, match) => { | ||
level--; | ||
if (level === 0) { | ||
ctx.ignore(); | ||
ctx.stop(); | ||
} else ctx.accept(); | ||
}); | ||
lexer.rule(/(?:.|[ \t\r\n]+)/, (ctx, match) => { | ||
ctx.accept(); | ||
}); | ||
lexer.input(src); | ||
src = ""; | ||
lexer.tokens().forEach(token => { | ||
src += token.value; | ||
}); | ||
/* PASS 4: OUTER STRIPPING | ||
- strip parenthesis groups (as they can contain commas) | ||
- strip braces groups (as they can contain commas) | ||
- strop bracket groups (as they can contain commas) */ | ||
lexer = new Tokenizr(); | ||
lexer.rule(/\(/, (ctx, match) => { | ||
ctx.ignore(); | ||
ctx.push("parenthesis"); | ||
}); | ||
lexer.rule("parenthesis", /\)/, (ctx, match) => { | ||
ctx.ignore(); | ||
ctx.pop(); | ||
}); | ||
lexer.rule("parenthesis", /[^)]+?/, (ctx, match) => { | ||
ctx.ignore(); | ||
}); | ||
lexer.rule(/\{/, (ctx, match) => { | ||
ctx.ignore(); | ||
ctx.push("braces"); | ||
}); | ||
lexer.rule("braces", /\}/, (ctx, match) => { | ||
ctx.ignore(); | ||
ctx.pop(); | ||
}); | ||
lexer.rule("braces", /[^}]+?/, (ctx, match) => { | ||
ctx.ignore(); | ||
}); | ||
lexer.rule(/\[/, (ctx, match) => { | ||
ctx.ignore(); | ||
ctx.push("brackets"); | ||
}); | ||
lexer.rule("brackets", /\]/, (ctx, match) => { | ||
ctx.ignore(); | ||
ctx.pop(); | ||
}); | ||
lexer.rule("brackets", /[^\]]+?/, (ctx, match) => { | ||
ctx.ignore(); | ||
}); | ||
lexer.rule(/(?:.|[ \t\r\n]+)/, (ctx, match) => { | ||
ctx.accept(); | ||
}); | ||
lexer.input(src); | ||
src = ""; | ||
lexer.tokens().forEach(token => { | ||
src += token.value; | ||
}); | ||
/* PASS 5: SPLITTING | ||
- split at commas | ||
- finally remove default assignments */ | ||
let args = []; | ||
src = src.replace(/^\s+$/, ""); | ||
if (src !== "") { | ||
src.split(/\s*,\s*/).forEach(token => { | ||
token = token.replace(/=.*$/, "").replace(/^\s+/, "").replace(/\s+$/, ""); | ||
args.push(token); | ||
}); | ||
lexer.rule("parenthesis", /\)/, function (ctx, match) { | ||
ctx.ignore();ctx.pop(); | ||
}); | ||
lexer.rule("parenthesis", /[^)]+?/, function (ctx, match) { | ||
ctx.ignore(); | ||
}); | ||
lexer.rule(/\{/, function (ctx, match) { | ||
ctx.ignore();ctx.push("braces"); | ||
}); | ||
lexer.rule("braces", /\}/, function (ctx, match) { | ||
ctx.ignore();ctx.pop(); | ||
}); | ||
lexer.rule("braces", /[^}]+?/, function (ctx, match) { | ||
ctx.ignore(); | ||
}); | ||
lexer.rule(/\[/, function (ctx, match) { | ||
ctx.ignore();ctx.push("brackets"); | ||
}); | ||
lexer.rule("brackets", /\]/, function (ctx, match) { | ||
ctx.ignore();ctx.pop(); | ||
}); | ||
lexer.rule("brackets", /[^\]]+?/, function (ctx, match) { | ||
ctx.ignore(); | ||
}); | ||
lexer.rule(/(?:.|[ \t\r\n]+)/, function (ctx, match) { | ||
ctx.accept(); | ||
}); | ||
lexer.input(src); | ||
src = ""; | ||
lexer.tokens().forEach(function (token) { | ||
src += token.value; | ||
}); | ||
} | ||
/* optionally store to cache */ | ||
/* PASS 5: SPLITTING | ||
- split at commas | ||
- finally remove default assignments */ | ||
var args = []; | ||
src = src.replace(/^\s+$/, ""); | ||
if (src !== "") { | ||
src.split(/\s*,\s*/).forEach(function (token) { | ||
token = token.replace(/=.*$/, "").replace(/^\s+/, "").replace(/\s+$/, ""); | ||
args.push(token); | ||
}); | ||
} | ||
/* optionally store to cache */ | ||
if (caching) cache.set(key, args); | ||
return args; | ||
if (caching) cache.set(key, args); | ||
return args; | ||
} | ||
/* export the API function */ | ||
/* export the API function */ | ||
module.exports = funcParams; | ||
@@ -180,0 +191,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Run-Time Function Parameter Name Determination", | ||
"version": "0.9.13", | ||
"version": "0.9.14", | ||
"license": "MIT", | ||
@@ -24,36 +24,32 @@ "author": { | ||
"devDependencies": { | ||
"grunt": "1.0.3", | ||
"grunt-cli": "1.2.0", | ||
"grunt-contrib-clean": "1.1.0", | ||
"grunt-browserify": "5.3.0", | ||
"grunt-mocha-test": "0.13.3", | ||
"grunt-eslint": "21.0.0", | ||
"babel-eslint": "8.2.6", | ||
"mocha": "5.2.0", | ||
"chai": "4.1.2", | ||
"envify": "4.1.0", | ||
"uglifyify": "5.0.1", | ||
"babelify": "8.0.0", | ||
"eslint": "5.3.0", | ||
"eslint-config-standard": "11.0.0", | ||
"eslint-plugin-standard": "3.1.0", | ||
"eslint-plugin-promise": "3.8.0", | ||
"eslint-plugin-import": "2.13.0", | ||
"eslint-plugin-node": "7.0.1", | ||
"babel-core": "6.26.3", | ||
"babel-preset-es2015": "6.24.1", | ||
"babel-preset-es2016": "6.24.1", | ||
"babel-preset-es2017": "6.24.1", | ||
"babel-preset-stage-3": "6.24.1", | ||
"babel-preset-stage-2": "6.24.1", | ||
"babel-plugin-transform-runtime": "6.23.0", | ||
"browserify-header": "0.9.4", | ||
"browserify-derequire": "0.9.6" | ||
"grunt": "1.0.3", | ||
"grunt-cli": "1.3.2", | ||
"grunt-contrib-clean": "2.0.0", | ||
"grunt-browserify": "5.3.0", | ||
"grunt-mocha-test": "0.13.3", | ||
"grunt-eslint": "21.0.0", | ||
"babel-eslint": "10.0.1", | ||
"mocha": "5.2.0", | ||
"chai": "4.2.0", | ||
"envify": "4.1.0", | ||
"uglifyify": "5.0.1", | ||
"babelify": "10.0.0", | ||
"eslint": "5.10.0", | ||
"eslint-config-standard": "12.0.0", | ||
"eslint-plugin-standard": "4.0.0", | ||
"eslint-plugin-promise": "4.0.1", | ||
"eslint-plugin-import": "2.14.0", | ||
"eslint-plugin-node": "8.0.0", | ||
"@babel/core": "7.2.2", | ||
"@babel/preset-env": "7.2.3", | ||
"@babel/plugin-transform-runtime": "7.2.0", | ||
"browserify-header": "0.9.4", | ||
"browserify-derequire": "0.9.6" | ||
}, | ||
"dependencies" : { | ||
"tokenizr": "1.3.9", | ||
"cache-lru": "1.1.5" | ||
"tokenizr": "1.3.10", | ||
"cache-lru": "1.1.6" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
"node": ">=8.0.0" | ||
}, | ||
@@ -60,0 +56,0 @@ "scripts": { |
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
23
647
53576
+ Addedcache-lru@1.1.6(transitive)
+ Addedtokenizr@1.3.10(transitive)
- Removedcache-lru@1.1.5(transitive)
- Removedtokenizr@1.3.9(transitive)
Updatedcache-lru@1.1.6
Updatedtokenizr@1.3.10