vivth 1.5.7 → 1.5.8
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.
|
@@ -18,8 +18,6 @@ export declare const TypeMap: {
|
|
|
18
18
|
* @description
|
|
19
19
|
* A type-safe `typeof` helper.
|
|
20
20
|
* @template {keyof typeof TypeMap} K
|
|
21
|
-
* @
|
|
22
|
-
* @param {K} type - The type string to compare against.
|
|
23
|
-
* @returns {object is typeof TypeMap[K]} - Returns true if the type matches, narrowing the type.
|
|
21
|
+
* @[blank]typedef {import('./IsTypeOf.mts').IsTypeOf<K>} IsTypeOf
|
|
24
22
|
*/
|
|
25
23
|
export declare function IsTypeOf<K extends keyof typeof TypeMap>(object: unknown, type: K): object is (typeof TypeMap)[K];
|
package/package.json
CHANGED
|
@@ -10,13 +10,10 @@ const TypeMap = {
|
|
|
10
10
|
bigint: 0n
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* @preserve
|
|
14
13
|
* @description
|
|
15
14
|
* A type-safe `typeof` helper.
|
|
16
15
|
* @template {keyof typeof TypeMap} K
|
|
17
|
-
* @
|
|
18
|
-
* @param {K} type - The type string to compare against.
|
|
19
|
-
* @returns {object is typeof TypeMap[K]} - Returns true if the type matches, narrowing the type.
|
|
16
|
+
* @typedef {import('./IsTypeOf.mts').IsTypeOf<K>} IsTypeOf
|
|
20
17
|
*/
|
|
21
18
|
function IsTypeOf(object, type) {
|
|
22
19
|
return typeof object === type;
|
|
@@ -19,9 +19,7 @@ export const TypeMap = {
|
|
|
19
19
|
* @description
|
|
20
20
|
* A type-safe `typeof` helper.
|
|
21
21
|
* @template {keyof typeof TypeMap} K
|
|
22
|
-
* @
|
|
23
|
-
* @param {K} type - The type string to compare against.
|
|
24
|
-
* @returns {object is typeof TypeMap[K]} - Returns true if the type matches, narrowing the type.
|
|
22
|
+
* @[blank]typedef {import('./IsTypeOf.mts').IsTypeOf<K>} IsTypeOf
|
|
25
23
|
*/
|
|
26
24
|
export function IsTypeOf<K extends keyof typeof TypeMap>(
|
|
27
25
|
object: unknown,
|