expect-type
Advanced tools
Comparing version 0.13.0 to 0.14.0-0
@@ -20,10 +20,15 @@ export declare type Not<T extends boolean> = T extends true ? false : true; | ||
*/ | ||
export declare type DeepBrand<T> = Or<[IsNever<T>, IsAny<T>, IsUnknown<T>]> extends true ? { | ||
type: 'special'; | ||
never: IsNever<T>; | ||
any: IsAny<T>; | ||
unknown: IsUnknown<T>; | ||
} : T extends string | number | boolean | symbol | bigint | null | undefined ? { | ||
export declare type DeepBrand<T> = IsNever<T> extends true ? { | ||
type: 'never'; | ||
} : IsAny<T> extends true ? { | ||
type: 'any'; | ||
} : IsUnknown<T> extends true ? { | ||
type: 'unknown'; | ||
} : T extends string | number | boolean | symbol | bigint | null | undefined | void ? { | ||
type: 'primitive'; | ||
value: T; | ||
} : T extends new (...args: any[]) => any ? { | ||
type: 'constructor'; | ||
params: ConstructorParams<T>; | ||
instance: DeepBrand<InstanceType<Extract<T, new (...args: any) => any>>>; | ||
} : T extends (...args: infer P) => infer R ? { | ||
@@ -33,3 +38,7 @@ type: 'function'; | ||
return: DeepBrand<R>; | ||
constructorParams: DeepBrand<ConstructorParams<T>>; | ||
} : T extends any[] ? { | ||
type: 'array'; | ||
items: { | ||
[K in keyof T]: T[K]; | ||
}; | ||
} : { | ||
@@ -130,2 +139,1 @@ type: 'object'; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -28,3 +28,3 @@ "use strict"; | ||
*/ | ||
const expectTypeOf = (actual) => { | ||
const expectTypeOf = (_actual) => { | ||
const nonFunctionProperties = [ | ||
@@ -42,2 +42,3 @@ 'parameters', | ||
const obj = { | ||
/* eslint-disable mmkal/@typescript-eslint/no-unsafe-assignment */ | ||
toBeAny: fn, | ||
@@ -61,2 +62,3 @@ toBeUnknown: fn, | ||
toBeConstructibleWith: fn, | ||
/* eslint-enable mmkal/@typescript-eslint/no-unsafe-assignment */ | ||
extract: exports.expectTypeOf, | ||
@@ -68,6 +70,5 @@ exclude: exports.expectTypeOf, | ||
const getterProperties = nonFunctionProperties; | ||
getterProperties.forEach((prop) => Object.defineProperty(obj, prop, { get: () => exports.expectTypeOf({}) })); | ||
getterProperties.forEach((prop) => Object.defineProperty(obj, prop, { get: () => (0, exports.expectTypeOf)({}) })); | ||
return obj; | ||
}; | ||
exports.expectTypeOf = expectTypeOf; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "expect-type", | ||
"version": "0.13.0", | ||
"keywords": [ | ||
"typescript", | ||
"type-check", | ||
"assert", | ||
"types", | ||
"typings", | ||
"test", | ||
"testing" | ||
], | ||
"homepage": "https://github.com/mmkal/ts/tree/main/packages/expect-type#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mmkal/ts.git", | ||
"directory": "packages/expect-type" | ||
}, | ||
"license": "Apache-2.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"prebuild": "npm run clean", | ||
"build": "rig tsc -p .", | ||
"clean": "rig rimraf dist", | ||
"lint": "rig eslint --cache .", | ||
"prepack": "rig permalink", | ||
"postpack": "rig unpermalink", | ||
"test": "rig jest" | ||
}, | ||
"devDependencies": { | ||
"@mmkal/rig": "0.0.1" | ||
} | ||
"name": "expect-type", | ||
"version": "0.14.0-0", | ||
"keywords": [ | ||
"typescript", | ||
"type-check", | ||
"assert", | ||
"types", | ||
"typings", | ||
"test", | ||
"testing" | ||
], | ||
"homepage": "https://github.com/mmkal/ts/tree/main/packages/expect-type#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mmkal/expect-type.git" | ||
}, | ||
"license": "Apache-2.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"*.md" | ||
], | ||
"scripts": { | ||
"eslint": "eslint", | ||
"lint": "tsc && eslint .", | ||
"build": "tsc -p tsconfig.lib.json", | ||
"test": "tsc" | ||
}, | ||
"devDependencies": { | ||
"eslint": "8.23.0", | ||
"eslint-plugin-mmkal": "0.0.1-2", | ||
"typescript": "4.8.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35112
3
5
206
440
1