type-plus 3.13.0 → 3.13.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.
- package/lib/JSONTypes.js +9 -5
- package/lib/JSONTypes.js.map +1 -1
- package/lib/assertion/assertType.d.ts +0 -46
- package/lib/assertion/assertType.js +4 -4
- package/lib/assertion/assertType.js.map +1 -1
- package/lib/class/isConstructor.js +0 -1
- package/lib/class/isConstructor.js.map +1 -1
- package/lib/object/getField.js.map +1 -1
- package/lib/object/mapProperties.js +1 -1
- package/lib/object/mapProperties.js.map +1 -1
- package/lib/object/omit.js +1 -1
- package/lib/object/omit.js.map +1 -1
- package/lib/object/pick.js +1 -1
- package/lib/object/pick.js.map +1 -1
- package/lib/predicates/isType.d.ts +0 -10
- package/lib/predicates/isType.js +1 -1
- package/lib/predicates/isType.js.map +1 -1
- package/lib/types/Number.js +10 -6
- package/lib/types/Number.js.map +1 -1
- package/lib/types/Object.d.ts +4 -20
- package/lib/types/Object.js +1 -1
- package/lib/types/Object.js.map +1 -1
- package/lib/types/String.js +10 -6
- package/lib/types/String.js.map +1 -1
- package/lib/types/Tuple.js +10 -6
- package/lib/types/Tuple.js.map +1 -1
- package/lib/types/Union.js +9 -5
- package/lib/types/Union.js.map +1 -1
- package/lib/types/analyze.js +3 -2
- package/lib/types/analyze.js.map +1 -1
- package/lib/types/check.js +2 -2
- package/lib/types/check.js.map +1 -1
- package/lib/types/conform.js +2 -2
- package/lib/types/conform.js.map +1 -1
- package/lib/types/getPlainAnalysisReport.js +28 -24
- package/lib/types/getPlainAnalysisReport.js.map +1 -1
- package/lib/types/optional.d.ts +4 -20
- package/lib/types/required.d.ts +8 -40
- package/lib/types/satisfy.js +2 -2
- package/lib/types/satisfy.js.map +1 -1
- package/libm/class/isConstructor.js +0 -1
- package/libm/class/isConstructor.js.map +1 -1
- package/libm/object/getField.js.map +1 -1
- package/package.json +24 -26
- package/src/class/isConstructor.ts +1 -2
- package/src/object/getField.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "type-plus",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.1",
|
|
4
4
|
"description": "Provides additional types for `typescript`.",
|
|
5
5
|
"homepage": "https://github.com/unional/type-plus",
|
|
6
6
|
"bugs": {
|
|
@@ -52,44 +52,42 @@
|
|
|
52
52
|
"unpartial": "^0.6.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@babel/cli": "^7.
|
|
56
|
-
"@babel/core": "^7.
|
|
57
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
58
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.
|
|
59
|
-
"@babel/plugin-proposal-optional-chaining": "^7.
|
|
60
|
-
"@babel/preset-env": "^7.
|
|
61
|
-
"@babel/preset-typescript": "^7.
|
|
62
|
-
"@commitlint/cli": "^
|
|
63
|
-
"@commitlint/config-conventional": "^
|
|
64
|
-
"@size-limit/preset-small-lib": "^
|
|
65
|
-
"@types/jest": "^
|
|
55
|
+
"@babel/cli": "^7.16.0",
|
|
56
|
+
"@babel/core": "^7.16.0",
|
|
57
|
+
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
58
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
59
|
+
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
60
|
+
"@babel/preset-env": "^7.16.4",
|
|
61
|
+
"@babel/preset-typescript": "^7.16.0",
|
|
62
|
+
"@commitlint/cli": "^15.0.0",
|
|
63
|
+
"@commitlint/config-conventional": "^15.0.0",
|
|
64
|
+
"@size-limit/preset-small-lib": "^7.0.3",
|
|
65
|
+
"@types/jest": "^27.0.3",
|
|
66
66
|
"@unional/fixture": "^1.7.2",
|
|
67
67
|
"assertron": "^7.1.3",
|
|
68
|
-
"codecov": "^3.8.
|
|
69
|
-
"commitlint-circle": "^1.0.0",
|
|
68
|
+
"codecov": "^3.8.3",
|
|
70
69
|
"dependency-check": "^4.1.0",
|
|
71
70
|
"eslint": "^7.28.0",
|
|
72
|
-
"eslint-plugin-harmony": "^
|
|
73
|
-
"husky": "^
|
|
74
|
-
"is-ci": "^3.0.
|
|
75
|
-
"jest": "^27.
|
|
76
|
-
"jest-junit": "^
|
|
71
|
+
"eslint-plugin-harmony": "^6.0.0",
|
|
72
|
+
"husky": "^7.0.4",
|
|
73
|
+
"is-ci": "^3.0.1",
|
|
74
|
+
"jest": "^27.4.3",
|
|
75
|
+
"jest-junit": "^13.0.0",
|
|
77
76
|
"jest-progress-tracker": "^2.0.2",
|
|
78
|
-
"jest-validate": "^27.
|
|
77
|
+
"jest-validate": "^27.4.2",
|
|
79
78
|
"jest-watch-suspend": "^1.1.2",
|
|
80
79
|
"jest-watch-toggle-config": "^2.0.1",
|
|
81
|
-
"jest-watch-typeahead": "^0.
|
|
82
|
-
"npm-check-updates": "^
|
|
80
|
+
"jest-watch-typeahead": "^1.0.0",
|
|
81
|
+
"npm-check-updates": "^12.0.2",
|
|
83
82
|
"rimraf": "^3.0.2",
|
|
84
83
|
"satisfier": "^5.1.0",
|
|
85
|
-
"
|
|
86
|
-
"size-limit": "^4.11.0",
|
|
84
|
+
"size-limit": "^7.0.3",
|
|
87
85
|
"ts-toolbelt": "^9.6.0",
|
|
88
|
-
"typescript": "^4.
|
|
86
|
+
"typescript": "^4.5.2"
|
|
89
87
|
},
|
|
90
88
|
"size-limit": [
|
|
91
89
|
{
|
|
92
|
-
"limit": "
|
|
90
|
+
"limit": "15 kb"
|
|
93
91
|
}
|
|
94
92
|
]
|
|
95
93
|
}
|
|
@@ -4,8 +4,7 @@ export function isConstructor(subject: unknown): subject is AnyConstructor {
|
|
|
4
4
|
try {
|
|
5
5
|
new (subject as AnyConstructor)()
|
|
6
6
|
}
|
|
7
|
-
catch (err) {
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
7
|
+
catch (err: any) {
|
|
9
8
|
const msg = err?.message as string | undefined
|
|
10
9
|
if (msg && msg.indexOf('is not a constructor') >= 0) {
|
|
11
10
|
return false
|
package/src/object/getField.ts
CHANGED
|
@@ -17,5 +17,5 @@ export function getField<
|
|
|
17
17
|
K extends UnionKeys<TX>,
|
|
18
18
|
DV extends Exclude<TX[K], undefined>
|
|
19
19
|
>(subject: T, key: K, defaultValue?: DV) {
|
|
20
|
-
return subject && (subject as { [k in K]: TX[K] | DV })[key] || defaultValue
|
|
20
|
+
return subject && (subject as unknown as { [k in K]: TX[K] | DV })[key] || defaultValue
|
|
21
21
|
}
|