ts-gems 3.4.0 → 3.5.0
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/lib/index.d.ts +8 -8
- package/lib/index.mjs +8 -8
- package/lib/nullish.d.ts +4 -2
- package/lib/omit-never.d.ts +4 -2
- package/lib/omit.d.ts +2 -1
- package/lib/partial.d.ts +4 -2
- package/lib/required.d.ts +2 -1
- package/lib/types.d.ts +3 -1
- package/package.json +38 -33
package/lib/index.d.ts
CHANGED
|
@@ -46,16 +46,16 @@ declare function asDeepRequired<T>(x: T): DeepRequired<T>;
|
|
|
46
46
|
declare function asDeeperRequired<T>(x: T): DeeperRequired<T>;
|
|
47
47
|
|
|
48
48
|
export {
|
|
49
|
-
asMutable,
|
|
50
|
-
asDeepMutable,
|
|
51
49
|
asDeeperMutable,
|
|
52
|
-
|
|
53
|
-
asDeepReadonly,
|
|
50
|
+
asDeeperPartial,
|
|
54
51
|
asDeeperReadonly,
|
|
55
|
-
|
|
52
|
+
asDeeperRequired,
|
|
53
|
+
asDeepMutable,
|
|
56
54
|
asDeepPartial,
|
|
57
|
-
|
|
58
|
-
asRequired,
|
|
55
|
+
asDeepReadonly,
|
|
59
56
|
asDeepRequired,
|
|
60
|
-
|
|
57
|
+
asMutable,
|
|
58
|
+
asPartial,
|
|
59
|
+
asReadonly,
|
|
60
|
+
asRequired,
|
|
61
61
|
};
|
package/lib/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
const noOp = x => x;
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
|
-
noOp as asMutable,
|
|
5
|
-
noOp as asDeepMutable,
|
|
6
4
|
noOp as asDeeperMutable,
|
|
7
|
-
noOp as
|
|
8
|
-
noOp as asDeepReadonly,
|
|
5
|
+
noOp as asDeeperPartial,
|
|
9
6
|
noOp as asDeeperReadonly,
|
|
10
|
-
noOp as
|
|
7
|
+
noOp as asDeeperRequired,
|
|
8
|
+
noOp as asDeepMutable,
|
|
11
9
|
noOp as asDeepPartial,
|
|
12
|
-
noOp as
|
|
13
|
-
noOp as asRequired,
|
|
10
|
+
noOp as asDeepReadonly,
|
|
14
11
|
noOp as asDeepRequired,
|
|
15
|
-
noOp as
|
|
12
|
+
noOp as asMutable,
|
|
13
|
+
noOp as asPartial,
|
|
14
|
+
noOp as asReadonly,
|
|
15
|
+
noOp as asRequired,
|
|
16
16
|
};
|
package/lib/nullish.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export type NullishObject<T = null> = {
|
|
|
12
12
|
* Make all properties in T nullish deeply
|
|
13
13
|
*/
|
|
14
14
|
export type DeepNullish<T> = {
|
|
15
|
-
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]?: IfNoDeepValue<
|
|
15
|
+
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]?: IfNoDeepValue<
|
|
16
|
+
// Do not deep process No-Deep values
|
|
16
17
|
Exclude<T[K], undefined>
|
|
17
18
|
> extends true
|
|
18
19
|
? T[K] | null
|
|
@@ -24,7 +25,8 @@ export type DeepNullish<T> = {
|
|
|
24
25
|
* Make all properties in T nullish deeply including arrays
|
|
25
26
|
*/
|
|
26
27
|
export type DeeperNullish<T> = {
|
|
27
|
-
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]?: Exclude<
|
|
28
|
+
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]?: Exclude<
|
|
29
|
+
// Deep process arrays
|
|
28
30
|
T[K],
|
|
29
31
|
undefined
|
|
30
32
|
> extends (infer U)[]
|
package/lib/omit-never.d.ts
CHANGED
|
@@ -28,7 +28,8 @@ export type OmitNever<T> = {
|
|
|
28
28
|
* Omit all "never" and "undefined" properties in T deeply
|
|
29
29
|
*/
|
|
30
30
|
export type DeepOmitNever<T> = {
|
|
31
|
-
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]: IfNoDeepValue<
|
|
31
|
+
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]: IfNoDeepValue<
|
|
32
|
+
// Do not deep process No-Deep values
|
|
32
33
|
Exclude<T[K], undefined>
|
|
33
34
|
> extends true
|
|
34
35
|
? T[K]
|
|
@@ -40,7 +41,8 @@ export type DeepOmitNever<T> = {
|
|
|
40
41
|
* Omit all "never" and "undefined" properties in T deeply including arrays
|
|
41
42
|
*/
|
|
42
43
|
export type DeeperOmitNever<T> = {
|
|
43
|
-
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]: Exclude<
|
|
44
|
+
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]: Exclude<
|
|
45
|
+
// Deep process arrays
|
|
44
46
|
T[K],
|
|
45
47
|
undefined
|
|
46
48
|
> extends (infer U)[]
|
package/lib/omit.d.ts
CHANGED
|
@@ -52,7 +52,8 @@ export type DeepOmitTypes<T, X> = {
|
|
|
52
52
|
* Omit all function properties in T deeply including arrays
|
|
53
53
|
*/
|
|
54
54
|
export type DeeperOmitTypes<T, X> = {
|
|
55
|
-
[K in keyof T as IfNever<Exclude<T[K], undefined | X>, never, K>]: Exclude<
|
|
55
|
+
[K in keyof T as IfNever<Exclude<T[K], undefined | X>, never, K>]: Exclude<
|
|
56
|
+
// Deep process arrays // Do not deep process No-Deep values
|
|
56
57
|
T[K],
|
|
57
58
|
undefined
|
|
58
59
|
> extends (infer U)[]
|
package/lib/partial.d.ts
CHANGED
|
@@ -19,7 +19,8 @@ export type PartialSome<T, K extends keyof T> = Partial<Pick<T, K>> &
|
|
|
19
19
|
* Partial but deeply
|
|
20
20
|
*/
|
|
21
21
|
export type DeepPartial<T> = {
|
|
22
|
-
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]?: IfNoDeepValue<
|
|
22
|
+
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]?: IfNoDeepValue<
|
|
23
|
+
// Do not deep process No-Deep values
|
|
23
24
|
Exclude<T[K], undefined>
|
|
24
25
|
> extends true
|
|
25
26
|
? T[K]
|
|
@@ -31,7 +32,8 @@ export type DeepPartial<T> = {
|
|
|
31
32
|
* Partial but deeply including arrays
|
|
32
33
|
*/
|
|
33
34
|
export type DeeperPartial<T> = {
|
|
34
|
-
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]?: Exclude<
|
|
35
|
+
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]?: Exclude<
|
|
36
|
+
// Deep process arrays
|
|
35
37
|
T[K],
|
|
36
38
|
undefined
|
|
37
39
|
> extends (infer U)[]
|
package/lib/required.d.ts
CHANGED
|
@@ -30,7 +30,8 @@ export type DeepRequired<T> = {
|
|
|
30
30
|
* Make all properties in T required deeply including arrays
|
|
31
31
|
*/
|
|
32
32
|
export type DeeperRequired<T> = {
|
|
33
|
-
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]-?: Exclude<
|
|
33
|
+
[K in keyof T as IfNever<Exclude<T[K], undefined>, never, K>]-?: Exclude<
|
|
34
|
+
// Deep process arrays
|
|
34
35
|
T[K],
|
|
35
36
|
undefined
|
|
36
37
|
> extends (infer U)[]
|
package/lib/types.d.ts
CHANGED
|
@@ -33,7 +33,9 @@ declare global {
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* BasicPrimitive
|
|
36
|
-
* @desc Type representing
|
|
36
|
+
* @desc Type representing
|
|
37
|
+
* [`BasicPrimitive`](https://www.typescriptlang.org/docs/handbook/release-notes/overview.html#smarter-type-alias-preservation)
|
|
38
|
+
* types in TypeScript
|
|
37
39
|
*/
|
|
38
40
|
type BasicPrimitive = number | string | boolean;
|
|
39
41
|
|
package/package.json
CHANGED
|
@@ -1,50 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-gems",
|
|
3
3
|
"description": "Valuable typing extensions for TypeScript",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"type": "module",
|
|
17
|
-
"module": "lib/index.mjs",
|
|
18
|
-
"main": "lib/index.cjs",
|
|
19
|
-
"types": "lib/index.d.ts",
|
|
4
|
+
"version": "3.5.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"module": "./lib/index.mjs",
|
|
7
|
+
"main": "./lib/index.cjs",
|
|
8
|
+
"types": "./lib/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./lib/index.mjs",
|
|
12
|
+
"require": "./lib/index.cjs",
|
|
13
|
+
"types": "./lib/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
20
16
|
"repository": "git@github.com:panates/ts-gems.git",
|
|
21
17
|
"author": "Eray Hanoglu <e.hanoglu@panates.com>",
|
|
22
|
-
"license": "MIT",
|
|
23
18
|
"scripts": {
|
|
24
19
|
"compile": "tsc -b tsconfig.json",
|
|
25
|
-
"lint": "eslint --
|
|
20
|
+
"lint": "eslint . --max-warnings=0",
|
|
21
|
+
"lint:fix": "eslint . --max-warnings=0 --fix",
|
|
26
22
|
"format": "prettier . --write --log-level=warn",
|
|
27
23
|
"test:common": "jest --clearCache && jest --config=./jest.config.mjs",
|
|
28
24
|
"test:nostrict": "jest --clearCache && jest --config=./jest.nostrict.config.mjs",
|
|
29
|
-
"test": "npm run test:common && npm run test:nostrict"
|
|
25
|
+
"test": "npm run test:common && npm run test:nostrict",
|
|
26
|
+
"prepare": "husky"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@panates/eslint-config": "^1.0.13",
|
|
30
|
+
"@panates/eslint-config-ts": "^1.0.13",
|
|
31
|
+
"@panates/tsconfig": "^1.0.13",
|
|
32
|
+
"@types/jest": "^29.5.12",
|
|
33
|
+
"husky": "^9.1.4",
|
|
34
|
+
"jest": "^29.7.0",
|
|
35
|
+
"prettier": "^3.3.3",
|
|
36
|
+
"ts-jest": "^29.2.4",
|
|
37
|
+
"typescript": "^5.5.4"
|
|
30
38
|
},
|
|
31
39
|
"files": [
|
|
32
40
|
"LICENSE",
|
|
33
41
|
"README",
|
|
34
42
|
"lib/"
|
|
35
43
|
],
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
"ts-jest": "^29.1.2",
|
|
48
|
-
"typescript": "^5.4.5"
|
|
49
|
-
}
|
|
44
|
+
"keywords": [
|
|
45
|
+
"typescript",
|
|
46
|
+
"types",
|
|
47
|
+
"gems",
|
|
48
|
+
"essentials",
|
|
49
|
+
"utils",
|
|
50
|
+
"toolbox",
|
|
51
|
+
"toolbelt",
|
|
52
|
+
"lodash",
|
|
53
|
+
"underscore"
|
|
54
|
+
]
|
|
50
55
|
}
|