Initial project import
This commit is contained in:
1
node_modules/utility-types/CHANGELOG.md
generated
vendored
Normal file
1
node_modules/utility-types/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
All changelogs can be found in [Releases](https://github.com/piotrwitek/utility-types/releases)
|
||||
21
node_modules/utility-types/LICENSE
generated
vendored
Normal file
21
node_modules/utility-types/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Piotr Witek <piotrek.witek@gmail.com> (http://piotrwitek.github.io)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
1161
node_modules/utility-types/README.md
generated
vendored
Normal file
1161
node_modules/utility-types/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18
node_modules/utility-types/SECURITY.md
generated
vendored
Normal file
18
node_modules/utility-types/SECURITY.md
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Check below to find which versions are currently being supported with security updates.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 3.x | :white_check_mark: |
|
||||
| < 3.0 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
You can report a security vulnerability to this email: piotrek.witek@gmail.com
|
||||
|
||||
You'll get a response back to your email shortly after we read your report.
|
||||
After analysis of vulnerability is completed we will send you the results and
|
||||
keep you updated about the next steps.
|
||||
12
node_modules/utility-types/SUPPORT.md
generated
vendored
Normal file
12
node_modules/utility-types/SUPPORT.md
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# Support
|
||||
|
||||
## Community
|
||||
|
||||
If you're looking for support the best place is to check our spectrum community chat:
|
||||
- https://spectrum.chat/utility-types
|
||||
|
||||
## Project Updates
|
||||
|
||||
You can also subscribe to receive project updates on my Twitter and BuyMeACoffee profile:
|
||||
- https://twitter.com/piotrekwitek
|
||||
- https://www.buymeacoffee.com/piotrekwitek
|
||||
76
node_modules/utility-types/dist/aliases-and-guards.d.ts
generated
vendored
Normal file
76
node_modules/utility-types/dist/aliases-and-guards.d.ts
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* Primitive
|
||||
* @desc Type representing [`Primitive`](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) types in TypeScript: `string | number | bigint | boolean | symbol | null | undefined`
|
||||
* @example
|
||||
* type Various = number | string | object;
|
||||
*
|
||||
* // Expect: object
|
||||
* type Cleaned = Exclude<Various, Primitive>
|
||||
*/
|
||||
export declare type Primitive = string | number | bigint | boolean | symbol | null | undefined;
|
||||
/**
|
||||
* Falsy
|
||||
* @desc Type representing falsy values in TypeScript: `false | "" | 0 | null | undefined`
|
||||
* @example
|
||||
* type Various = 'a' | 'b' | undefined | false;
|
||||
*
|
||||
* // Expect: "a" | "b"
|
||||
* Exclude<Various, Falsy>;
|
||||
*/
|
||||
export declare type Falsy = false | '' | 0 | null | undefined;
|
||||
/**
|
||||
* Nullish
|
||||
* @desc Type representing [nullish values][https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#nullish-coalescing] in TypeScript: `null | undefined`
|
||||
* @example
|
||||
* type Various = 'a' | 'b' | undefined;
|
||||
*
|
||||
* // Expect: "a" | "b"
|
||||
* Exclude<Various, Nullish>;
|
||||
*/
|
||||
export declare type Nullish = null | undefined;
|
||||
/**
|
||||
* Tests for one of the [`Primitive`](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) types using the JavaScript [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) operator
|
||||
*
|
||||
* Clarification: TypeScript overloads this operator to produce TypeScript types if used in context of types.
|
||||
*
|
||||
* @param val The value to be tested
|
||||
* @returns If `val` is primitive. If used in the flow of the program typescript will infer type-information from this.
|
||||
*
|
||||
* @example
|
||||
* const consumer = (value: Primitive | Primitive[]) => {
|
||||
* if (isPrimitive(value)) {
|
||||
* return console.log('Primitive value: ', value);
|
||||
* }
|
||||
* // type of value now inferred as Primitive[]
|
||||
* value.map((primitive) => consumer(primitive));
|
||||
* };
|
||||
*/
|
||||
export declare const isPrimitive: (val: unknown) => val is Primitive;
|
||||
/**
|
||||
* Tests for Falsy by simply applying negation `!` to the tested `val`.
|
||||
*
|
||||
* The value is mostly in added type-information and explicity,
|
||||
* but in case of this simple type much the same can often be archived by just using negation `!`:
|
||||
* @example
|
||||
* const consumer = (value: boolean | Falsy) => {
|
||||
* if (!value) {
|
||||
* return ;
|
||||
* }
|
||||
* type newType = typeof value; // === true
|
||||
* // do stuff
|
||||
* };
|
||||
*/
|
||||
export declare const isFalsy: (val: unknown) => val is Falsy;
|
||||
/**
|
||||
* Tests for Nullish by simply comparing `val` for equality with `null`.
|
||||
* @example
|
||||
* const consumer = (param: Nullish | string): string => {
|
||||
* if (isNullish(param)) {
|
||||
* // typeof param === Nullish
|
||||
* return String(param) + ' was Nullish';
|
||||
* }
|
||||
* // typeof param === string
|
||||
* return param.toString();
|
||||
* };
|
||||
*/
|
||||
export declare const isNullish: (val: unknown) => val is null | undefined;
|
||||
64
node_modules/utility-types/dist/aliases-and-guards.js
generated
vendored
Normal file
64
node_modules/utility-types/dist/aliases-and-guards.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/**
|
||||
* Tests for one of the [`Primitive`](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) types using the JavaScript [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) operator
|
||||
*
|
||||
* Clarification: TypeScript overloads this operator to produce TypeScript types if used in context of types.
|
||||
*
|
||||
* @param val The value to be tested
|
||||
* @returns If `val` is primitive. If used in the flow of the program typescript will infer type-information from this.
|
||||
*
|
||||
* @example
|
||||
* const consumer = (value: Primitive | Primitive[]) => {
|
||||
* if (isPrimitive(value)) {
|
||||
* return console.log('Primitive value: ', value);
|
||||
* }
|
||||
* // type of value now inferred as Primitive[]
|
||||
* value.map((primitive) => consumer(primitive));
|
||||
* };
|
||||
*/
|
||||
exports.isPrimitive = function (val) {
|
||||
if (val === null || val === undefined) {
|
||||
return true;
|
||||
}
|
||||
switch (typeof val) {
|
||||
case 'string':
|
||||
case 'number':
|
||||
case 'bigint':
|
||||
case 'boolean':
|
||||
case 'symbol': {
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Tests for Falsy by simply applying negation `!` to the tested `val`.
|
||||
*
|
||||
* The value is mostly in added type-information and explicity,
|
||||
* but in case of this simple type much the same can often be archived by just using negation `!`:
|
||||
* @example
|
||||
* const consumer = (value: boolean | Falsy) => {
|
||||
* if (!value) {
|
||||
* return ;
|
||||
* }
|
||||
* type newType = typeof value; // === true
|
||||
* // do stuff
|
||||
* };
|
||||
*/
|
||||
exports.isFalsy = function (val) { return !val; };
|
||||
/**
|
||||
* Tests for Nullish by simply comparing `val` for equality with `null`.
|
||||
* @example
|
||||
* const consumer = (param: Nullish | string): string => {
|
||||
* if (isNullish(param)) {
|
||||
* // typeof param === Nullish
|
||||
* return String(param) + ' was Nullish';
|
||||
* }
|
||||
* // typeof param === string
|
||||
* return param.toString();
|
||||
* };
|
||||
*/
|
||||
exports.isNullish = function (val) { return val == null; };
|
||||
//# sourceMappingURL=aliases-and-guards.js.map
|
||||
1
node_modules/utility-types/dist/aliases-and-guards.js.map
generated
vendored
Normal file
1
node_modules/utility-types/dist/aliases-and-guards.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"aliases-and-guards.js","sourceRoot":"","sources":["../src/aliases-and-guards.ts"],"names":[],"mappings":";;AAwCA;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,WAAW,GAAG,UAAC,GAAY;IACtC,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;QACrC,OAAO,IAAI,CAAC;KACb;IACD,QAAQ,OAAO,GAAG,EAAE;QAClB,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ,CAAC,CAAC;YACb,OAAO,IAAI,CAAC;SACb;QACD;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACU,QAAA,OAAO,GAAG,UAAC,GAAY,IAAmB,OAAA,CAAC,GAAG,EAAJ,CAAI,CAAC;AAE5D;;;;;;;;;;;GAWG;AACU,QAAA,SAAS,GAAG,UAAC,GAAY,IAAqB,OAAA,GAAG,IAAI,IAAI,EAAX,CAAW,CAAC"}
|
||||
9
node_modules/utility-types/dist/functional-helpers.d.ts
generated
vendored
Normal file
9
node_modules/utility-types/dist/functional-helpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @function getReturnOfExpression
|
||||
* @deprecated from TS v2.8 use built-in ReturnType<T> or $Call API
|
||||
* @description infer the return type from a given "expression" (at runtime it's equivalent of "noop")
|
||||
* @template RT - ReturnType
|
||||
* @param expression: (...params: any[]) => RT
|
||||
* @returns undefined as RT
|
||||
*/
|
||||
export declare function getReturnOfExpression<RT>(expression: (...params: any[]) => RT): RT;
|
||||
16
node_modules/utility-types/dist/functional-helpers.js
generated
vendored
Normal file
16
node_modules/utility-types/dist/functional-helpers.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
// Copyright (c) 2016 Piotr Witek <piotrek.witek@gmail.com> (http://piotrwitek.github.io)
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/**
|
||||
* @function getReturnOfExpression
|
||||
* @deprecated from TS v2.8 use built-in ReturnType<T> or $Call API
|
||||
* @description infer the return type from a given "expression" (at runtime it's equivalent of "noop")
|
||||
* @template RT - ReturnType
|
||||
* @param expression: (...params: any[]) => RT
|
||||
* @returns undefined as RT
|
||||
*/
|
||||
function getReturnOfExpression(expression) {
|
||||
return undefined;
|
||||
}
|
||||
exports.getReturnOfExpression = getReturnOfExpression;
|
||||
//# sourceMappingURL=functional-helpers.js.map
|
||||
1
node_modules/utility-types/dist/functional-helpers.js.map
generated
vendored
Normal file
1
node_modules/utility-types/dist/functional-helpers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"functional-helpers.js","sourceRoot":"","sources":["../src/functional-helpers.ts"],"names":[],"mappings":";AAAA,yFAAyF;;AAEzF;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,UAAoC;IAEpC,OAAQ,SAAuB,CAAC;AAClC,CAAC;AAJD,sDAIC"}
|
||||
10
node_modules/utility-types/dist/index.d.ts
generated
vendored
Normal file
10
node_modules/utility-types/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @author Piotr Witek <piotrek.witek@gmail.com> (http://piotrwitek.github.io)
|
||||
* @copyright Copyright (c) 2016 Piotr Witek
|
||||
* @license MIT
|
||||
*/
|
||||
export { $Call, $Diff, $ElementType, $Keys, $NonMaybeType, $PropertyType, $ReadOnly, $Shape, $Values, Class, } from './utility-types';
|
||||
export { Assign, Brand, DeepNonNullable, DeepPartial, DeepReadonly, DeepRequired, Diff, FunctionKeys, Intersection, Mutable, MutableKeys, NonFunctionKeys, NonUndefined, Omit, OmitByValue, OmitByValueExact, OptionalKeys, Overwrite, Optional, PickByValue, PickByValueExact, PromiseType, ReadonlyKeys, AugmentedRequired as Required, RequiredKeys, SetComplement, SetDifference, SetIntersection, Subtract, SymmetricDifference, Unionize, UnionToIntersection, ValuesType, Writable, WritableKeys, } from './mapped-types';
|
||||
export { Falsy, Falsy as Falsey, // deprecated in v3, backward compatibility until v4
|
||||
isFalsy, Nullish, isNullish, Primitive, isPrimitive, } from './aliases-and-guards';
|
||||
export { getReturnOfExpression } from './functional-helpers';
|
||||
15
node_modules/utility-types/dist/index.js
generated
vendored
Normal file
15
node_modules/utility-types/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
/**
|
||||
* @author Piotr Witek <piotrek.witek@gmail.com> (http://piotrwitek.github.io)
|
||||
* @copyright Copyright (c) 2016 Piotr Witek
|
||||
* @license MIT
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var aliases_and_guards_1 = require("./aliases-and-guards");
|
||||
exports.isFalsy = aliases_and_guards_1.isFalsy;
|
||||
exports.isNullish = aliases_and_guards_1.isNullish;
|
||||
exports.isPrimitive = aliases_and_guards_1.isPrimitive;
|
||||
// deprecated
|
||||
var functional_helpers_1 = require("./functional-helpers");
|
||||
exports.getReturnOfExpression = functional_helpers_1.getReturnOfExpression;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/utility-types/dist/index.js.map
generated
vendored
Normal file
1
node_modules/utility-types/dist/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAqDH,2DAQ8B;AAL5B,uCAAA,OAAO,CAAA;AAEP,yCAAA,SAAS,CAAA;AAET,2CAAA,WAAW,CAAA;AAGb,aAAa;AACb,2DAA6D;AAApD,qDAAA,qBAAqB,CAAA"}
|
||||
525
node_modules/utility-types/dist/mapped-types.d.ts
generated
vendored
Normal file
525
node_modules/utility-types/dist/mapped-types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,525 @@
|
||||
import { Primitive } from './aliases-and-guards';
|
||||
/**
|
||||
* Credits to all the people who given inspiration and shared some very useful code snippets
|
||||
* in the following github issue: https://github.com/Microsoft/TypeScript/issues/12215
|
||||
*/
|
||||
/**
|
||||
* SetIntersection (same as Extract)
|
||||
* @desc Set intersection of given union types `A` and `B`
|
||||
* @example
|
||||
* // Expect: "2" | "3"
|
||||
* SetIntersection<'1' | '2' | '3', '2' | '3' | '4'>;
|
||||
*
|
||||
* // Expect: () => void
|
||||
* SetIntersection<string | number | (() => void), Function>;
|
||||
*/
|
||||
export declare type SetIntersection<A, B> = A extends B ? A : never;
|
||||
/**
|
||||
* SetDifference (same as Exclude)
|
||||
* @desc Set difference of given union types `A` and `B`
|
||||
* @example
|
||||
* // Expect: "1"
|
||||
* SetDifference<'1' | '2' | '3', '2' | '3' | '4'>;
|
||||
*
|
||||
* // Expect: string | number
|
||||
* SetDifference<string | number | (() => void), Function>;
|
||||
*/
|
||||
export declare type SetDifference<A, B> = A extends B ? never : A;
|
||||
/**
|
||||
* SetComplement
|
||||
* @desc Set complement of given union types `A` and (it's subset) `A1`
|
||||
* @example
|
||||
* // Expect: "1"
|
||||
* SetComplement<'1' | '2' | '3', '2' | '3'>;
|
||||
*/
|
||||
export declare type SetComplement<A, A1 extends A> = SetDifference<A, A1>;
|
||||
/**
|
||||
* SymmetricDifference
|
||||
* @desc Set difference of union and intersection of given union types `A` and `B`
|
||||
* @example
|
||||
* // Expect: "1" | "4"
|
||||
* SymmetricDifference<'1' | '2' | '3', '2' | '3' | '4'>;
|
||||
*/
|
||||
export declare type SymmetricDifference<A, B> = SetDifference<A | B, A & B>;
|
||||
/**
|
||||
* NonUndefined
|
||||
* @desc Exclude undefined from set `A`
|
||||
* @example
|
||||
* // Expect: "string | null"
|
||||
* SymmetricDifference<string | null | undefined>;
|
||||
*/
|
||||
export declare type NonUndefined<A> = A extends undefined ? never : A;
|
||||
/**
|
||||
* NonNullable
|
||||
* @desc Exclude undefined and null from set `A`
|
||||
* @example
|
||||
* // Expect: "string"
|
||||
* SymmetricDifference<string | null | undefined>;
|
||||
*/
|
||||
/**
|
||||
* FunctionKeys
|
||||
* @desc Get union type of keys that are functions in object type `T`
|
||||
* @example
|
||||
* type MixedProps = {name: string; setName: (name: string) => void; someKeys?: string; someFn?: (...args: any) => any;};
|
||||
*
|
||||
* // Expect: "setName | someFn"
|
||||
* type Keys = FunctionKeys<MixedProps>;
|
||||
*/
|
||||
export declare type FunctionKeys<T extends object> = {
|
||||
[K in keyof T]-?: NonUndefined<T[K]> extends Function ? K : never;
|
||||
}[keyof T];
|
||||
/**
|
||||
* NonFunctionKeys
|
||||
* @desc Get union type of keys that are non-functions in object type `T`
|
||||
* @example
|
||||
* type MixedProps = {name: string; setName: (name: string) => void; someKeys?: string; someFn?: (...args: any) => any;};
|
||||
*
|
||||
* // Expect: "name | someKey"
|
||||
* type Keys = NonFunctionKeys<MixedProps>;
|
||||
*/
|
||||
export declare type NonFunctionKeys<T extends object> = {
|
||||
[K in keyof T]-?: NonUndefined<T[K]> extends Function ? never : K;
|
||||
}[keyof T];
|
||||
/**
|
||||
* MutableKeys
|
||||
* @desc Get union type of keys that are mutable in object type `T`
|
||||
* Credit: Matt McCutchen
|
||||
* https://stackoverflow.com/questions/52443276/how-to-exclude-getter-only-properties-from-type-in-typescript
|
||||
* @example
|
||||
* type Props = { readonly foo: string; bar: number };
|
||||
*
|
||||
* // Expect: "bar"
|
||||
* type Keys = MutableKeys<Props>;
|
||||
*/
|
||||
export declare type MutableKeys<T extends object> = {
|
||||
[P in keyof T]-?: IfEquals<{
|
||||
[Q in P]: T[P];
|
||||
}, {
|
||||
-readonly [Q in P]: T[P];
|
||||
}, P>;
|
||||
}[keyof T];
|
||||
export declare type WritableKeys<T extends object> = MutableKeys<T>;
|
||||
/**
|
||||
* ReadonlyKeys
|
||||
* @desc Get union type of keys that are readonly in object type `T`
|
||||
* Credit: Matt McCutchen
|
||||
* https://stackoverflow.com/questions/52443276/how-to-exclude-getter-only-properties-from-type-in-typescript
|
||||
* @example
|
||||
* type Props = { readonly foo: string; bar: number };
|
||||
*
|
||||
* // Expect: "foo"
|
||||
* type Keys = ReadonlyKeys<Props>;
|
||||
*/
|
||||
export declare type ReadonlyKeys<T extends object> = {
|
||||
[P in keyof T]-?: IfEquals<{
|
||||
[Q in P]: T[P];
|
||||
}, {
|
||||
-readonly [Q in P]: T[P];
|
||||
}, never, P>;
|
||||
}[keyof T];
|
||||
declare type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B;
|
||||
/**
|
||||
* RequiredKeys
|
||||
* @desc Get union type of keys that are required in object type `T`
|
||||
* @see https://stackoverflow.com/questions/52984808/is-there-a-way-to-get-all-required-properties-of-a-typescript-object
|
||||
* @example
|
||||
* type Props = { req: number; reqUndef: number | undefined; opt?: string; optUndef?: number | undefined; };
|
||||
*
|
||||
* // Expect: "req" | "reqUndef"
|
||||
* type Keys = RequiredKeys<Props>;
|
||||
*/
|
||||
export declare type RequiredKeys<T> = {
|
||||
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
|
||||
}[keyof T];
|
||||
/**
|
||||
* OptionalKeys
|
||||
* @desc Get union type of keys that are optional in object type `T`
|
||||
* @see https://stackoverflow.com/questions/52984808/is-there-a-way-to-get-all-required-properties-of-a-typescript-object
|
||||
* @example
|
||||
* type Props = { req: number; reqUndef: number | undefined; opt?: string; optUndef?: number | undefined; };
|
||||
*
|
||||
* // Expect: "opt" | "optUndef"
|
||||
* type Keys = OptionalKeys<Props>;
|
||||
*/
|
||||
export declare type OptionalKeys<T> = {
|
||||
[K in keyof T]-?: {} extends Pick<T, K> ? K : never;
|
||||
}[keyof T];
|
||||
/**
|
||||
* PickByValue
|
||||
* @desc From `T` pick a set of properties by value matching `ValueType`.
|
||||
* Credit: [Piotr Lewandowski](https://medium.com/dailyjs/typescript-create-a-condition-based-subset-types-9d902cea5b8c)
|
||||
* @example
|
||||
* type Props = { req: number; reqUndef: number | undefined; opt?: string; };
|
||||
*
|
||||
* // Expect: { req: number }
|
||||
* type Props = PickByValue<Props, number>;
|
||||
* // Expect: { req: number; reqUndef: number | undefined; }
|
||||
* type Props = PickByValue<Props, number | undefined>;
|
||||
*/
|
||||
export declare type PickByValue<T, ValueType> = Pick<T, {
|
||||
[Key in keyof T]-?: T[Key] extends ValueType ? Key : never;
|
||||
}[keyof T]>;
|
||||
/**
|
||||
* PickByValueExact
|
||||
* @desc From `T` pick a set of properties by value matching exact `ValueType`.
|
||||
* @example
|
||||
* type Props = { req: number; reqUndef: number | undefined; opt?: string; };
|
||||
*
|
||||
* // Expect: { req: number }
|
||||
* type Props = PickByValueExact<Props, number>;
|
||||
* // Expect: { reqUndef: number | undefined; }
|
||||
* type Props = PickByValueExact<Props, number | undefined>;
|
||||
*/
|
||||
export declare type PickByValueExact<T, ValueType> = Pick<T, {
|
||||
[Key in keyof T]-?: [ValueType] extends [T[Key]] ? [T[Key]] extends [ValueType] ? Key : never : never;
|
||||
}[keyof T]>;
|
||||
/**
|
||||
* Omit (complements Pick)
|
||||
* @desc From `T` remove a set of properties by key `K`
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
*
|
||||
* // Expect: { name: string; visible: boolean; }
|
||||
* type Props = Omit<Props, 'age'>;
|
||||
*/
|
||||
export declare type Omit<T, K extends keyof any> = Pick<T, SetDifference<keyof T, K>>;
|
||||
/**
|
||||
* OmitByValue
|
||||
* @desc From `T` remove a set of properties by value matching `ValueType`.
|
||||
* Credit: [Piotr Lewandowski](https://medium.com/dailyjs/typescript-create-a-condition-based-subset-types-9d902cea5b8c)
|
||||
* @example
|
||||
* type Props = { req: number; reqUndef: number | undefined; opt?: string; };
|
||||
*
|
||||
* // Expect: { reqUndef: number | undefined; opt?: string; }
|
||||
* type Props = OmitByValue<Props, number>;
|
||||
* // Expect: { opt?: string; }
|
||||
* type Props = OmitByValue<Props, number | undefined>;
|
||||
*/
|
||||
export declare type OmitByValue<T, ValueType> = Pick<T, {
|
||||
[Key in keyof T]-?: T[Key] extends ValueType ? never : Key;
|
||||
}[keyof T]>;
|
||||
/**
|
||||
* OmitByValueExact
|
||||
* @desc From `T` remove a set of properties by value matching exact `ValueType`.
|
||||
* @example
|
||||
* type Props = { req: number; reqUndef: number | undefined; opt?: string; };
|
||||
*
|
||||
* // Expect: { reqUndef: number | undefined; opt?: string; }
|
||||
* type Props = OmitByValueExact<Props, number>;
|
||||
* // Expect: { req: number; opt?: string }
|
||||
* type Props = OmitByValueExact<Props, number | undefined>;
|
||||
*/
|
||||
export declare type OmitByValueExact<T, ValueType> = Pick<T, {
|
||||
[Key in keyof T]-?: [ValueType] extends [T[Key]] ? [T[Key]] extends [ValueType] ? never : Key : Key;
|
||||
}[keyof T]>;
|
||||
/**
|
||||
* Intersection
|
||||
* @desc From `T` pick properties that exist in `U`
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* type DefaultProps = { age: number };
|
||||
*
|
||||
* // Expect: { age: number; }
|
||||
* type DuplicateProps = Intersection<Props, DefaultProps>;
|
||||
*/
|
||||
export declare type Intersection<T extends object, U extends object> = Pick<T, Extract<keyof T, keyof U> & Extract<keyof U, keyof T>>;
|
||||
/**
|
||||
* Diff
|
||||
* @desc From `T` remove properties that exist in `U`
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* type DefaultProps = { age: number };
|
||||
*
|
||||
* // Expect: { name: string; visible: boolean; }
|
||||
* type DiffProps = Diff<Props, DefaultProps>;
|
||||
*/
|
||||
export declare type Diff<T extends object, U extends object> = Pick<T, SetDifference<keyof T, keyof U>>;
|
||||
/**
|
||||
* Subtract
|
||||
* @desc From `T` remove properties that exist in `T1` (`T1` has a subset of the properties of `T`)
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* type DefaultProps = { age: number };
|
||||
*
|
||||
* // Expect: { name: string; visible: boolean; }
|
||||
* type RestProps = Subtract<Props, DefaultProps>;
|
||||
*/
|
||||
export declare type Subtract<T extends T1, T1 extends object> = Pick<T, SetComplement<keyof T, keyof T1>>;
|
||||
/**
|
||||
* Overwrite
|
||||
* @desc From `U` overwrite properties to `T`
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* type NewProps = { age: string; other: string };
|
||||
*
|
||||
* // Expect: { name: string; age: string; visible: boolean; }
|
||||
* type ReplacedProps = Overwrite<Props, NewProps>;
|
||||
*/
|
||||
export declare type Overwrite<T extends object, U extends object, I = Diff<T, U> & Intersection<U, T>> = Pick<I, keyof I>;
|
||||
/**
|
||||
* Assign
|
||||
* @desc From `U` assign properties to `T` (just like object assign)
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* type NewProps = { age: string; other: string };
|
||||
*
|
||||
* // Expect: { name: string; age: number; visible: boolean; other: string; }
|
||||
* type ExtendedProps = Assign<Props, NewProps>;
|
||||
*/
|
||||
export declare type Assign<T extends object, U extends object, I = Diff<T, U> & Intersection<U, T> & Diff<U, T>> = Pick<I, keyof I>;
|
||||
/**
|
||||
* Exact
|
||||
* @desc Create branded object type for exact type matching
|
||||
*/
|
||||
export declare type Exact<A extends object> = A & {
|
||||
__brand: keyof A;
|
||||
};
|
||||
/**
|
||||
* Unionize
|
||||
* @desc Disjoin object to form union of objects, each with single property
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
*
|
||||
* // Expect: { name: string; } | { age: number; } | { visible: boolean; }
|
||||
* type UnionizedType = Unionize<Props>;
|
||||
*/
|
||||
export declare type Unionize<T extends object> = {
|
||||
[P in keyof T]: {
|
||||
[Q in P]: T[P];
|
||||
};
|
||||
}[keyof T];
|
||||
/**
|
||||
* PromiseType
|
||||
* @desc Obtain Promise resolve type
|
||||
* @example
|
||||
* // Expect: string;
|
||||
* type Response = PromiseType<Promise<string>>;
|
||||
*/
|
||||
export declare type PromiseType<T extends Promise<any>> = T extends Promise<infer U> ? U : never;
|
||||
/**
|
||||
* DeepReadonly
|
||||
* @desc Readonly that works for deeply nested structure
|
||||
* @example
|
||||
* // Expect: {
|
||||
* // readonly first: {
|
||||
* // readonly second: {
|
||||
* // readonly name: string;
|
||||
* // };
|
||||
* // };
|
||||
* // }
|
||||
* type NestedProps = {
|
||||
* first: {
|
||||
* second: {
|
||||
* name: string;
|
||||
* };
|
||||
* };
|
||||
* };
|
||||
* type ReadonlyNestedProps = DeepReadonly<NestedProps>;
|
||||
*/
|
||||
export declare type DeepReadonly<T> = T extends ((...args: any[]) => any) | Primitive ? T : T extends _DeepReadonlyArray<infer U> ? _DeepReadonlyArray<U> : T extends _DeepReadonlyObject<infer V> ? _DeepReadonlyObject<V> : T;
|
||||
/** @private */
|
||||
export interface _DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {
|
||||
}
|
||||
/** @private */
|
||||
export declare type _DeepReadonlyObject<T> = {
|
||||
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
||||
};
|
||||
/**
|
||||
* DeepRequired
|
||||
* @desc Required that works for deeply nested structure
|
||||
* @example
|
||||
* // Expect: {
|
||||
* // first: {
|
||||
* // second: {
|
||||
* // name: string;
|
||||
* // };
|
||||
* // };
|
||||
* // }
|
||||
* type NestedProps = {
|
||||
* first?: {
|
||||
* second?: {
|
||||
* name?: string;
|
||||
* };
|
||||
* };
|
||||
* };
|
||||
* type RequiredNestedProps = DeepRequired<NestedProps>;
|
||||
*/
|
||||
export declare type DeepRequired<T> = T extends (...args: any[]) => any ? T : T extends any[] ? _DeepRequiredArray<T[number]> : T extends object ? _DeepRequiredObject<T> : T;
|
||||
/** @private */
|
||||
export interface _DeepRequiredArray<T> extends Array<DeepRequired<NonUndefined<T>>> {
|
||||
}
|
||||
/** @private */
|
||||
export declare type _DeepRequiredObject<T> = {
|
||||
[P in keyof T]-?: DeepRequired<NonUndefined<T[P]>>;
|
||||
};
|
||||
/**
|
||||
* DeepNonNullable
|
||||
* @desc NonNullable that works for deeply nested structure
|
||||
* @example
|
||||
* // Expect: {
|
||||
* // first: {
|
||||
* // second: {
|
||||
* // name: string;
|
||||
* // };
|
||||
* // };
|
||||
* // }
|
||||
* type NestedProps = {
|
||||
* first?: null | {
|
||||
* second?: null | {
|
||||
* name?: string | null |
|
||||
* undefined;
|
||||
* };
|
||||
* };
|
||||
* };
|
||||
* type RequiredNestedProps = DeepNonNullable<NestedProps>;
|
||||
*/
|
||||
export declare type DeepNonNullable<T> = T extends (...args: any[]) => any ? T : T extends any[] ? _DeepNonNullableArray<T[number]> : T extends object ? _DeepNonNullableObject<T> : T;
|
||||
/** @private */
|
||||
export interface _DeepNonNullableArray<T> extends Array<DeepNonNullable<NonNullable<T>>> {
|
||||
}
|
||||
/** @private */
|
||||
export declare type _DeepNonNullableObject<T> = {
|
||||
[P in keyof T]-?: DeepNonNullable<NonNullable<T[P]>>;
|
||||
};
|
||||
/**
|
||||
* DeepPartial
|
||||
* @desc Partial that works for deeply nested structure
|
||||
* @example
|
||||
* // Expect: {
|
||||
* // first?: {
|
||||
* // second?: {
|
||||
* // name?: string;
|
||||
* // };
|
||||
* // };
|
||||
* // }
|
||||
* type NestedProps = {
|
||||
* first: {
|
||||
* second: {
|
||||
* name: string;
|
||||
* };
|
||||
* };
|
||||
* };
|
||||
* type PartialNestedProps = DeepPartial<NestedProps>;
|
||||
*/
|
||||
export declare type DeepPartial<T> = {
|
||||
[P in keyof T]?: _DeepPartial<T[P]>;
|
||||
};
|
||||
/** @private */
|
||||
export declare type _DeepPartial<T> = T extends Function ? T : T extends Array<infer U> ? _DeepPartialArray<U> : T extends object ? DeepPartial<T> : T | undefined;
|
||||
/** @private */
|
||||
export interface _DeepPartialArray<T> extends Array<_DeepPartial<T>> {
|
||||
}
|
||||
/**
|
||||
* Brand
|
||||
* @desc Define nominal type of U based on type of T. Similar to Opaque types in Flow.
|
||||
* @example
|
||||
* type USD = Brand<number, "USD">
|
||||
* type EUR = Brand<number, "EUR">
|
||||
*
|
||||
* const tax = 5 as USD;
|
||||
* const usd = 10 as USD;
|
||||
* const eur = 10 as EUR;
|
||||
*
|
||||
* function gross(net: USD): USD {
|
||||
* return (net + tax) as USD;
|
||||
* }
|
||||
*
|
||||
* // Expect: No compile error
|
||||
* gross(usd);
|
||||
* // Expect: Compile error (Type '"EUR"' is not assignable to type '"USD"'.)
|
||||
* gross(eur);
|
||||
*/
|
||||
export declare type Brand<T, U> = T & {
|
||||
__brand: U;
|
||||
};
|
||||
/**
|
||||
* Optional
|
||||
* @desc From `T` make a set of properties by key `K` become optional
|
||||
* @example
|
||||
* type Props = {
|
||||
* name: string;
|
||||
* age: number;
|
||||
* visible: boolean;
|
||||
* };
|
||||
*
|
||||
* // Expect: { name?: string; age?: number; visible?: boolean; }
|
||||
* type Props = Optional<Props>;
|
||||
*
|
||||
* // Expect: { name: string; age?: number; visible?: boolean; }
|
||||
* type Props = Optional<Props, 'age' | 'visible'>;
|
||||
*/
|
||||
export declare type Optional<T extends object, K extends keyof T = keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
||||
/**
|
||||
* ValuesType
|
||||
* @desc Get the union type of all the values in an object, array or array-like type `T`
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* // Expect: string | number | boolean
|
||||
* type PropsValues = ValuesType<Props>;
|
||||
*
|
||||
* type NumberArray = number[];
|
||||
* // Expect: number
|
||||
* type NumberItems = ValuesType<NumberArray>;
|
||||
*
|
||||
* type ReadonlySymbolArray = readonly symbol[];
|
||||
* // Expect: symbol
|
||||
* type SymbolItems = ValuesType<ReadonlySymbolArray>;
|
||||
*
|
||||
* type NumberTuple = [1, 2];
|
||||
* // Expect: 1 | 2
|
||||
* type NumberUnion = ValuesType<NumberTuple>;
|
||||
*
|
||||
* type ReadonlyNumberTuple = readonly [1, 2];
|
||||
* // Expect: 1 | 2
|
||||
* type AnotherNumberUnion = ValuesType<NumberTuple>;
|
||||
*
|
||||
* type BinaryArray = Uint8Array;
|
||||
* // Expect: number
|
||||
* type BinaryItems = ValuesType<BinaryArray>;
|
||||
*/
|
||||
export declare type ValuesType<T extends ReadonlyArray<any> | ArrayLike<any> | Record<any, any>> = T extends ReadonlyArray<any> ? T[number] : T extends ArrayLike<any> ? T[number] : T extends object ? T[keyof T] : never;
|
||||
/**
|
||||
* Required
|
||||
* @desc From `T` make a set of properties by key `K` become required
|
||||
* @example
|
||||
* type Props = {
|
||||
* name?: string;
|
||||
* age?: number;
|
||||
* visible?: boolean;
|
||||
* };
|
||||
*
|
||||
* // Expect: { name: string; age: number; visible: boolean; }
|
||||
* type Props = Required<Props>;
|
||||
*
|
||||
* // Expect: { name?: string; age: number; visible: boolean; }
|
||||
* type Props = Required<Props, 'age' | 'visible'>;
|
||||
*/
|
||||
export declare type AugmentedRequired<T extends object, K extends keyof T = keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
||||
/**
|
||||
* UnionToIntersection
|
||||
* @desc Get intersection type given union type `U`
|
||||
* Credit: jcalz
|
||||
* @see https://stackoverflow.com/a/50375286/7381355
|
||||
* @example
|
||||
* // Expect: { name: string } & { age: number } & { visible: boolean }
|
||||
* UnionToIntersection<{ name: string } | { age: number } | { visible: boolean }>
|
||||
*/
|
||||
export declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
||||
/**
|
||||
* Mutable
|
||||
* @desc From `T` make all properties become mutable
|
||||
* @example
|
||||
* type Props = {
|
||||
* readonly name: string;
|
||||
* readonly age: number;
|
||||
* readonly visible: boolean;
|
||||
* };
|
||||
*
|
||||
* // Expect: { name: string; age: number; visible: boolean; }
|
||||
* Mutable<Props>;
|
||||
*/
|
||||
export declare type Mutable<T> = {
|
||||
-readonly [P in keyof T]: T[P];
|
||||
};
|
||||
export declare type Writable<T> = Mutable<T>;
|
||||
export {};
|
||||
3
node_modules/utility-types/dist/mapped-types.js
generated
vendored
Normal file
3
node_modules/utility-types/dist/mapped-types.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=mapped-types.js.map
|
||||
1
node_modules/utility-types/dist/mapped-types.js.map
generated
vendored
Normal file
1
node_modules/utility-types/dist/mapped-types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mapped-types.js","sourceRoot":"","sources":["../src/mapped-types.ts"],"names":[],"mappings":""}
|
||||
156
node_modules/utility-types/dist/utility-types.d.ts
generated
vendored
Normal file
156
node_modules/utility-types/dist/utility-types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
import { SetComplement, DeepReadonly } from './mapped-types';
|
||||
/**
|
||||
* $Keys
|
||||
* @desc Get the union type of all the keys in an object type `T`
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-keys
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
*
|
||||
* // Expect: "name" | "age" | "visible"
|
||||
* type PropsKeys = $Keys<Props>;
|
||||
*/
|
||||
export declare type $Keys<T extends object> = keyof T;
|
||||
/**
|
||||
* $Values
|
||||
* @desc Get the union type of all the values in an object type `T`
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-values
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
*
|
||||
* // Expect: string | number | boolean
|
||||
* type PropsValues = $Values<Props>;
|
||||
*/
|
||||
export declare type $Values<T extends object> = T[keyof T];
|
||||
/**
|
||||
* $ReadOnly
|
||||
* @desc Get the read-only version of a given object type `T` (it works on nested data structure)
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-readonly
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
*
|
||||
* // Expect: Readonly<{ name: string; age: number; visible: boolean; }>
|
||||
* type ReadOnlyProps = $ReadOnly<Props>;
|
||||
*/
|
||||
export declare type $ReadOnly<T extends object> = DeepReadonly<T>;
|
||||
/**
|
||||
* $Diff
|
||||
* @desc Get the set difference of a given object types `T` and `U` (`T \ U`)
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-diff
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* type DefaultProps = { age: number };
|
||||
*
|
||||
* // Expect: { name: string; visible: boolean; }
|
||||
* type RequiredProps = Diff<Props, DefaultProps>;
|
||||
*/
|
||||
export declare type $Diff<T extends U, U extends object> = Pick<T, SetComplement<keyof T, keyof U>>;
|
||||
/**
|
||||
* $PropertyType
|
||||
* @desc Get the type of property of an object at a given key `K`
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-propertytype
|
||||
* @example
|
||||
* // Expect: string;
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* type NameType = $PropertyType<Props, 'name'>;
|
||||
*
|
||||
* // Expect: boolean
|
||||
* type Tuple = [boolean, number];
|
||||
* type A = $PropertyType<Tuple, '0'>;
|
||||
* // Expect: number
|
||||
* type B = $PropertyType<Tuple, '1'>;
|
||||
*/
|
||||
export declare type $PropertyType<T extends object, K extends keyof T> = T[K];
|
||||
/**
|
||||
* $ElementType
|
||||
* @desc Get the type of elements inside of array, tuple or object of type `T`, that matches the given index type `K`
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-elementtype
|
||||
* @example
|
||||
* // Expect: string;
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
* type NameType = $ElementType<Props, 'name'>;
|
||||
*
|
||||
* // Expect: boolean
|
||||
* type Tuple = [boolean, number];
|
||||
* type A = $ElementType<Tuple, '0'>;
|
||||
* // Expect: number
|
||||
* type B = $ElementType<Tuple, '1'>;
|
||||
*
|
||||
* // Expect: boolean
|
||||
* type Arr = boolean[];
|
||||
* type ItemsType = $ElementType<Arr, number>;
|
||||
*
|
||||
* // Expect: number
|
||||
* type Obj = { [key: string]: number };
|
||||
* type ValuesType = $ElementType<Obj, string>;
|
||||
*/
|
||||
export declare type $ElementType<T extends {
|
||||
[P in K & any]: any;
|
||||
}, K extends keyof T | number> = T[K];
|
||||
/**
|
||||
* $Call
|
||||
* @desc Get the return type from a given typeof expression
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-call
|
||||
* @example
|
||||
* // Common use-case
|
||||
* const add = (amount: number) => ({ type: 'ADD' as 'ADD', payload: amount });
|
||||
* type AddAction = $Call<typeof add>; // { type: 'ADD'; payload: number }
|
||||
*
|
||||
* // Examples migrated from Flow docs
|
||||
* type ExtractPropType<T extends { prop: any }> = (arg: T) => T['prop'];
|
||||
* type Obj = { prop: number };
|
||||
* type PropType = $Call<ExtractPropType<Obj>>; // number
|
||||
*
|
||||
* type ExtractReturnType<T extends () => any> = (arg: T) => ReturnType<T>;
|
||||
* type Fn = () => number;
|
||||
* type FnReturnType = $Call<ExtractReturnType<Fn>>; // number
|
||||
*/
|
||||
export declare type $Call<Fn extends (...args: any[]) => any> = Fn extends (arg: any) => infer RT ? RT : never;
|
||||
/**
|
||||
* $Shape
|
||||
* @desc Copies the shape of the type supplied, but marks every field optional.
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-shape
|
||||
* @example
|
||||
* type Props = { name: string; age: number; visible: boolean };
|
||||
*
|
||||
* // Expect: Partial<Props>
|
||||
* type PartialProps = $Shape<Props>;
|
||||
*/
|
||||
export declare type $Shape<T extends object> = Partial<T>;
|
||||
/**
|
||||
* $NonMaybeType
|
||||
* @desc Excludes null and undefined from T
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-nonmaybe
|
||||
* @example
|
||||
* type MaybeName = string | null;
|
||||
*
|
||||
* // Expect: string
|
||||
* type Name = $NonMaybeType<MaybeName>;
|
||||
*/
|
||||
export declare type $NonMaybeType<T> = NonNullable<T>;
|
||||
/**
|
||||
* Class
|
||||
* @desc Represents constructor of type T
|
||||
* @see https://flow.org/en/docs/types/utilities/#toc-class
|
||||
* @example
|
||||
* class Store {}
|
||||
* function makeStore(storeClass: Class<Store>): Store {
|
||||
* return new storeClass();
|
||||
* }
|
||||
*/
|
||||
export declare type Class<T> = new (...args: any[]) => T;
|
||||
/**
|
||||
* mixed
|
||||
* @desc An arbitrary type that could be anything
|
||||
* @see https://flow.org/en/docs/types/mixed
|
||||
* @example
|
||||
*
|
||||
* function stringify(value: mixed) {
|
||||
* // ...
|
||||
* }
|
||||
*
|
||||
* stringify("foo");
|
||||
* stringify(3.14);
|
||||
* stringify(null);
|
||||
* stringify({});
|
||||
*/
|
||||
export declare type mixed = unknown;
|
||||
3
node_modules/utility-types/dist/utility-types.js
generated
vendored
Normal file
3
node_modules/utility-types/dist/utility-types.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=utility-types.js.map
|
||||
1
node_modules/utility-types/dist/utility-types.js.map
generated
vendored
Normal file
1
node_modules/utility-types/dist/utility-types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"utility-types.js","sourceRoot":"","sources":["../src/utility-types.ts"],"names":[],"mappings":""}
|
||||
54
node_modules/utility-types/package.json
generated
vendored
Normal file
54
node_modules/utility-types/package.json
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "utility-types",
|
||||
"version": "3.11.0",
|
||||
"description": "Utility Types Collection for TypeScript",
|
||||
"author": "Piotr Witek <piotrek.witek@gmail.com> (http://piotrwitek.github.io)",
|
||||
"repository": "https://github.com/piotrwitek/utility-types",
|
||||
"homepage": "https://github.com/piotrwitek/utility-types",
|
||||
"license": "MIT",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-push": "npm run prettier:fix && npm run lint && npm run tsc && npm run test:update"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"ci-check": "npm run prettier && npm run lint && npm run tsc && npm run test",
|
||||
"reinstall": "rm -rf node_modules/ dist/ && npm install",
|
||||
"prettier": "prettier --list-different 'src/**/*.ts' || (echo '\nPlease fix code formatting by running:\nnpm run prettier:fix\n'; exit 1)",
|
||||
"prettier:fix": "prettier --write src/**/*.ts",
|
||||
"lint": "tslint --project ./tsconfig.json",
|
||||
"tsc": "tsc -p . --noEmit",
|
||||
"tsc:watch": "tsc -p . --noEmit -w",
|
||||
"test": "jest --config jest.config.json && dts-jest-remap ./src/*.spec.ts --rename {{basename}}.snap.{{extname}} --check",
|
||||
"test:update": "jest --config jest.config.json --no-cache -u && dts-jest-remap ./src/*.spec.ts --rename {{basename}}.snap.{{extname}}",
|
||||
"test:watch": "jest --config jest.config.json --watch",
|
||||
"prebuild": "rm -rf dist/",
|
||||
"build": "tsc -p ./tsconfig.build.json --outDir dist/",
|
||||
"prepublishOnly": "npm run reinstall && npm run ci-check && npm run build"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/jest": "24.0.22",
|
||||
"dts-jest": "23.0.0",
|
||||
"husky": "3.0.9",
|
||||
"jest": "24.9.0",
|
||||
"prettier": "1.19.0",
|
||||
"ts-jest": "24.1.0",
|
||||
"tslint": "5.20.1",
|
||||
"typescript": "3.7.2"
|
||||
},
|
||||
"keywords": [
|
||||
"typescript",
|
||||
"utility",
|
||||
"types",
|
||||
"static-typing",
|
||||
"mapped-types",
|
||||
"flow",
|
||||
"flow-typed"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user