Comparing version 1.0.4 to 1.0.5-next.0
@@ -1,2 +0,2 @@ | ||
"use strict";const e=36e5,t=24*e,o={year:315576e5,month:30*t,week:7*t,day:t,hour:e,minute:6e4,second:1e3};exports.duration=(e,{parts:t=9,join:n=", "}={})=>{let r,s=[];for(let[i,u]of Object.entries(o))e>u&&t&&(e-=(r=e/u|0)*u,"second"==i&&(r+=e/1e3),r>1&&(i+="s"),s.push(n?r+" "+i:[i,r]),t--);return n?s.join(n):s}; | ||
"use strict";const e=36e5,t=24*e,o={year:315576e5,month:30*t,week:7*t,day:t,hour:e,minute:6e4,second:1e3};exports.duration=(e,{parts:t=9,join:n=", "}={})=>{let r,s=[];for(let[i,c]of Object.entries(o))if((e>=c||"second"==i)&&t-- >0&&(e-=(r=e/c|0)*c,t&&"second"!=i||(r+=e/c),1!=r&&(i+="s"),s.push(n?r+" "+i:[i,r]),!e))break;return n?s.join(n):s}; | ||
//# sourceMappingURL=duration.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";const e=36e5,t=24*e,s={year:315576e5,month:30*t,week:7*t,day:t,hour:e,minute:6e4,second:1e3},r=e=>{if(+e)return+e;const[,t,r]=e.match(/^([^ ]+) +(\w\w*?)s?$/)||[];return+t*(s[r]||1)};exports.datePlus=(e,t=new Date)=>new Date(t.getTime()+r(e)),exports.duration=(e,{parts:t=9,join:r=", "}={})=>{let n,o=[];for(let[u,a]of Object.entries(s))e>a&&t&&(e-=(n=e/a|0)*a,"second"==u&&(n+=e/1e3),n>1&&(u+="s"),o.push(r?n+" "+u:[u,n]),t--);return r?o.join(r):o},exports.ms=r,exports.seconds=e=>r(e)/1e3; | ||
"use strict";const e=36e5,t=24*e,s={year:315576e5,month:30*t,week:7*t,day:t,hour:e,minute:6e4,second:1e3},r=e=>{if(+e)return+e;const[,t,r]=e.match(/^([^ ]+) +(\w\w*?)s?$/)||[];return+t*(s[r]||1)};exports.datePlus=(e,t=new Date)=>new Date(t.getTime()+r(e)),exports.duration=(e,{parts:t=9,join:r=", "}={})=>{let n,o=[];for(let[a,c]of Object.entries(s))if((e>=c||"second"==a)&&t-- >0&&(e-=(n=e/c|0)*c,t&&"second"!=a||(n+=e/c),1!=n&&(a+="s"),o.push(r?n+" "+a:[a,n]),!e))break;return r?o.join(r):o},exports.ms=r,exports.seconds=e=>r(e)/1e3; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "itty-time", | ||
"version": "1.0.4", | ||
"version": "1.0.5-next.0", | ||
"description": "Ultra-small (~390 bytes) library for TTL date math and converting ms durations to and from strings.", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19248
41
2