@sinclair/typebox 0.33.18 → 0.33.19
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Specialized deep immutable value. Applies freeze recursively to the given value */
|
|
2
|
-
export declare function Immutable
|
|
2
|
+
export declare function Immutable(value: unknown): unknown;
|
|
@@ -26,16 +26,12 @@ function ImmutableObject(value) {
|
|
|
26
26
|
return globalThis.Object.freeze(result);
|
|
27
27
|
}
|
|
28
28
|
/** Specialized deep immutable value. Applies freeze recursively to the given value */
|
|
29
|
+
// prettier-ignore
|
|
29
30
|
function Immutable(value) {
|
|
30
|
-
return ValueGuard.IsArray(value)
|
|
31
|
-
?
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
: ValueGuard.IsRegExp(value)
|
|
37
|
-
? ImmutableRegExp(value)
|
|
38
|
-
: ValueGuard.IsObject(value)
|
|
39
|
-
? ImmutableObject(value)
|
|
40
|
-
: value;
|
|
31
|
+
return (ValueGuard.IsArray(value) ? ImmutableArray(value) :
|
|
32
|
+
ValueGuard.IsDate(value) ? ImmutableDate(value) :
|
|
33
|
+
ValueGuard.IsUint8Array(value) ? ImmutableUint8Array(value) :
|
|
34
|
+
ValueGuard.IsRegExp(value) ? ImmutableRegExp(value) :
|
|
35
|
+
ValueGuard.IsObject(value) ? ImmutableObject(value) :
|
|
36
|
+
value);
|
|
41
37
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Specialized deep immutable value. Applies freeze recursively to the given value */
|
|
2
|
-
export declare function Immutable
|
|
2
|
+
export declare function Immutable(value: unknown): unknown;
|
|
@@ -22,16 +22,12 @@ function ImmutableObject(value) {
|
|
|
22
22
|
return globalThis.Object.freeze(result);
|
|
23
23
|
}
|
|
24
24
|
/** Specialized deep immutable value. Applies freeze recursively to the given value */
|
|
25
|
+
// prettier-ignore
|
|
25
26
|
export function Immutable(value) {
|
|
26
|
-
return ValueGuard.IsArray(value)
|
|
27
|
-
?
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
: ValueGuard.IsRegExp(value)
|
|
33
|
-
? ImmutableRegExp(value)
|
|
34
|
-
: ValueGuard.IsObject(value)
|
|
35
|
-
? ImmutableObject(value)
|
|
36
|
-
: value;
|
|
27
|
+
return (ValueGuard.IsArray(value) ? ImmutableArray(value) :
|
|
28
|
+
ValueGuard.IsDate(value) ? ImmutableDate(value) :
|
|
29
|
+
ValueGuard.IsUint8Array(value) ? ImmutableUint8Array(value) :
|
|
30
|
+
ValueGuard.IsRegExp(value) ? ImmutableRegExp(value) :
|
|
31
|
+
ValueGuard.IsObject(value) ? ImmutableObject(value) :
|
|
32
|
+
value);
|
|
37
33
|
}
|