@alwatr/parse-duration 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/main.cjs +1 -1
- package/dist/main.mjs +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.10](https://github.com/Alwatr/nanolib/compare/@alwatr/parse-duration@1.0.9...@alwatr/parse-duration@1.0.10) (2024-09-15)
|
|
7
|
+
|
|
8
|
+
### Dependencies update
|
|
9
|
+
|
|
10
|
+
* bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
|
|
11
|
+
* update ([c36ed50](https://github.com/Alwatr/nanolib/commit/c36ed50f68da2f5608ccd96119963a16cfacb4ce)) by @AliMD
|
|
12
|
+
|
|
6
13
|
## [1.0.9](https://github.com/Alwatr/nanolib/compare/@alwatr/parse-duration@1.0.8...@alwatr/parse-duration@1.0.9) (2024-08-31)
|
|
7
14
|
|
|
8
15
|
### Miscellaneous Chores
|
package/dist/main.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @alwatr/parse-duration v1.0.
|
|
1
|
+
/* @alwatr/parse-duration v1.0.10 */
|
|
2
2
|
"use strict";var e=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,n)=>{for(var t in n)e(r,t,{get:n[t],enumerable:!0})},w=(r,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of m(n))!d.call(r,o)&&o!==t&&e(r,o,{get:()=>n[o],enumerable:!(i=f(n,o))||i.enumerable});return r};var D=r=>w(e({},"__esModule",{value:!0}),r);var h={};p(h,{parseDuration:()=>b});module.exports=D(h);var c=require("@alwatr/is-number"),a={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:2592e6,y:31536e6},b=(r,n)=>{let t=r.slice(0,r.length-1);if(!(0,c.isNumber)(t))throw new Error("not_a_number");let i=+t,o=r.slice(-1),u=a[o];if(u===void 0)throw new Error("invalid_unit",{cause:{duration:r}});let s=i*u;if(n===void 0)return s;let _=a[n];if(_===void 0)throw new Error("invalid_unit",{cause:{toUnit:n}});return s/_};0&&(module.exports={parseDuration});
|
|
3
3
|
//# sourceMappingURL=main.cjs.map
|
package/dist/main.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @alwatr/parse-duration v1.0.
|
|
1
|
+
/* @alwatr/parse-duration v1.0.10 */
|
|
2
2
|
import{isNumber as a}from"@alwatr/is-number";var u={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5,M:2592e6,y:31536e6},f=(n,r)=>{let t=n.slice(0,n.length-1);if(!a(t))throw new Error("not_a_number");let s=+t,_=n.slice(-1),o=u[_];if(o===void 0)throw new Error("invalid_unit",{cause:{duration:n}});let i=s*o;if(r===void 0)return i;let e=u[r];if(e===void 0)throw new Error("invalid_unit",{cause:{toUnit:r}});return i/e};export{f as parseDuration};
|
|
3
3
|
//# sourceMappingURL=main.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/parse-duration",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "A simple utility to parse a duration string into milliseconds number.",
|
|
5
5
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"clean": "rm -rfv dist *.tsbuildinfo"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@alwatr/is-number": "^1.0.
|
|
72
|
+
"@alwatr/is-number": "^1.0.10"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@alwatr/nano-build": "^1.3.
|
|
75
|
+
"@alwatr/nano-build": "^1.3.9",
|
|
76
76
|
"@alwatr/prettier-config": "^1.0.4",
|
|
77
77
|
"@alwatr/tsconfig-base": "^1.2.0",
|
|
78
|
-
"@types/node": "^22.5.
|
|
78
|
+
"@types/node": "^22.5.5",
|
|
79
79
|
"jest": "^29.7.0",
|
|
80
|
-
"typescript": "^5.
|
|
80
|
+
"typescript": "^5.6.2"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "30b89ecac526d2549d7361843ec47f8dde056d45"
|
|
83
83
|
}
|