generic-type-guard
Advanced tools
Comparing version 4.1.0 to 5.0.0
# generic-type-guard | ||
## 5.0.0 | ||
### Major Changes | ||
- 3a6a071: Updated license to MPL-2.0 from MIT | ||
## 4.1.0 | ||
@@ -4,0 +10,0 @@ |
@@ -0,1 +1,6 @@ | ||
/** | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
export * from './guards.js'; | ||
@@ -2,0 +7,0 @@ export * from './primitives.js'; |
@@ -41,3 +41,3 @@ ## API Report File for "generic-type-guard" | ||
// @public | ||
export const hasOptionalProperty: <K extends string, V>(property: K, value: TypeGuard<V>) => PartialTypeGuard<object, { [prop in K]?: V | undefined; }>; | ||
export const hasOptionalProperty: <K extends string, V>(property: K, value: TypeGuard<V>) => PartialTypeGuard<object, { [prop in K]?: V; }>; | ||
@@ -172,3 +172,3 @@ // @public | ||
// @public | ||
export const isSet: <T = unknown>(obj: T) => obj is Diff<T, null | undefined>; | ||
export const isSet: <T = unknown>(obj: T) => obj is Diff<T, undefined | null>; | ||
@@ -175,0 +175,0 @@ // @public |
@@ -83,3 +83,3 @@ /** | ||
*/ | ||
export declare const hasOptionalProperty: <K extends string, V>(property: K, value: TypeGuard<V>) => PartialTypeGuard<object, { [prop in K]?: V | undefined; }>; | ||
export declare const hasOptionalProperty: <K extends string, V>(property: K, value: TypeGuard<V>) => PartialTypeGuard<object, { [prop in K]?: V; }>; | ||
@@ -400,3 +400,3 @@ /** | ||
*/ | ||
export declare const isSet: <T = unknown>(obj: T) => obj is Diff<T, null | undefined>; | ||
export declare const isSet: <T = unknown>(obj: T) => obj is Diff<T, undefined | null>; | ||
@@ -507,2 +507,7 @@ /** | ||
/** | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
/** | ||
* A partial type guard that can take a value of one type and determine if it is also a valid value of a subtype. | ||
@@ -509,0 +514,0 @@ * |
@@ -7,5 +7,3 @@ // dist/utils.js | ||
} || function(d2, b2) { | ||
for (var p in b2) | ||
if (Object.prototype.hasOwnProperty.call(b2, p)) | ||
d2[p] = b2[p]; | ||
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p]; | ||
}; | ||
@@ -26,12 +24,9 @@ return extendStatics(d, b); | ||
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; | ||
if (m) | ||
return m.call(o); | ||
if (o && typeof o.length === "number") | ||
return { | ||
next: function() { | ||
if (o && i >= o.length) | ||
o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
if (m) return m.call(o); | ||
if (o && typeof o.length === "number") return { | ||
next: function() { | ||
if (o && i >= o.length) o = void 0; | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
@@ -75,7 +70,5 @@ }; | ||
try { | ||
if (guards_1_1 && !guards_1_1.done && (_a = guards_1.return)) | ||
_a.call(guards_1); | ||
if (guards_1_1 && !guards_1_1.done && (_a = guards_1.return)) _a.call(guards_1); | ||
} finally { | ||
if (e_1) | ||
throw e_1.error; | ||
if (e_1) throw e_1.error; | ||
} | ||
@@ -90,8 +83,6 @@ } | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) | ||
return o; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) | ||
ar.push(r.value); | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} catch (error) { | ||
@@ -101,7 +92,5 @@ e = { error }; | ||
try { | ||
if (r && !r.done && (m = i["return"])) | ||
m.call(i); | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} finally { | ||
if (e) | ||
throw e.error; | ||
if (e) throw e.error; | ||
} | ||
@@ -112,10 +101,8 @@ } | ||
var __spreadArray = function(to, from, pack) { | ||
if (pack || arguments.length === 2) | ||
for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) | ||
ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
@@ -122,0 +109,0 @@ }; |
{ | ||
"name": "generic-type-guard", | ||
"version": "4.1.0", | ||
"version": "5.0.0", | ||
"type": "module", | ||
@@ -37,5 +37,5 @@ "publishConfig": { | ||
"test-watch": "nodemon -e ts,json --exec npm run test", | ||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx", | ||
"lint-fix": "eslint . --fix --ext .js,.jsx,.ts,.tsx", | ||
"lint-watch": "nodemon -e ts,json --exec eslint . --ext .js,.jsx,.ts,.tsx", | ||
"lint": "eslint", | ||
"lint-fix": "eslint", | ||
"lint-watch": "nodemon -e ts,json --exec eslint", | ||
"mocha": "c8 mocha 'src/**/*.spec.ts'", | ||
@@ -83,3 +83,3 @@ "mocha-watch": "nodemon -e ts,json --exec npm run mocha 'src/**/*.spec.ts'", | ||
"author": "Matthew Scharley", | ||
"license": "MIT", | ||
"license": "MPL-2.0", | ||
"bugs": { | ||
@@ -94,23 +94,25 @@ "url": "https://github.com/mscharley/generic-type-guard/issues" | ||
"devDependencies": { | ||
"@changesets/cli": "2.27.1", | ||
"@microsoft/api-extractor": "7.43.1", | ||
"@mscharley/eslint-config": "3.1.2", | ||
"@mscharley/prettier-config": "3.0.5", | ||
"@stryker-mutator/core": "8.2.6", | ||
"@stryker-mutator/mocha-runner": "8.2.6", | ||
"@stryker-mutator/typescript-checker": "8.2.6", | ||
"@types/chai": "4.3.14", | ||
"@types/mocha": "10.0.6", | ||
"@types/node": "20.12.7", | ||
"c8": "^9.1.0", | ||
"chai": "5.1.0", | ||
"esbuild": "^0.20.2", | ||
"mocha": "10.4.0", | ||
"nodemon": "3.1.0", | ||
"rimraf": "5.0.5", | ||
"@changesets/cli": "2.27.9", | ||
"@microsoft/api-extractor": "7.47.9", | ||
"@mscharley/eslint-config": "4.0.3", | ||
"@mscharley/prettier-config": "3.0.6", | ||
"@stryker-mutator/core": "8.6.0", | ||
"@stryker-mutator/mocha-runner": "8.6.0", | ||
"@stryker-mutator/typescript-checker": "8.6.0", | ||
"@types/chai": "5.0.0", | ||
"@types/mocha": "10.0.8", | ||
"@types/node": "20.16.10", | ||
"c8": "10.1.2", | ||
"chai": "5.1.1", | ||
"esbuild": "0.24.0", | ||
"eslint-plugin-notice": "^1.0.0", | ||
"mocha": "10.7.3", | ||
"nodemon": "3.1.7", | ||
"rimraf": "6.0.1", | ||
"source-map-support": "0.5.21", | ||
"testdouble": "3.20.2", | ||
"ts-node": "10.9.2", | ||
"typescript": "5.4.5" | ||
} | ||
"typescript": "5.6.2" | ||
}, | ||
"packageManager": "npm@10.9.0+sha512.65a9c38a8172948f617a53619762cd77e12b9950fe1f9239debcb8d62c652f2081824b986fee7c0af6c0a7df615becebe4bf56e17ec27214a87aa29d9e038b4b" | ||
} |
# generic-type-guard | ||
[![npm](https://img.shields.io/npm/v/generic-type-guard.svg)](https://www.npmjs.com/package/generic-type-guard) | ||
[![CircleCI](https://img.shields.io/circleci/project/github/mscharley/generic-type-guard.svg)](https://circleci.com/gh/mscharley/generic-type-guard) | ||
**Source:** [https://github.com/mscharley/generic-type-guard](https://github.com/mscharley/generic-type-guard) | ||
**Author:** Matthew Scharley | ||
**Contributors:** [See contributors on GitHub][gh-contrib] | ||
**Bugs/Support:** [Github Issues][gh-issues] | ||
**Copyright:** 2022 | ||
**License:** [MIT license][license] | ||
**Status:** Active | ||
## Synopsis | ||
@@ -15,0 +6,0 @@ |
@@ -41,3 +41,3 @@ ## API Report File for "generic-type-guard" | ||
// @public | ||
export const hasOptionalProperty: <K extends string, V>(property: K, value: TypeGuard<V>) => PartialTypeGuard<object, { [prop in K]?: V | undefined; }>; | ||
export const hasOptionalProperty: <K extends string, V>(property: K, value: TypeGuard<V>) => PartialTypeGuard<object, { [prop in K]?: V; }>; | ||
@@ -172,3 +172,3 @@ // @public | ||
// @public | ||
export const isSet: <T = unknown>(obj: T) => obj is Diff<T, null | undefined>; | ||
export const isSet: <T = unknown>(obj: T) => obj is Diff<T, undefined | null>; | ||
@@ -175,0 +175,0 @@ // @public |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
191376
2036
0
21
2
70
128