Comparing version 0.1.3 to 0.1.4
@@ -6,2 +6,4 @@ | ||
expiry.Expiry = Expiry; | ||
expiry.VERSION = '<%= pkg.version %>'; | ||
@@ -8,0 +10,0 @@ |
@@ -174,5 +174,5 @@ (function (root, factory) { | ||
expiry.VERSION = '0.1.0'; | ||
expiry.VERSION = '0.1.4'; | ||
return expiry; | ||
})); |
@@ -1,1 +0,1 @@ | ||
!function(a,b){"function"==typeof define&&define.amd?define(function(){return a.expiry=b()}):"object"==typeof exports?module.exports=b():a.expiry=b()}(this,function(){function a(){return b.forge.apply(b,arguments)}var b=function(){function a(b){b=b||0;var c,d=i(b);if("Number"===d)c=new j(b);else{if("String"!==d)throw new Error("Wrong type for argument 1, value. Expected "+b+" to be a number, string, or expiry.");c=a.parse(b)}this._internal=c}var b=1,c=1e3*b,d=60*c,e=60*d,f=24*e,g={millisecond:b,second:c,minute:d,hour:e,day:f,month:function(a,b){var c=new Date,d=new Date(c);return d.setMonth(d.getMonth()+a),d.setDate(d.getDate()+b),d-c}},h={milliseconds:"millisecond",millisecond:"millisecond",ms:"millisecond",seconds:"second",second:"second",s:"second",minutes:"minute",minute:"minute",m:"minute",hours:"hour",hour:"hour",h:"hour",days:"day",day:"day",D:"day",weeks:"week",week:"week",W:"week",months:"month",month:"month",M:"month",years:"year",year:"year",Y:"year"},i=function(a){return toString.call(a).match(/\[object (\S+)\]/).pop()},j=function(a,b,c){this.milliseconds=a||0,this.days=b||0,this.months=c||0},k=/([\d\.]+)\s*([a-zA-Z]+)/g,l=Math.round;return a.forge=function(a){return new this(a)},a.parse=function(a){if("String"!==i(a))throw new Error("Wrong type for argument 1, value. String expected.");for(var b,c,d,e,f=0,l=0,m=0;null!==(b=k.exec(a));)switch(c=parseFloat(b[1]),d=b[2],e=h[d]){case"year":m+=12*c;break;case"month":m+=c;break;case"week":l+=7*c;break;case"day":l+=c;break;case"hour":case"minute":case"second":case"millisecond":f+=g[e];break;default:throw new Error("Unexpected unit "+d)}return new j(f,l,m)},a.prototype.valueOf=function(){var a=this._internal,b=a.milliseconds,c=a.days,d=a.months;return b+g.month(d,c)},a.prototype.asMilliseconds=function(){return this.valueOf()},a.prototype.asSeconds=function(){return l(this.valueOf()/c)},a}();return a.VERSION="0.1.0",a}); | ||
!function(a,b){"function"==typeof define&&define.amd?define(function(){return a.expiry=b()}):"object"==typeof exports?module.exports=b():a.expiry=b()}(this,function(){function a(){return b.forge.apply(b,arguments)}var b=function(){function a(b){b=b||0;var c,d=i(b);if("Number"===d)c=new j(b);else{if("String"!==d)throw new Error("Wrong type for argument 1, value. Expected "+b+" to be a number, string, or expiry.");c=a.parse(b)}this._internal=c}var b=1,c=1e3*b,d=60*c,e=60*d,f=24*e,g={millisecond:b,second:c,minute:d,hour:e,day:f,month:function(a,b){var c=new Date,d=new Date(c);return d.setMonth(d.getMonth()+a),d.setDate(d.getDate()+b),d-c}},h={milliseconds:"millisecond",millisecond:"millisecond",ms:"millisecond",seconds:"second",second:"second",s:"second",minutes:"minute",minute:"minute",m:"minute",hours:"hour",hour:"hour",h:"hour",days:"day",day:"day",D:"day",weeks:"week",week:"week",W:"week",months:"month",month:"month",M:"month",years:"year",year:"year",Y:"year"},i=function(a){return toString.call(a).match(/\[object (\S+)\]/).pop()},j=function(a,b,c){this.milliseconds=a||0,this.days=b||0,this.months=c||0},k=/([\d\.]+)\s*([a-zA-Z]+)/g,l=Math.round;return a.forge=function(a){return new this(a)},a.parse=function(a){if("String"!==i(a))throw new Error("Wrong type for argument 1, value. String expected.");for(var b,c,d,e,f=0,l=0,m=0;null!==(b=k.exec(a));)switch(c=parseFloat(b[1]),d=b[2],e=h[d]){case"year":m+=12*c;break;case"month":m+=c;break;case"week":l+=7*c;break;case"day":l+=c;break;case"hour":case"minute":case"second":case"millisecond":f+=g[e];break;default:throw new Error("Unexpected unit "+d)}return new j(f,l,m)},a.prototype.valueOf=function(){var a=this._internal,b=a.milliseconds,c=a.days,d=a.months;return b+g.month(d,c)},a.prototype.asMilliseconds=function(){return this.valueOf()},a.prototype.asSeconds=function(){return l(this.valueOf()/c)},a}();return a.Expiry=b,a.VERSION="0.1.4",a}); |
{ | ||
"name": "expiry-js", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A lightweight Javascript Universal Module for parsing durations", | ||
@@ -5,0 +5,0 @@ "main": "dist/expiry.js", |
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
18610
432