type-fns 0.9.0 → 0.9.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* these are the keys most commonly used metadata keys
|
|
3
3
|
*/
|
|
4
|
-
declare const typicalMetadataKeys: readonly ["id", "uuid", "createdAt", "updatedAt", "effectiveAt"];
|
|
4
|
+
declare const typicalMetadataKeys: readonly ["id", "uuid", "createdAt", "updatedAt", "deletedAt", "effectiveAt"];
|
|
5
5
|
/**
|
|
6
6
|
* these are the keys most commonly used metadata keys
|
|
7
7
|
*/
|
|
@@ -14,6 +14,7 @@ type TypicalMetadataKeys = typeof typicalMetadataKeys[number];
|
|
|
14
14
|
* - `uuid`
|
|
15
15
|
* - `createdAt`
|
|
16
16
|
* - `updatedAt`
|
|
17
|
+
* - `deletedAt`
|
|
17
18
|
* - `effectiveAt`
|
|
18
19
|
*
|
|
19
20
|
* note:
|
|
@@ -32,9 +33,10 @@ MetadataKeys>>;
|
|
|
32
33
|
* - `uuid`
|
|
33
34
|
* - `createdAt`
|
|
34
35
|
* - `updatedAt`
|
|
36
|
+
* - `deletedAt`
|
|
35
37
|
* - `effectiveAt`
|
|
36
38
|
*
|
|
37
39
|
* see more information about the `HasMetadata` type in its jsdoc on-hover documentation
|
|
38
40
|
*/
|
|
39
|
-
export declare const hasMetadata: <MetadataKeys extends string = "id" | "uuid" | "createdAt" | "updatedAt" | "effectiveAt", T extends Record<string, any> = Record<string, any>>(obj: T, keys?: MetadataKeys[]) => obj is HasMetadata<T, MetadataKeys>;
|
|
41
|
+
export declare const hasMetadata: <MetadataKeys extends string = "id" | "uuid" | "createdAt" | "updatedAt" | "deletedAt" | "effectiveAt", T extends Record<string, any> = Record<string, any>>(obj: T, keys?: MetadataKeys[]) => obj is HasMetadata<T, MetadataKeys>;
|
|
40
42
|
export {};
|
|
@@ -9,6 +9,7 @@ const typicalMetadataKeys = [
|
|
|
9
9
|
'uuid',
|
|
10
10
|
'createdAt',
|
|
11
11
|
'updatedAt',
|
|
12
|
+
'deletedAt',
|
|
12
13
|
'effectiveAt',
|
|
13
14
|
];
|
|
14
15
|
/**
|
|
@@ -19,6 +20,7 @@ const typicalMetadataKeys = [
|
|
|
19
20
|
* - `uuid`
|
|
20
21
|
* - `createdAt`
|
|
21
22
|
* - `updatedAt`
|
|
23
|
+
* - `deletedAt`
|
|
22
24
|
* - `effectiveAt`
|
|
23
25
|
*
|
|
24
26
|
* see more information about the `HasMetadata` type in its jsdoc on-hover documentation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasMetadata.js","sourceRoot":"","sources":["../../src/checks/hasMetadata.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM,mBAAmB,GAAG;IAC1B,IAAI;IACJ,MAAM;IACN,WAAW;IACX,WAAW;IACX,aAAa;CACL,CAAC;
|
|
1
|
+
{"version":3,"file":"hasMetadata.js","sourceRoot":"","sources":["../../src/checks/hasMetadata.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM,mBAAmB,GAAG;IAC1B,IAAI;IACJ,MAAM;IACN,WAAW;IACX,WAAW;IACX,WAAW;IACX,aAAa;CACL,CAAC;AAoCX;;;;;;;;;;;;GAYG;AACI,MAAM,WAAW,GAAG,CAIzB,GAAM,EACN,OAAuB,mBAA4C,EACvB,EAAE,CAC9C,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC;AAPjC,QAAA,WAAW,eAOsB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "type-fns",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "A set of types, type checks, and type guards for simpler, safer, and easier to read code.",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.1",
|
|
6
6
|
"repository": "ehmpathy/type-fns",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/type-fns",
|
|
8
8
|
"keywords": [
|
package/readme.md
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
# type-fns
|
|
2
2
|
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-
|
|
6
3
|
Narrow your codepaths with generic types, type checks, and type guards for simpler, safer, and easier to read code.
|
|
7
4
|
|
|
8
5
|
# Purpose
|