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.
Files changed (46) hide show
  1. package/lib/JSONTypes.js +9 -5
  2. package/lib/JSONTypes.js.map +1 -1
  3. package/lib/assertion/assertType.d.ts +0 -46
  4. package/lib/assertion/assertType.js +4 -4
  5. package/lib/assertion/assertType.js.map +1 -1
  6. package/lib/class/isConstructor.js +0 -1
  7. package/lib/class/isConstructor.js.map +1 -1
  8. package/lib/object/getField.js.map +1 -1
  9. package/lib/object/mapProperties.js +1 -1
  10. package/lib/object/mapProperties.js.map +1 -1
  11. package/lib/object/omit.js +1 -1
  12. package/lib/object/omit.js.map +1 -1
  13. package/lib/object/pick.js +1 -1
  14. package/lib/object/pick.js.map +1 -1
  15. package/lib/predicates/isType.d.ts +0 -10
  16. package/lib/predicates/isType.js +1 -1
  17. package/lib/predicates/isType.js.map +1 -1
  18. package/lib/types/Number.js +10 -6
  19. package/lib/types/Number.js.map +1 -1
  20. package/lib/types/Object.d.ts +4 -20
  21. package/lib/types/Object.js +1 -1
  22. package/lib/types/Object.js.map +1 -1
  23. package/lib/types/String.js +10 -6
  24. package/lib/types/String.js.map +1 -1
  25. package/lib/types/Tuple.js +10 -6
  26. package/lib/types/Tuple.js.map +1 -1
  27. package/lib/types/Union.js +9 -5
  28. package/lib/types/Union.js.map +1 -1
  29. package/lib/types/analyze.js +3 -2
  30. package/lib/types/analyze.js.map +1 -1
  31. package/lib/types/check.js +2 -2
  32. package/lib/types/check.js.map +1 -1
  33. package/lib/types/conform.js +2 -2
  34. package/lib/types/conform.js.map +1 -1
  35. package/lib/types/getPlainAnalysisReport.js +28 -24
  36. package/lib/types/getPlainAnalysisReport.js.map +1 -1
  37. package/lib/types/optional.d.ts +4 -20
  38. package/lib/types/required.d.ts +8 -40
  39. package/lib/types/satisfy.js +2 -2
  40. package/lib/types/satisfy.js.map +1 -1
  41. package/libm/class/isConstructor.js +0 -1
  42. package/libm/class/isConstructor.js.map +1 -1
  43. package/libm/object/getField.js.map +1 -1
  44. package/package.json +24 -26
  45. package/src/class/isConstructor.ts +1 -2
  46. 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.0",
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.14.3",
56
- "@babel/core": "^7.14.3",
57
- "@babel/plugin-proposal-class-properties": "^7.13.0",
58
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2",
59
- "@babel/plugin-proposal-optional-chaining": "^7.14.2",
60
- "@babel/preset-env": "^7.14.4",
61
- "@babel/preset-typescript": "^7.13.0",
62
- "@commitlint/cli": "^12.1.4",
63
- "@commitlint/config-conventional": "^12.1.4",
64
- "@size-limit/preset-small-lib": "^4.11.0",
65
- "@types/jest": "^26.0.23",
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.2",
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": "^5.1.0",
73
- "husky": "^6.0.0",
74
- "is-ci": "^3.0.0",
75
- "jest": "^27.0.4",
76
- "jest-junit": "^12.1.0",
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.0.2",
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.6.4",
82
- "npm-check-updates": "^11.6.0",
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
- "semantic-release": "^17.4.3",
86
- "size-limit": "^4.11.0",
84
+ "size-limit": "^7.0.3",
87
85
  "ts-toolbelt": "^9.6.0",
88
- "typescript": "^4.3.2"
86
+ "typescript": "^4.5.2"
89
87
  },
90
88
  "size-limit": [
91
89
  {
92
- "limit": "10 kb"
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
@@ -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
  }