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

overload2

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

overload2 - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # overload2

## [0.3.2] - Sep 11th, 2020
* 支持数量符号 `?`。
## [0.3.1] - Mar 2nd, 2018

@@ -7,0 +11,0 @@

8

dist/overload2.js

@@ -299,2 +299,6 @@ /**

}
if (size == '?') {
this.absent = true;
return true;
}
if (size == '+') {

@@ -364,3 +368,3 @@ this.minSize = 1;

}
this.type = Type.parse(type);

@@ -959,2 +963,2 @@

}
})(this);
})(this);

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

(function(global,undefined){var MODULE_REQUIRE,declareException=function e(t,r,n){if(!r)r=Error;var a=function(e){this.name="OVERLOAD2."+t;if(n){n.apply(this,arguments)}else{this.message=e}var a=new r;this.stack=[this.name+": "+this.message].concat(a.stack.split("\n").slice(2)).join("\n")};a.prototype=Object.create(r.prototype);a.prototype.consturctor=a;a.prototype.toString=a.prototype.valueOf=function(){return"["+this.name+": "+this.message+"]"};Object.defineProperty(a,"name",{value:t});return a},ERR={Generic:declareException("Error"),Arguments:declareException("ArgumentsError",TypeError,function(e,t){this.message=e+" argument(s) expected but actual "+t}),Type:declareException("TypeError",TypeError,function(e,t,r){this.message=e+" must be "+(typeof t=="string"?t:t.join(" | "))+": "+r}),Range:declareException("RangeError",RangeError,function(e,t,r){if(t instanceof Array){t=t.join(" | ")}this.message=e+" must be "+t+": "+r}),NotImplemented:declareException("EmptyException"),Unmatching:declareException("UnmatchingException",TypeError)},generateCreator=function(e){function t(t){return e.apply(this,t)}t.prototype=e.prototype;return function(){return new t(arguments)}},has=function(e,t){return e.indexOf(t)>=0},eachMatch=function(e,t){var r=true;for(var n=0;r&&n<e.length;n++){r=t(e[n],n)}return r},onceMatch=function(e,t){var r=false;for(var n=0;!r&&n<e.length;n++){r=t(e[n],n)}return r};function Absent(e){this.value=e}function Type(e){if(arguments.length!=1){throw new ERR.Arguments(1,arguments.length)}if(!(typeof e=="function"||e instanceof RegExp)){throw new ERR.Type("Type matcher",["Function","RegExp"],e)}if(!(this instanceof Type))return new Type(e);if(e instanceof RegExp){this.match=function(t){return e.test(t)}}else{this.match=e}}Type.ANY=new Type(function(){return true});Type.BOOLEAN=new Type(function(e){return typeof e==="boolean"});Type.CHAR=new Type(function(e){return typeof e==="string"&&e.length==1});Type.NUMBER=new Type(function(e){return typeof e==="number"});Type.PLAIN_OBJECT=new Type(function(e){return typeof e==="object"&&e.constructor===Object});Type.SCALAR=new Type(function(e){return["boolean","number","string"].indexOf(typeof e)>=0});Type.STRING=new Type(function(e){return typeof e==="string"});Type.enum=function(){var e=Array.from(arguments);return new Type(function(t){return e.indexOf(t)>=0})};Type.and=function(){var e=Array.from(arguments).map(Type.parse);return new Type(function(t){return eachMatch(e,function(e){return e.match(t)})})};Type.or=function(){var e=Array.from(arguments).map(Type.parse);return new Type(function(t){return onceMatch(e,function(e){return e.match(t)})})};Type.not=function(e){return new Type(function(t){return!e.match(t)})};Type.parse=function(e){if(typeof e=="string"){var t=TYPE_ALIAS[e];if(!t){throw new ERR.Range("type alias",Object.keys(TYPE_ALIAS),e)}e=t}else if(e instanceof Type){}else if(typeof e=="function"){e=function(e){return new Type(function(t){return t instanceof e})}(e)}else{throw new ERR.Type("Param type",["overload2.Type","string","Function"],e)}return e};function Param(){if(arguments.length==0){throw new ERR.Arguments("1+",0)}if(arguments.length==1&&arguments[0]instanceof Param){return arguments[0]}this.type=null;this.minSize=1;this.maxSize=1;this.nil=false;this.undef=false;this.absent=false;this.absentValue=undefined;this.arrayed=false;var setSize=function(e){if(typeof e=="string"){e=e.replace(/\s/g,"");if(e=="*"||e=="..."){this.minSize=0;this.maxSize=Infinity;this.arrayed=true;return true}if(e=="+"){this.minSize=1;this.maxSize=Infinity;this.arrayed=true;return true}if(/^\{.+\}$/.test(e)){e=e.slice(1,-1)}if(/^\d+$/.test(e)){this.minSize=this.maxSize=parseInt(e);this.arrayed=true;return true}if(/^,(\d+)$/.test(e)){this.minSize=0;this.maxSize=parseInt(RegExp.$1);this.arrayed=true;return true}if(/^(\d+),$/.test(e)){this.minSize=parseInt(RegExp.$1);this.maxSize=Infinity;this.arrayed=true;return true}if(/^(\d+),(\d+)$/.test(e)){this.minSize=parseInt(RegExp.$1);this.maxSize=parseInt(RegExp.$2);this.arrayed=true;return true}return false}if(Number.isInteger(e)&&e>0){this.minSize=this.maxSize=e;this.arrayed=true;return true}return false}.bind(this);var type=arguments[0],decos=[];if(setSize(type)){this.type=Type.ANY;return this}if(typeof type=="string"){decos=type.trim().split(/\s+/);type=decos.shift()}this.type=Type.parse(type);var DECOS=["NULL","UNDEFINED","ABSENT"],i;for(i=1;i<arguments.length;i++){if(typeof arguments[i]=="string"){decos=decos.concat(arguments[i].trim().split(/\s+/))}else if(Number.isInteger(arguments[i])){decos.push(arguments[i])}else if(arguments[i]instanceof Absent){this.absent=true;this.absentValue=arguments[i].value}}for(i=0;i<decos.length;i++){var rawDeco=decos[i];if(setSize(rawDeco))continue;if(/^=(.+)$/.test(rawDeco)){this.absent=true;this.absentValue=eval(RegExp.$1);continue}decos[i]=decos[i].toUpperCase();if(!has(DECOS,decos[i])){throw new ERR.Range("param decorator",DECOS,rawDeco)}}this.nil=has(decos,"NULL");this.undef=has(decos,"UNDEFINED");if(!this.absent){this.absent=has(decos,"ABSENT")}}Param.parse=generateCreator(Param);Param.prototype.satisfy=function(e){if(e===null)return this.nil;if(e===undefined)return this.undef;return this.type.match(e)};function ParamList(){var e=[];var t=0;var r=0;var n=true;for(var a=0,i;a<arguments.length;a++){i=arguments[a]instanceof Array?arguments[a]:[arguments[a]];e[a]=Param.parse.apply(null,i);r+=e[a].maxSize;t+=e[a].absent?0:e[a].minSize;n=n&&!(e[a].absent||e[a].arrayed)}this.easy=n;this.minSize=t;this.maxSize=r;this.params=e}ParamList.parse=generateCreator(ParamList);ParamList.prototype.satisfy=function(e){if(e.length!=this.params.length){return false}return eachMatch(this.params,function(t,r){return t.satisfy(e[r])})};ParamList.prototype.parse=function(e){if(e.length<this.minSize||this.maxSize<e.length){return null}if(this.easy){var t=eachMatch(this.params,function(t,r){return t.satisfy(e[r])});return t?e:null}var r=function(e,t){var n=[];var a=0,i=0;for(;a<e.length;a++){if(i>=t.length){return null}var o=t[i];var s=e[a];if(!o.absent&&o.minSize==1&&o.maxSize==1){if(!o.satisfy(s)){return null}else{n.push(s);i++}continue}if(e.length-a<o.minSize){if(o.absent){n.push(o.absentValue);a--;continue}return null}var u=[];var l=function(){if(o.arrayed)n.push(u);else n.push(u[0])};for(;a<e.length&&o.satisfy(e[a]);a++){u.push(e[a])}a--;i++;if(u.length<o.minSize){if(o.absent){n.push(o.absentValue);a-=u.length;continue}return null}var p=t.slice(i);if(!o.absent&&u.length==o.minSize||p.length==0){l();continue}var f=e.slice(a+1);var c=false;do{var h=r(f,p);if(h!=null){l();n=n.concat(h);break}if(c){n=null;break}if(u.length==o.minSize){if(o.absent){f=u.concat(f);u=o.arrayed?o.absentValue:[o.absentValue];c=true;continue}n=null;break}else{f.unshift(u.pop())}}while(true);return n}for(;n.length<t.length;i++){if(t[i].absent){n.push(t[i].absentValue)}else if(t[i].minSize==0){n.push([])}else{return null}}return n};return r(Array.from(e),this.params)};function Overload(){if(arguments.length==0){throw new ERR.Arguments("1+",0)}var e=Array.from(arguments);var t=e.pop();if(typeof t=="function"){this.method=t}else{throw new ERR.Generic("overloading implementation function missed")}if(typeof e[0]=="number"&&e.length==1){this.argLength=e[0]}else if(e[0]instanceof ParamList){if(e.length>1){throw new ERR.Arguments(2,e.length+1)}this.params=e[0]}else{this.params=ParamList.parse.apply(null,e)}}Overload.parse=generateCreator(Overload);Overload.prototype.exec=function(e,t){if(typeof this.argLength=="number"){if(t.length!=this.argLength)return false}else{t=this.params.parse(t);if(!t)return false}return[this.method.apply(e,t)]};function OverloadedFunction(){if(!(this instanceof OverloadedFunction))return new OverloadedFunction;this._defaultMethod=null;this._overloads=[]}OverloadedFunction.prototype.exec=function(){return this.apply(this,arguments)};OverloadedFunction.prototype.apply=function(e,t){if(this._overloads.length==0){throw new ERR.NotImplemented}for(var r=0,n;r<this._overloads.length;r++){n=this._overloads[r].exec(e,t);if(n){return n[0]}}if(this._defaultMethod){return this._defaultMethod.apply(e,t)}var a=[];for(var r=0,i;r<t.length;r++){i=t[r]===null?"null":typeof t[r];if(i==="object")i=t[r].constructor.name;a.push(i)}throw new ERR.Unmatching("Unmatching arguments: "+a.join(", "))};OverloadedFunction.prototype.call=function(e){var t=Array.from(arguments);return this.apply(e,t.slice(1))};OverloadedFunction.prototype.overload=function(){var e;if(arguments[0]instanceof Overload){e=arguments[0];if(arguments[1]){this._defaultMethod=e.method}if(arguments.length>2){}}else{e=Overload.parse.apply(null,arguments)}this._overloads.push(e);return this};OverloadedFunction.prototype.default=function(e){if(typeof e!="function"){throw new ERR.Generic("invalid default method")}if(arguments.length>1){}this._defaultMethod=e};function Overloader(){var e=new OverloadedFunction;var t=function(t){e.overload.apply(e,t)};if(arguments.length){}var r=function(){return e.apply(this,arguments)};r.overload=function(){t(arguments);return r};r.default=function(t){e.default(t);return r};return r}Overloader.ANY=Type.ANY;Overloader.BOOLEAN=Type.BOOLEAN;Overloader.CHAR=Type.CHAR;Overloader.NUMBER=Type.NUMBER;Overloader.SCALAR=Type.SCALAR;Overloader.STRING=Type.STRING;Overloader.enum=Type.enum;Overloader.Type=Type;Overloader.type=Type;Overloader.Param=Param;Overloader.param=Param.parse;Overloader.parseParam=Param.parse;Overloader.ParamList=ParamList;Overloader.paramList=ParamList.parse;Overloader.parseParamList=ParamList.parse;Overloader.Overload=Overload;Overloader.overload=Overload.parse;Overloader.parseOverload=Overload.parse;Overloader.Function=OverloadedFunction;Overloader.createFunction=OverloadedFunction;Overloader.absent=function(e){return new Absent(e)};for(var name in ERR){if(ERR.hasOwnProperty(name)){var Err=ERR[name];Overloader[Err.name]=Err}}var TYPE_ALIAS={"?":Type.ANY,any:Type.ANY,boolean:Type.BOOLEAN,char:Type.CHAR,number:Type.NUMBER,object:Type.PLAIN_OBJECT,scalar:Type.SCALAR,string:Type.STRING};if(typeof module=="object"&&typeof module.exports=="object"){module.exports=Overloader}else if(typeof global.define=="function"){global.define(function(){return Overloader})}else{global.overload2=Overloader}})(this);
(function(global,undefined){var MODULE_REQUIRE,declareException=function e(r,n,a){if(!n)n=Error;var t=function(e){this.name="OVERLOAD2."+r;if(a){a.apply(this,arguments)}else{this.message=e}var t=new n;this.stack=[this.name+": "+this.message].concat(t.stack.split("\n").slice(2)).join("\n")};t.prototype=Object.create(n.prototype);t.prototype.consturctor=t;t.prototype.toString=t.prototype.valueOf=function(){return"["+this.name+": "+this.message+"]"};Object.defineProperty(t,"name",{value:r});return t},ERR={Generic:declareException("Error"),Arguments:declareException("ArgumentsError",TypeError,function(e,t){this.message=e+" argument(s) expected but actual "+t}),Type:declareException("TypeError",TypeError,function(e,t,r){this.message=e+" must be "+(typeof t=="string"?t:t.join(" | "))+": "+r}),Range:declareException("RangeError",RangeError,function(e,t,r){if(t instanceof Array){t=t.join(" | ")}this.message=e+" must be "+t+": "+r}),NotImplemented:declareException("EmptyException"),Unmatching:declareException("UnmatchingException",TypeError)},generateCreator=function(t){function e(e){return t.apply(this,e)}e.prototype=t.prototype;return function(){return new e(arguments)}},has=function(e,t){return e.indexOf(t)>=0},eachMatch=function(e,t){var r=true;for(var n=0;r&&n<e.length;n++){r=t(e[n],n)}return r},onceMatch=function(e,t){var r=false;for(var n=0;!r&&n<e.length;n++){r=t(e[n],n)}return r};function Absent(e){this.value=e}function Type(t){if(arguments.length!=1){throw new ERR.Arguments(1,arguments.length)}if(!(typeof t=="function"||t instanceof RegExp)){throw new ERR.Type("Type matcher",["Function","RegExp"],t)}if(!(this instanceof Type))return new Type(t);if(t instanceof RegExp){this.match=function(e){return t.test(e)}}else{this.match=t}}Type.ANY=new Type(function(){return true});Type.BOOLEAN=new Type(function(e){return typeof e==="boolean"});Type.CHAR=new Type(function(e){return typeof e==="string"&&e.length==1});Type.NUMBER=new Type(function(e){return typeof e==="number"});Type.PLAIN_OBJECT=new Type(function(e){return typeof e==="object"&&e.constructor===Object});Type.SCALAR=new Type(function(e){return["boolean","number","string"].indexOf(typeof e)>=0});Type.STRING=new Type(function(e){return typeof e==="string"});Type.enum=function(){var t=Array.from(arguments);return new Type(function(e){return t.indexOf(e)>=0})};Type.and=function(){var e=Array.from(arguments).map(Type.parse);return new Type(function(t){return eachMatch(e,function(e){return e.match(t)})})};Type.or=function(){var e=Array.from(arguments).map(Type.parse);return new Type(function(t){return onceMatch(e,function(e){return e.match(t)})})};Type.not=function(t){return new Type(function(e){return!t.match(e)})};Type.parse=function(e){if(typeof e=="string"){var t=TYPE_ALIAS[e];if(!t){throw new ERR.Range("type alias",Object.keys(TYPE_ALIAS),e)}e=t}else if(e instanceof Type){}else if(typeof e=="function"){e=function(t){return new Type(function(e){return e instanceof t})}(e)}else{throw new ERR.Type("Param type",["overload2.Type","string","Function"],e)}return e};function Param(){if(arguments.length==0){throw new ERR.Arguments("1+",0)}if(arguments.length==1&&arguments[0]instanceof Param){return arguments[0]}this.type=null;this.minSize=1;this.maxSize=1;this.nil=false;this.undef=false;this.absent=false;this.absentValue=undefined;this.arrayed=false;var setSize=function(e){if(typeof e=="string"){e=e.replace(/\s/g,"");if(e=="*"||e=="..."){this.minSize=0;this.maxSize=Infinity;this.arrayed=true;return true}if(e=="?"){this.absent=true;return true}if(e=="+"){this.minSize=1;this.maxSize=Infinity;this.arrayed=true;return true}if(/^\{.+\}$/.test(e)){e=e.slice(1,-1)}if(/^\d+$/.test(e)){this.minSize=this.maxSize=parseInt(e);this.arrayed=true;return true}if(/^,(\d+)$/.test(e)){this.minSize=0;this.maxSize=parseInt(RegExp.$1);this.arrayed=true;return true}if(/^(\d+),$/.test(e)){this.minSize=parseInt(RegExp.$1);this.maxSize=Infinity;this.arrayed=true;return true}if(/^(\d+),(\d+)$/.test(e)){this.minSize=parseInt(RegExp.$1);this.maxSize=parseInt(RegExp.$2);this.arrayed=true;return true}return false}if(Number.isInteger(e)&&e>0){this.minSize=this.maxSize=e;this.arrayed=true;return true}return false}.bind(this);var type=arguments[0],decos=[];if(setSize(type)){this.type=Type.ANY;return this}if(typeof type=="string"){decos=type.trim().split(/\s+/);type=decos.shift()}this.type=Type.parse(type);var DECOS=["NULL","UNDEFINED","ABSENT"],i;for(i=1;i<arguments.length;i++){if(typeof arguments[i]=="string"){decos=decos.concat(arguments[i].trim().split(/\s+/))}else if(Number.isInteger(arguments[i])){decos.push(arguments[i])}else if(arguments[i]instanceof Absent){this.absent=true;this.absentValue=arguments[i].value}}for(i=0;i<decos.length;i++){var rawDeco=decos[i];if(setSize(rawDeco))continue;if(/^=(.+)$/.test(rawDeco)){this.absent=true;this.absentValue=eval(RegExp.$1);continue}decos[i]=decos[i].toUpperCase();if(!has(DECOS,decos[i])){throw new ERR.Range("param decorator",DECOS,rawDeco)}}this.nil=has(decos,"NULL");this.undef=has(decos,"UNDEFINED");if(!this.absent){this.absent=has(decos,"ABSENT")}}Param.parse=generateCreator(Param);Param.prototype.satisfy=function(e){if(e===null)return this.nil;if(e===undefined)return this.undef;return this.type.match(e)};function ParamList(){var e=[];var t=0;var r=0;var n=true;for(var a=0,i;a<arguments.length;a++){i=arguments[a]instanceof Array?arguments[a]:[arguments[a]];e[a]=Param.parse.apply(null,i);r+=e[a].maxSize;t+=e[a].absent?0:e[a].minSize;n=n&&!(e[a].absent||e[a].arrayed)}this.easy=n;this.minSize=t;this.maxSize=r;this.params=e}ParamList.parse=generateCreator(ParamList);ParamList.prototype.satisfy=function(r){if(r.length!=this.params.length){return false}return eachMatch(this.params,function(e,t){return e.satisfy(r[t])})};ParamList.prototype.parse=function(r){if(r.length<this.minSize||this.maxSize<r.length){return null}if(this.easy){var e=eachMatch(this.params,function(e,t){return e.satisfy(r[t])});return e?r:null}var h=function(e,t){var r=[];var n=0,a=0;for(;n<e.length;n++){if(a>=t.length){return null}var i=t[a];var o=e[n];if(!i.absent&&i.minSize==1&&i.maxSize==1){if(!i.satisfy(o)){return null}else{r.push(o);a++}continue}if(e.length-n<i.minSize){if(i.absent){r.push(i.absentValue);n--;continue}return null}var s=[];var u=function(){if(i.arrayed)r.push(s);else r.push(s[0])};for(;n<e.length&&i.satisfy(e[n]);n++){s.push(e[n])}n--;a++;if(s.length<i.minSize){if(i.absent){r.push(i.absentValue);n-=s.length;continue}return null}var l=t.slice(a);if(!i.absent&&s.length==i.minSize||l.length==0){u();continue}var f=e.slice(n+1);var p=false;do{var c=h(f,l);if(c!=null){u();r=r.concat(c);break}if(p){r=null;break}if(s.length==i.minSize){if(i.absent){f=s.concat(f);s=i.arrayed?i.absentValue:[i.absentValue];p=true;continue}r=null;break}else{f.unshift(s.pop())}}while(true);return r}for(;r.length<t.length;a++){if(t[a].absent){r.push(t[a].absentValue)}else if(t[a].minSize==0){r.push([])}else{return null}}return r};return h(Array.from(r),this.params)};function Overload(){if(arguments.length==0){throw new ERR.Arguments("1+",0)}var e=Array.from(arguments);var t=e.pop();if(typeof t=="function"){this.method=t}else{throw new ERR.Generic("overloading implementation function missed")}if(typeof e[0]=="number"&&e.length==1){this.argLength=e[0]}else if(e[0]instanceof ParamList){if(e.length>1){throw new ERR.Arguments(2,e.length+1)}this.params=e[0]}else{this.params=ParamList.parse.apply(null,e)}}Overload.parse=generateCreator(Overload);Overload.prototype.exec=function(e,t){if(typeof this.argLength=="number"){if(t.length!=this.argLength)return false}else{t=this.params.parse(t);if(!t)return false}return[this.method.apply(e,t)]};function OverloadedFunction(){if(!(this instanceof OverloadedFunction))return new OverloadedFunction;this._defaultMethod=null;this._overloads=[]}OverloadedFunction.prototype.exec=function(){return this.apply(this,arguments)};OverloadedFunction.prototype.apply=function(e,t){if(this._overloads.length==0){throw new ERR.NotImplemented}for(var r=0,n;r<this._overloads.length;r++){n=this._overloads[r].exec(e,t);if(n){return n[0]}}if(this._defaultMethod){return this._defaultMethod.apply(e,t)}var a=[];for(var r=0,i;r<t.length;r++){i=t[r]===null?"null":typeof t[r];if(i==="object")i=t[r].constructor.name;a.push(i)}throw new ERR.Unmatching("Unmatching arguments: "+a.join(", "))};OverloadedFunction.prototype.call=function(e){var t=Array.from(arguments);return this.apply(e,t.slice(1))};OverloadedFunction.prototype.overload=function(){var e;if(arguments[0]instanceof Overload){e=arguments[0];if(arguments[1]){this._defaultMethod=e.method}if(arguments.length>2){}}else{e=Overload.parse.apply(null,arguments)}this._overloads.push(e);return this};OverloadedFunction.prototype.default=function(e){if(typeof e!="function"){throw new ERR.Generic("invalid default method")}if(arguments.length>1){}this._defaultMethod=e};function Overloader(){var t=new OverloadedFunction;var e=function(e){t.overload.apply(t,e)};if(arguments.length){}var r=function(){return t.apply(this,arguments)};r.overload=function(){e(arguments);return r};r.default=function(e){t.default(e);return r};return r}Overloader.ANY=Type.ANY;Overloader.BOOLEAN=Type.BOOLEAN;Overloader.CHAR=Type.CHAR;Overloader.NUMBER=Type.NUMBER;Overloader.SCALAR=Type.SCALAR;Overloader.STRING=Type.STRING;Overloader.enum=Type.enum;Overloader.Type=Type;Overloader.type=Type;Overloader.Param=Param;Overloader.param=Param.parse;Overloader.parseParam=Param.parse;Overloader.ParamList=ParamList;Overloader.paramList=ParamList.parse;Overloader.parseParamList=ParamList.parse;Overloader.Overload=Overload;Overloader.overload=Overload.parse;Overloader.parseOverload=Overload.parse;Overloader.Function=OverloadedFunction;Overloader.createFunction=OverloadedFunction;Overloader.absent=function(e){return new Absent(e)};for(var name in ERR){if(ERR.hasOwnProperty(name)){var Err=ERR[name];Overloader[Err.name]=Err}}var TYPE_ALIAS={"?":Type.ANY,any:Type.ANY,boolean:Type.BOOLEAN,char:Type.CHAR,number:Type.NUMBER,object:Type.PLAIN_OBJECT,scalar:Type.SCALAR,string:Type.STRING};if(typeof module=="object"&&typeof module.exports=="object"){module.exports=Overloader}else if(typeof global.define=="function"){global.define(function(){return Overloader})}else{global.overload2=Overloader}})(this);

@@ -299,2 +299,6 @@ /**

}
if (size == '?') {
this.absent = true;
return true;
}
if (size == '+') {

@@ -364,3 +368,3 @@ this.minSize = 1;

}
this.type = Type.parse(type);

@@ -959,2 +963,2 @@

}
})(this);
})(this);
{
"name": "overload2",
"version": "0.3.1",
"version": "0.3.2",
"description": "Elegant solution for function overloading in JavaScript",

@@ -36,2 +36,2 @@ "main": "overload2.js",

}
}
}

Sorry, the diff of this file is not supported yet

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