@openclaw/google-meet 2026.8.1-beta.2 → 2026.9.1-beta.1
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/dist/{cli-o7RWVqDb.js → cli-Bd63VJ5q.js} +31 -19
- package/dist/{create-UHeaRzsH.js → create-BEDHM6uL.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{plugin-helpers-CfeT1SYY.js → plugin-helpers-C9-Y0Ago.js} +2 -2
- package/dist/{plugin-registration-rSOssQmm.js → plugin-registration-Csi-NdQU.js} +3 -13
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/openclaw.plugin.json +7 -0
- package/package.json +5 -7
- package/node_modules/pretty-ms/index.d.ts +0 -157
- package/node_modules/pretty-ms/index.js +0 -149
- package/node_modules/pretty-ms/license +0 -9
- package/node_modules/pretty-ms/node_modules/parse-ms/index.d.ts +0 -30
- package/node_modules/pretty-ms/node_modules/parse-ms/index.js +0 -45
- package/node_modules/pretty-ms/node_modules/parse-ms/license +0 -9
- package/node_modules/pretty-ms/node_modules/parse-ms/package.json +0 -47
- package/node_modules/pretty-ms/node_modules/parse-ms/readme.md +0 -46
- package/node_modules/pretty-ms/package.json +0 -55
- package/node_modules/pretty-ms/readme.md +0 -179
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0;
|
|
2
|
-
|
|
3
|
-
function parseNumber(milliseconds) {
|
|
4
|
-
return {
|
|
5
|
-
days: Math.trunc(milliseconds / 86_400_000),
|
|
6
|
-
hours: Math.trunc(milliseconds / 3_600_000 % 24),
|
|
7
|
-
minutes: Math.trunc(milliseconds / 60_000 % 60),
|
|
8
|
-
seconds: Math.trunc(milliseconds / 1000 % 60),
|
|
9
|
-
milliseconds: Math.trunc(milliseconds % 1000),
|
|
10
|
-
microseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1000) % 1000),
|
|
11
|
-
nanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1000),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function parseBigint(milliseconds) {
|
|
16
|
-
return {
|
|
17
|
-
days: milliseconds / 86_400_000n,
|
|
18
|
-
hours: milliseconds / 3_600_000n % 24n,
|
|
19
|
-
minutes: milliseconds / 60_000n % 60n,
|
|
20
|
-
seconds: milliseconds / 1000n % 60n,
|
|
21
|
-
milliseconds: milliseconds % 1000n,
|
|
22
|
-
microseconds: 0n,
|
|
23
|
-
nanoseconds: 0n,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default function parseMilliseconds(milliseconds) {
|
|
28
|
-
switch (typeof milliseconds) {
|
|
29
|
-
case 'number': {
|
|
30
|
-
if (Number.isFinite(milliseconds)) {
|
|
31
|
-
return parseNumber(milliseconds);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
case 'bigint': {
|
|
38
|
-
return parseBigint(milliseconds);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// No default
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
throw new TypeError('Expected a finite number or bigint');
|
|
45
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "parse-ms",
|
|
3
|
-
"version": "4.0.0",
|
|
4
|
-
"description": "Parse milliseconds into an object",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/parse-ms",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": {
|
|
15
|
-
"types": "./index.d.ts",
|
|
16
|
-
"default": "./index.js"
|
|
17
|
-
},
|
|
18
|
-
"sideEffects": false,
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=18"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "xo && ava && tsd"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"index.js",
|
|
27
|
-
"index.d.ts"
|
|
28
|
-
],
|
|
29
|
-
"keywords": [
|
|
30
|
-
"browser",
|
|
31
|
-
"parse",
|
|
32
|
-
"time",
|
|
33
|
-
"ms",
|
|
34
|
-
"milliseconds",
|
|
35
|
-
"microseconds",
|
|
36
|
-
"nanoseconds",
|
|
37
|
-
"duration",
|
|
38
|
-
"period",
|
|
39
|
-
"range",
|
|
40
|
-
"interval"
|
|
41
|
-
],
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"ava": "^6.0.1",
|
|
44
|
-
"tsd": "^0.30.3",
|
|
45
|
-
"xo": "^0.56.0"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# parse-ms
|
|
2
|
-
|
|
3
|
-
> Parse milliseconds into an object
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install parse-ms
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import parseMilliseconds from 'parse-ms';
|
|
15
|
-
|
|
16
|
-
parseMilliseconds(1337000001);
|
|
17
|
-
/*
|
|
18
|
-
{
|
|
19
|
-
days: 15,
|
|
20
|
-
hours: 11,
|
|
21
|
-
minutes: 23,
|
|
22
|
-
seconds: 20,
|
|
23
|
-
milliseconds: 1,
|
|
24
|
-
microseconds: 0,
|
|
25
|
-
nanoseconds: 0
|
|
26
|
-
}
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
parseMilliseconds(1337000001n);
|
|
30
|
-
/*
|
|
31
|
-
{
|
|
32
|
-
days: 15n,
|
|
33
|
-
hours: 11n,
|
|
34
|
-
minutes: 23n,
|
|
35
|
-
seconds: 20n,
|
|
36
|
-
milliseconds: 1n,
|
|
37
|
-
microseconds: 0n,
|
|
38
|
-
nanoseconds: 0n
|
|
39
|
-
}
|
|
40
|
-
*/
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Related
|
|
44
|
-
|
|
45
|
-
- [to-milliseconds](https://github.com/sindresorhus/to-milliseconds) - The inverse of this module
|
|
46
|
-
- [pretty-ms](https://github.com/sindresorhus/pretty-ms) - Convert milliseconds to a human readable string
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pretty-ms",
|
|
3
|
-
"version": "9.3.0",
|
|
4
|
-
"description": "Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": "sindresorhus/pretty-ms",
|
|
7
|
-
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
-
"author": {
|
|
9
|
-
"name": "Sindre Sorhus",
|
|
10
|
-
"email": "sindresorhus@gmail.com",
|
|
11
|
-
"url": "https://sindresorhus.com"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"exports": {
|
|
15
|
-
"types": "./index.d.ts",
|
|
16
|
-
"default": "./index.js"
|
|
17
|
-
},
|
|
18
|
-
"sideEffects": false,
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=18"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"test": "xo && ava && tsd"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"index.js",
|
|
27
|
-
"index.d.ts"
|
|
28
|
-
],
|
|
29
|
-
"keywords": [
|
|
30
|
-
"pretty",
|
|
31
|
-
"prettify",
|
|
32
|
-
"human",
|
|
33
|
-
"humanize",
|
|
34
|
-
"humanized",
|
|
35
|
-
"readable",
|
|
36
|
-
"time",
|
|
37
|
-
"ms",
|
|
38
|
-
"milliseconds",
|
|
39
|
-
"duration",
|
|
40
|
-
"period",
|
|
41
|
-
"range",
|
|
42
|
-
"text",
|
|
43
|
-
"string",
|
|
44
|
-
"number",
|
|
45
|
-
"hrtime"
|
|
46
|
-
],
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"parse-ms": "^4.0.0"
|
|
49
|
-
},
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"ava": "^6.2.0",
|
|
52
|
-
"tsd": "^0.31.2",
|
|
53
|
-
"xo": "^0.59.3"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
# pretty-ms
|
|
2
|
-
|
|
3
|
-
> Convert milliseconds to a human readable string: `1337000000` → `15d 11h 23m 20s`
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install pretty-ms
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import prettyMilliseconds from 'pretty-ms';
|
|
15
|
-
|
|
16
|
-
prettyMilliseconds(1337000000);
|
|
17
|
-
//=> '15d 11h 23m 20s'
|
|
18
|
-
|
|
19
|
-
prettyMilliseconds(1337000000n);
|
|
20
|
-
//=> '15d 11h 23m 20s'
|
|
21
|
-
|
|
22
|
-
prettyMilliseconds(1337);
|
|
23
|
-
//=> '1.3s'
|
|
24
|
-
|
|
25
|
-
prettyMilliseconds(133);
|
|
26
|
-
//=> '133ms'
|
|
27
|
-
|
|
28
|
-
// `compact` option
|
|
29
|
-
prettyMilliseconds(1337, {compact: true});
|
|
30
|
-
//=> '1s'
|
|
31
|
-
|
|
32
|
-
// `verbose` option
|
|
33
|
-
prettyMilliseconds(1335669000, {verbose: true});
|
|
34
|
-
//=> '15 days 11 hours 1 minute 9 seconds'
|
|
35
|
-
|
|
36
|
-
// `colonNotation` option
|
|
37
|
-
prettyMilliseconds(95500, {colonNotation: true});
|
|
38
|
-
//=> '1:35.5'
|
|
39
|
-
|
|
40
|
-
// `formatSubMilliseconds` option
|
|
41
|
-
prettyMilliseconds(100.400080, {formatSubMilliseconds: true})
|
|
42
|
-
//=> '100ms 400µs 80ns'
|
|
43
|
-
|
|
44
|
-
// `subSecondsAsDecimals` option
|
|
45
|
-
prettyMilliseconds(900, {subSecondsAsDecimals: true});
|
|
46
|
-
//=> '0.9s'
|
|
47
|
-
|
|
48
|
-
// Can be useful for time durations
|
|
49
|
-
prettyMilliseconds(new Date(2014, 0, 1, 10, 40) - new Date(2014, 0, 1, 10, 5))
|
|
50
|
-
//=> '35m'
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## API
|
|
54
|
-
|
|
55
|
-
### prettyMilliseconds(milliseconds, options?)
|
|
56
|
-
|
|
57
|
-
#### milliseconds
|
|
58
|
-
|
|
59
|
-
Type: `number | bigint`
|
|
60
|
-
|
|
61
|
-
Milliseconds to humanize.
|
|
62
|
-
|
|
63
|
-
#### options
|
|
64
|
-
|
|
65
|
-
Type: `object`
|
|
66
|
-
|
|
67
|
-
##### secondsDecimalDigits
|
|
68
|
-
|
|
69
|
-
Type: `number`\
|
|
70
|
-
Default: `1`
|
|
71
|
-
|
|
72
|
-
Number of digits to appear after the seconds decimal point.
|
|
73
|
-
|
|
74
|
-
##### millisecondsDecimalDigits
|
|
75
|
-
|
|
76
|
-
Type: `number`\
|
|
77
|
-
Default: `0`
|
|
78
|
-
|
|
79
|
-
Number of digits to appear after the milliseconds decimal point.
|
|
80
|
-
|
|
81
|
-
Useful in combination with [`process.hrtime()`](https://nodejs.org/api/process.html#process_process_hrtime_time).
|
|
82
|
-
|
|
83
|
-
##### keepDecimalsOnWholeSeconds
|
|
84
|
-
|
|
85
|
-
Type: `boolean`\
|
|
86
|
-
Default: `false`
|
|
87
|
-
|
|
88
|
-
Keep milliseconds on whole seconds: `13s` → `13.0s`.
|
|
89
|
-
|
|
90
|
-
Useful when you are showing a number of seconds spent on an operation and don't want the width of the output to change when hitting a whole number.
|
|
91
|
-
|
|
92
|
-
##### compact
|
|
93
|
-
|
|
94
|
-
Type: `boolean`\
|
|
95
|
-
Default: `false`
|
|
96
|
-
|
|
97
|
-
Only show the first unit: `1h 10m` → `1h`.
|
|
98
|
-
|
|
99
|
-
Also ensures that `millisecondsDecimalDigits` and `secondsDecimalDigits` are both set to `0`.
|
|
100
|
-
|
|
101
|
-
##### unitCount
|
|
102
|
-
|
|
103
|
-
Type: `number`\
|
|
104
|
-
Default: `Infinity`
|
|
105
|
-
|
|
106
|
-
Number of units to show. Setting `compact` to `true` overrides this option.
|
|
107
|
-
|
|
108
|
-
##### verbose
|
|
109
|
-
|
|
110
|
-
Type: `boolean`\
|
|
111
|
-
Default: `false`
|
|
112
|
-
|
|
113
|
-
Use full-length units: `5h 1m 45s` → `5 hours 1 minute 45 seconds`
|
|
114
|
-
|
|
115
|
-
##### separateMilliseconds
|
|
116
|
-
|
|
117
|
-
Type: `boolean`\
|
|
118
|
-
Default: `false`
|
|
119
|
-
|
|
120
|
-
Show milliseconds separately. This means they won't be included in the decimal part of the seconds.
|
|
121
|
-
|
|
122
|
-
##### formatSubMilliseconds
|
|
123
|
-
|
|
124
|
-
Type: `boolean`\
|
|
125
|
-
Default: `false`
|
|
126
|
-
|
|
127
|
-
Show microseconds and nanoseconds.
|
|
128
|
-
|
|
129
|
-
##### colonNotation
|
|
130
|
-
|
|
131
|
-
Type: `boolean`\
|
|
132
|
-
Default: `false`
|
|
133
|
-
|
|
134
|
-
Display time using colon notation: `5h 1m 45s` → `5:01:45`. Always shows time in at least minutes: `1s` → `0:01`
|
|
135
|
-
|
|
136
|
-
Useful when you want to display time without the time units, similar to a digital watch.
|
|
137
|
-
|
|
138
|
-
Setting `colonNotation` to `true` overrides the following options to `false`:
|
|
139
|
-
- `compact`
|
|
140
|
-
- `formatSubMilliseconds`
|
|
141
|
-
- `separateMilliseconds`
|
|
142
|
-
- `verbose`
|
|
143
|
-
|
|
144
|
-
##### hideYear
|
|
145
|
-
|
|
146
|
-
Type: `boolean`\
|
|
147
|
-
Default: `false`
|
|
148
|
-
|
|
149
|
-
Hides the year and shows the hidden year additionally as days (365 per year): `1y 3d 5h 1m 45s` → `368d 5h 1m 45s`.
|
|
150
|
-
|
|
151
|
-
##### hideYearAndDays
|
|
152
|
-
|
|
153
|
-
Type: `boolean`\
|
|
154
|
-
Default: `false`
|
|
155
|
-
|
|
156
|
-
Hides the year and days and shows the hidden values additionally as hours: `1y 3d 5h 1m 45s` → `8837h 1m 45s`.
|
|
157
|
-
|
|
158
|
-
##### hideSeconds
|
|
159
|
-
|
|
160
|
-
Type: `boolean`\
|
|
161
|
-
Default: `false`
|
|
162
|
-
|
|
163
|
-
Hides the seconds: `1y 3d 5h 1m 45s` → `1y 3d 5h 1m`.
|
|
164
|
-
|
|
165
|
-
##### subSecondsAsDecimals
|
|
166
|
-
|
|
167
|
-
Type: `boolean`\
|
|
168
|
-
Default: `false`
|
|
169
|
-
|
|
170
|
-
Show sub-second values as decimal seconds: `900ms` → `0.9s`.
|
|
171
|
-
|
|
172
|
-
Useful for progress indicators where you want consistent unit format to prevent flickering.
|
|
173
|
-
|
|
174
|
-
## Related
|
|
175
|
-
|
|
176
|
-
- [pretty-ms-cli](https://github.com/sindresorhus/pretty-ms-cli) - CLI for this module
|
|
177
|
-
- [parse-ms](https://github.com/sindresorhus/parse-ms) - Parse milliseconds into an object
|
|
178
|
-
- [to-milliseconds](https://github.com/sindresorhus/to-milliseconds) - Convert an object of time properties to milliseconds
|
|
179
|
-
- [pretty-bytes](https://github.com/sindresorhus/pretty-bytes) - Convert bytes to a human readable string
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import { Unreachable } from '../system/unreachable/index.mjs';
|
|
2
|
-
import * as Puny from './_puny.mjs';
|
|
3
|
-
// ------------------------------------------------------------------
|
|
4
|
-
// Unicode General Category Helper (RFC 5892)
|
|
5
|
-
// ------------------------------------------------------------------
|
|
6
|
-
function IsNonspacingMark(cp) {
|
|
7
|
-
return /\p{Mn}/u.test(String.fromCodePoint(cp));
|
|
8
|
-
}
|
|
9
|
-
function IsSpacingCombiningMark(cp) {
|
|
10
|
-
return /\p{Mc}/u.test(String.fromCodePoint(cp));
|
|
11
|
-
}
|
|
12
|
-
function IsEnclosingMark(cp) {
|
|
13
|
-
return /\p{Me}/u.test(String.fromCodePoint(cp));
|
|
14
|
-
}
|
|
15
|
-
function IsCombiningMark(cp) {
|
|
16
|
-
return IsNonspacingMark(cp) || IsSpacingCombiningMark(cp) || IsEnclosingMark(cp);
|
|
17
|
-
}
|
|
18
|
-
// ------------------------------------------------------------------
|
|
19
|
-
// RFC 5892 §2.6 DISALLOWED exceptions
|
|
20
|
-
//
|
|
21
|
-
// https://tools.ietf.org/html/rfc5892#section-2.6
|
|
22
|
-
// ------------------------------------------------------------------
|
|
23
|
-
const RFC5892_DISALLOWED = new Set([
|
|
24
|
-
0x0640, // ARABIC TATWEEL
|
|
25
|
-
0x07fa, // NKO LAJANYALAN
|
|
26
|
-
0x302e, // HANGUL SINGLE DOT TONE MARK
|
|
27
|
-
0x302f, // HANGUL DOUBLE DOT TONE MARK
|
|
28
|
-
0x3031, // VERTICAL KANA REPEAT MARK
|
|
29
|
-
0x3032, // VERTICAL KANA REPEAT WITH VOICED ITERATION MARK
|
|
30
|
-
0x3033, // VERTICAL KANA REPEAT MARK UPPER HALF
|
|
31
|
-
0x3034, // VERTICAL KANA REPEAT WITH VOICED ITERATION MARK UPPER HALF
|
|
32
|
-
0x3035, // VERTICAL KANA REPEAT MARK LOWER HALF
|
|
33
|
-
0x303b // VERTICAL IDEOGRAPHIC ITERATION MARK
|
|
34
|
-
]);
|
|
35
|
-
// ------------------------------------------------------------------
|
|
36
|
-
// A set of Virama (halant) code points used to validate CONTEXTJ
|
|
37
|
-
// rules (RFC 5892 Appendix A.1). These characters allow a subsequent
|
|
38
|
-
// Zero Width Non-Joiner (U+200C) or Zero Width Joiner (U+200D) to
|
|
39
|
-
// be valid in a label.
|
|
40
|
-
// ------------------------------------------------------------------
|
|
41
|
-
const VIRAMA_CPS = new Set([
|
|
42
|
-
0x094d,
|
|
43
|
-
0x09cd,
|
|
44
|
-
0x0a4d,
|
|
45
|
-
0x0acd,
|
|
46
|
-
0x0b4d,
|
|
47
|
-
0x0bcd,
|
|
48
|
-
0x0c4d,
|
|
49
|
-
0x0ccd,
|
|
50
|
-
0x0d3b,
|
|
51
|
-
0x0d3c,
|
|
52
|
-
0x0d4d,
|
|
53
|
-
0x0dca,
|
|
54
|
-
0x1b44,
|
|
55
|
-
0x1baa,
|
|
56
|
-
0x1bab,
|
|
57
|
-
0xa9c0,
|
|
58
|
-
0x11046,
|
|
59
|
-
0x1107f,
|
|
60
|
-
0x110b9,
|
|
61
|
-
0x11133,
|
|
62
|
-
0x11134,
|
|
63
|
-
0x111c0,
|
|
64
|
-
0x11235,
|
|
65
|
-
0x1134d,
|
|
66
|
-
0x11442,
|
|
67
|
-
0x114c2,
|
|
68
|
-
0x115bf,
|
|
69
|
-
0x1163f,
|
|
70
|
-
0x116b6,
|
|
71
|
-
0x11c3f,
|
|
72
|
-
0x11d44,
|
|
73
|
-
0x11d45
|
|
74
|
-
]);
|
|
75
|
-
// ------------------------------------------------------------------
|
|
76
|
-
// Guards for CONTEXTO rules (RFC 5892 Appendix A)
|
|
77
|
-
// ------------------------------------------------------------------
|
|
78
|
-
function IsGreek(cp) {
|
|
79
|
-
return /\p{Script=Greek}/u.test(String.fromCodePoint(cp));
|
|
80
|
-
}
|
|
81
|
-
function IsHebrew(cp) {
|
|
82
|
-
return /\p{Script=Hebrew}/u.test(String.fromCodePoint(cp));
|
|
83
|
-
}
|
|
84
|
-
function IsHiragana(cp) {
|
|
85
|
-
return /\p{Script=Hiragana}/u.test(String.fromCodePoint(cp));
|
|
86
|
-
}
|
|
87
|
-
function IsKatakana(cp) {
|
|
88
|
-
return /\p{Script=Katakana}/u.test(String.fromCodePoint(cp));
|
|
89
|
-
}
|
|
90
|
-
function IsHan(cp) {
|
|
91
|
-
return /\p{Script=Han}/u.test(String.fromCodePoint(cp));
|
|
92
|
-
}
|
|
93
|
-
function IsArabicIndicDigit(cp) {
|
|
94
|
-
return cp >= 0x0660 && cp <= 0x0669;
|
|
95
|
-
}
|
|
96
|
-
function IsExtendedArabicIndicDigit(cp) {
|
|
97
|
-
return cp >= 0x06f0 && cp <= 0x06f9;
|
|
98
|
-
}
|
|
99
|
-
function IsVirama(cp) {
|
|
100
|
-
return VIRAMA_CPS.has(cp);
|
|
101
|
-
}
|
|
102
|
-
// ------------------------------------------------------------------
|
|
103
|
-
// IsUnicodeLabel
|
|
104
|
-
// ------------------------------------------------------------------
|
|
105
|
-
function IsUnicodeLabel(value) {
|
|
106
|
-
// deno-coverage-ignore-start - unable to reach via format guards
|
|
107
|
-
if (value.length === 0)
|
|
108
|
-
return Unreachable(); // false
|
|
109
|
-
// deno-coverage-ignore-stop
|
|
110
|
-
// Use spread to handle surrogate pairs and provide O(1) neighbor access
|
|
111
|
-
const cps = [...value].map((c) => c.codePointAt(0));
|
|
112
|
-
const len = cps.length;
|
|
113
|
-
// RFC 5891 §4.2.3.2: Hyphen rules
|
|
114
|
-
if (cps[0] === 0x2d || cps[len - 1] === 0x2d)
|
|
115
|
-
return false;
|
|
116
|
-
if (len >= 4 && cps[2] === 0x2d && cps[3] === 0x2d)
|
|
117
|
-
return false;
|
|
118
|
-
// RFC 5891 §4.2.3.2 - Must not begin with a combining mark
|
|
119
|
-
if (IsCombiningMark(cps[0]))
|
|
120
|
-
return false;
|
|
121
|
-
let hasJapanese = false;
|
|
122
|
-
let hasArabicIndic = false;
|
|
123
|
-
let hasExtendedArabicIndic = false;
|
|
124
|
-
for (let i = 0; i < len; i++) {
|
|
125
|
-
const cp = cps[i];
|
|
126
|
-
// 1. DISALLOWED exceptions
|
|
127
|
-
if (RFC5892_DISALLOWED.has(cp))
|
|
128
|
-
return false;
|
|
129
|
-
// 2. Collect Flags
|
|
130
|
-
if (IsHiragana(cp) || IsKatakana(cp) || IsHan(cp))
|
|
131
|
-
hasJapanese = true;
|
|
132
|
-
if (IsArabicIndicDigit(cp))
|
|
133
|
-
hasArabicIndic = true;
|
|
134
|
-
if (IsExtendedArabicIndicDigit(cp))
|
|
135
|
-
hasExtendedArabicIndic = true;
|
|
136
|
-
// 3. CONTEXTO / CONTEXTJ Neighbor Rules
|
|
137
|
-
const prev = cps[i - 1], next = cps[i + 1];
|
|
138
|
-
switch (cp) {
|
|
139
|
-
case 0x00b7:
|
|
140
|
-
if (prev !== 0x006c || next !== 0x006c)
|
|
141
|
-
return false;
|
|
142
|
-
break; // MIDDLE DOT (Catalan)
|
|
143
|
-
case 0x0375:
|
|
144
|
-
if (next === undefined || !IsGreek(next))
|
|
145
|
-
return false;
|
|
146
|
-
break; // Greek KERAIA
|
|
147
|
-
case 0x05f3:
|
|
148
|
-
case 0x05f4:
|
|
149
|
-
if (prev === undefined || !IsHebrew(prev))
|
|
150
|
-
return false;
|
|
151
|
-
break; // Hebrew GERESH
|
|
152
|
-
case 0x200c: // ZWNJ - RFC 5892 Appendix A.1
|
|
153
|
-
// Note: Full validation requires a Unicode joining type table. We reject
|
|
154
|
-
// only when preceded by ASCII (U+0000-U+007F), which can never satisfy
|
|
155
|
-
// the Virama or cursive-joining rules.
|
|
156
|
-
if (prev === undefined || (prev < 0x0080 && !IsVirama(prev)))
|
|
157
|
-
return false;
|
|
158
|
-
break;
|
|
159
|
-
case 0x200d: // ZWJ - RFC 5892 Appendix A.2
|
|
160
|
-
if (prev === undefined || !IsVirama(prev))
|
|
161
|
-
return false;
|
|
162
|
-
break;
|
|
163
|
-
case 0x30fb: /* Checked at end via hasJapanese */
|
|
164
|
-
break; // KATAKANA MIDDLE DOT
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
// 4. Global Context Validations (Post-loop)
|
|
168
|
-
// RFC 5892 Appendix A.7 - Katakana Middle Dot requirement
|
|
169
|
-
if (value.includes('\u30fb') && !hasJapanese)
|
|
170
|
-
return false;
|
|
171
|
-
// RFC 5892 Appendix A.8/A.9 - Mixing Arabic Digits
|
|
172
|
-
if (hasArabicIndic && hasExtendedArabicIndic)
|
|
173
|
-
return false;
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
// ------------------------------------------------------------------
|
|
177
|
-
// IsAsciiLabel
|
|
178
|
-
// ------------------------------------------------------------------
|
|
179
|
-
function IsAsciiLabel(value) {
|
|
180
|
-
// Must not start or end with a hyphen
|
|
181
|
-
if (value.charCodeAt(0) === 45 || value.charCodeAt(value.length - 1) === 45)
|
|
182
|
-
return false;
|
|
183
|
-
// RFC 5891 §4.2.3.1 : "--" at positions 3-4 is reserved for A-labels only
|
|
184
|
-
if (value.length >= 4 && value.charCodeAt(2) === 45 && value.charCodeAt(3) === 45)
|
|
185
|
-
return false;
|
|
186
|
-
// All characters must be alphanumeric or hyphen
|
|
187
|
-
for (let i = 0; i < value.length; i++) {
|
|
188
|
-
const ch = value.charCodeAt(i);
|
|
189
|
-
if (!((ch >= 97 && ch <= 122) || // a-z
|
|
190
|
-
(ch >= 65 && ch <= 90) || // A-Z
|
|
191
|
-
(ch >= 48 && ch <= 57) || // 0-9
|
|
192
|
-
ch === 45 // '-'
|
|
193
|
-
))
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
196
|
-
return true;
|
|
197
|
-
}
|
|
198
|
-
// ------------------------------------------------------------------
|
|
199
|
-
// IsPunyLabel
|
|
200
|
-
// ------------------------------------------------------------------
|
|
201
|
-
function IsPuny(value) {
|
|
202
|
-
return value.toLowerCase().startsWith('xn--');
|
|
203
|
-
}
|
|
204
|
-
function IsPunyLabel(value) {
|
|
205
|
-
try {
|
|
206
|
-
const payload = value.slice(4).toLowerCase();
|
|
207
|
-
// 1. Structural Validation (RFC 3492 syntax)
|
|
208
|
-
//
|
|
209
|
-
// If the payload contains a hyphen, it MUST be a delimiter separating basic
|
|
210
|
-
// ASCII characters from the variable-length integers. A payload consisting
|
|
211
|
-
// of ONLY a hyphen or starting with multiple hyphens without basic ASCII
|
|
212
|
-
// characters (like "-9uc") is fundamentally malformed.
|
|
213
|
-
//
|
|
214
|
-
const lastHyphen = payload.lastIndexOf('-');
|
|
215
|
-
if (lastHyphen === 0) {
|
|
216
|
-
// Catches "-9uc" right here because the delimiter is at index 0, meaning 0
|
|
217
|
-
// basic ASCII characters preceded it, which is non-canonical.
|
|
218
|
-
return false;
|
|
219
|
-
}
|
|
220
|
-
// 2. Decode the payload
|
|
221
|
-
const decoded = Puny.Decode(payload);
|
|
222
|
-
if (!decoded)
|
|
223
|
-
return false;
|
|
224
|
-
// 3. Validate the output rules against RFC 5892
|
|
225
|
-
return IsUnicodeLabel(decoded);
|
|
226
|
-
}
|
|
227
|
-
catch {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
// ------------------------------------------------------------------
|
|
232
|
-
// IsIdnLabel
|
|
233
|
-
// ------------------------------------------------------------------
|
|
234
|
-
export function IsIdnLabel(value) {
|
|
235
|
-
if (value.length === 0 || value.length > 63)
|
|
236
|
-
return false;
|
|
237
|
-
return IsPuny(value) ? IsPunyLabel(value) : IsUnicodeLabel(value);
|
|
238
|
-
}
|
|
239
|
-
// ------------------------------------------------------------------
|
|
240
|
-
// IsLabel
|
|
241
|
-
// ------------------------------------------------------------------
|
|
242
|
-
export function IsLabel(value) {
|
|
243
|
-
if (value.length === 0 || value.length > 63)
|
|
244
|
-
return false;
|
|
245
|
-
return IsPuny(value) ? IsPunyLabel(value) : IsAsciiLabel(value);
|
|
246
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function Decode(value: string): string;
|