date-vir 9.4.0 → 9.4.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.
|
@@ -47,7 +47,7 @@ export type UtcIsoString = `${JustDateString}T${JustTimeWithSecondsString}.${num
|
|
|
47
47
|
*
|
|
48
48
|
* @category ISO
|
|
49
49
|
*/
|
|
50
|
-
export declare
|
|
50
|
+
export declare function utcIsoStringShape(defaultValue?: UtcIsoString): import("object-shape-tester").Shape<import("@sinclair/typebox").TUnsafe<`${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`>>;
|
|
51
51
|
/**
|
|
52
52
|
* Checks if the input is a valid UTC ISO string and type guards the input.
|
|
53
53
|
*
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { DateTime } from 'luxon';
|
|
2
2
|
import { createCustomShape } from 'object-shape-tester';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @
|
|
4
|
+
* Bundlers ignore `@__NO_SIDE_EFFECTS__` on the function `createCustomShape` returns, so
|
|
5
|
+
* {@link utcIsoStringShape} wraps this in a declaration that can carry it. That lets bundlers drop
|
|
6
|
+
* unused shapes that call {@link utcIsoStringShape}.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
const createUtcIsoStringShape = createCustomShape({
|
|
9
9
|
default: new Date().toISOString(),
|
|
10
10
|
name: 'UtcIsoString',
|
|
11
11
|
checkValue(value) {
|
|
12
12
|
return isValidIsoString(value);
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
+
/**
|
|
16
|
+
* A shape definition for {@link UtcIsoString}.
|
|
17
|
+
*
|
|
18
|
+
* @category ISO
|
|
19
|
+
*/
|
|
20
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
21
|
+
export function utcIsoStringShape(defaultValue) {
|
|
22
|
+
return createUtcIsoStringShape(defaultValue);
|
|
23
|
+
}
|
|
15
24
|
/**
|
|
16
25
|
* Checks if the input is a valid UTC ISO string and type guards the input.
|
|
17
26
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "date-vir",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.1",
|
|
4
4
|
"description": "Easy and explicit dates and times.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"date",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"test:docs": "virmator docs check"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@augment-vir/assert": "^32.
|
|
39
|
-
"@augment-vir/common": "^32.
|
|
40
|
-
"@date-vir/duration": "^9.4.
|
|
41
|
-
"@types/luxon": "^3.7.
|
|
38
|
+
"@augment-vir/assert": "^32.6.0",
|
|
39
|
+
"@augment-vir/common": "^32.6.0",
|
|
40
|
+
"@date-vir/duration": "^9.4.1",
|
|
41
|
+
"@types/luxon": "^3.7.6",
|
|
42
42
|
"luxon": "^3.7.2",
|
|
43
43
|
"object-shape-tester": "^6.15.1",
|
|
44
44
|
"type-fest": "^5.10.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@augment-vir/test": "^32.
|
|
47
|
+
"@augment-vir/test": "^32.6.0",
|
|
48
48
|
"@web/dev-server-esbuild": "^2.0.0",
|
|
49
49
|
"@web/test-runner": "^1.0.0",
|
|
50
50
|
"@web/test-runner-commands": "^1.0.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@web/test-runner-visual-regression": "^1.0.1",
|
|
53
53
|
"element-vir": "^27.0.2",
|
|
54
54
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
55
|
-
"markdown-code-example-inserter": "^3.
|
|
55
|
+
"markdown-code-example-inserter": "^3.1.1",
|
|
56
56
|
"typedoc": "^0.28.20",
|
|
57
57
|
"typescript": "^6.0.3"
|
|
58
58
|
},
|