Comparing version 1.0.2 to 1.0.3
@@ -1,2 +0,2 @@ | ||
"use strict";const e=36e5,t=24*e,n={year:315576e5,month:30*t,week:7*t,day:t,hour:e,minute:6e4,second:1e3};exports.datePlus=(e,t=new Date)=>new Date(t.getTime()+(e=>{if(+e)return+e;const[,t,r]=e.match(/^([^ ]+) *(\w\w*?)s?$/)||[];return+t*(n[r]||1)})(e)); | ||
"use strict";const e=36e5,t=24*e,n={year:315576e5,month:30*t,week:7*t,day:t,hour:e,minute:6e4,second:1e3};exports.datePlus=(e,t=new Date)=>new Date(t.getTime()+(e=>{if(+e)return+e;const[,t,r]=e.match(/^([^ ]+) +(\w\w*?)s?$/)||[];return+t*(n[r]||1)})(e)); | ||
//# sourceMappingURL=datePlus.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[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; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";const e=36e5,t=24*e,r={year:315576e5,month:30*t,week:7*t,day:t,hour:e,minute:6e4,second:1e3};exports.ms=e=>{if(+e)return+e;const[,t,s]=e.match(/^([^ ]+) *(\w\w*?)s?$/)||[];return+t*(r[s]||1)}; | ||
"use strict";const e=36e5,t=24*e,r={year:315576e5,month:30*t,week:7*t,day:t,hour:e,minute:6e4,second:1e3};exports.ms=e=>{if(+e)return+e;const[,t,s]=e.match(/^([^ ]+) +(\w\w*?)s?$/)||[];return+t*(r[s]||1)}; | ||
//# sourceMappingURL=ms.js.map |
{ | ||
"name": "itty-time", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"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", |
<br /> | ||
<p align="center"> | ||
<p align="left"> | ||
<a href="https://itty.dev/itty-time"> | ||
<img src="https://github.com/kwhitley/itty-time/assets/865416/e45b9e04-a442-43b1-9961-59d62c62e88a" alt="itty-time" height="120" /> | ||
</a> | ||
<br /><br /> | ||
<br /> | ||
<p> | ||
<p align="center"> | ||
<p align="left"> | ||
<a href="https://npmjs.com/package/itty-time" target="_blank"> | ||
<img src="https://img.shields.io/npm/v/itty-time.svg?style=flat-square" alt="npm version" /> | ||
</a> | ||
<a href="https://itty.ing/https://edge.bundlejs.com/?q=itty-time" target="_blank"> | ||
<img src="https://itty.ing/https://edge.bundlejs.com/?q=itty-time&badge&badge-style=flat-square" alt="bundle size" /> | ||
<a href="https://itty.ing/https://deno.bundlejs.com/?q=itty-time" target="_blank"> | ||
<img src="https://itty.ing/https://deno.bundlejs.com/?q=itty-time&badge&badge-style=flat-square" alt="bundle size" /> | ||
</a> | ||
@@ -30,13 +30,11 @@ <a href="https://github.com/kwhitley/itty-time/actions/workflows/verify.yml" target="_blank"> | ||
<br /> | ||
<a href="https://discord.gg/53vyrZAu9u" target="_blank"> | ||
<img src="https://img.shields.io/discord/832353585802903572?label=Discord&logo=Discord&style=flat-square&logoColor=fff" alt="join us on discord" /> | ||
</a> | ||
<a href="https://github.com/kwhitley/itty-time" target="_blank"> | ||
<!-- <a href="https://github.com/kwhitley/itty-time" target="_blank"> | ||
<img src="https://img.shields.io/github/stars/kwhitley/itty-time?style=social" alt="Repo stars" /> | ||
</a> | ||
<a href="https://www.twitter.com/ittydev" target="_blank"> | ||
</a> --> | ||
<!-- <a href="https://www.twitter.com/ittydev" target="_blank"> | ||
<img src="https://img.shields.io/twitter/follow/ittydev.svg?style=social&label=Follow" alt="Follow ittydev" /> | ||
</a> | ||
</a> --> | ||
</p> | ||
@@ -43,0 +41,0 @@ |
@@ -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};exports.seconds=e=>(e=>{if(+e)return+e;const[,t,n]=e.match(/^([^ ]+) *(\w\w*?)s?$/)||[];return+t*(s[n]||1)})(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};exports.seconds=e=>(e=>{if(+e)return+e;const[,t,n]=e.match(/^([^ ]+) +(\w\w*?)s?$/)||[];return+t*(s[n]||1)})(e)/1e3; | ||
//# sourceMappingURL=seconds.js.map |
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
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
20152
154