Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expect-type

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect-type - npm Package Compare versions

Comparing version 0.13.0 to 0.14.0-0

LICENSE

24

dist/index.d.ts

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc