type-fest
Advanced tools
Comparing version 3.4.0 to 3.5.0
@@ -77,2 +77,3 @@ // Basic | ||
export type {TupleToUnion} from './source/tuple-to-union'; | ||
export type {IsEqual} from './source/is-equal'; | ||
@@ -79,0 +80,0 @@ // Template literal types |
{ | ||
"name": "type-fest", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"description": "A collection of essential TypeScript types", | ||
@@ -5,0 +5,0 @@ "license": "(MIT OR CC0-1.0)", |
@@ -172,2 +172,3 @@ <div align="center"> | ||
- [`Spread`](source/spread.d.ts) - Mimic the type inferred by TypeScript when merging two objects or two arrays/tuples using the spread syntax. | ||
- [`IsEqual`](source/is-equal.d.ts) - Returns a boolean for whether the two given types are equal. | ||
@@ -241,3 +242,3 @@ ### JSON | ||
- [`GlobalThis`](source/global-this.d.ts) - Declare locally scoped properties on `globalThis`. | ||
- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). It also includes support for [TypeScript Declaration Files](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) and [Yarn Workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/). | ||
- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). It also includes support for [TypeScript Declaration Files](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html). | ||
- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). | ||
@@ -244,0 +245,0 @@ |
@@ -77,3 +77,5 @@ import type {SplitWords} from './split-words'; | ||
export type CamelCase<Type, Options extends CamelCaseOptions = {preserveConsecutiveUppercase: true}> = Type extends string | ||
? Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> | ||
? string extends Type | ||
? Type | ||
: Uncapitalize<CamelCaseFromArray<SplitWords<Type extends Uppercase<Type> ? Lowercase<Type> : Type>, Options>> | ||
: Type; |
import type {Opaque} from './opaque'; | ||
import type {IsEqual} from './internal'; | ||
import type {IsEqual} from './is-equal'; | ||
import type {ConditionalExcept} from './conditional-except'; | ||
@@ -4,0 +4,0 @@ import type {ConditionalSimplifyDeep} from './conditional-simplify'; |
@@ -1,2 +0,2 @@ | ||
import type {IsEqual} from './internal'; | ||
import type {IsEqual} from './is-equal'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import type {IsEqual} from './internal'; | ||
import type {IsEqual} from './is-equal'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -5,14 +5,2 @@ import type {Primitive} from './primitive'; | ||
/** | ||
Returns a boolean for whether the two given types are equal. | ||
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650 | ||
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796 | ||
*/ | ||
export type IsEqual<T, U> = | ||
(<G>() => G extends T ? 1 : 2) extends | ||
(<G>() => G extends U ? 1 : 2) | ||
? true | ||
: false; | ||
/** | ||
Infer the length of the given array `<T>`. | ||
@@ -19,0 +7,0 @@ |
@@ -24,3 +24,3 @@ /** | ||
export type Join< | ||
Strings extends Array<string | number>, | ||
Strings extends Readonly<Array<string | number>>, | ||
Delimiter extends string, | ||
@@ -31,3 +31,3 @@ > = Strings extends [] | ||
? `${Strings[0]}` | ||
: Strings extends [ | ||
: Strings extends readonly [ | ||
string | number, | ||
@@ -34,0 +34,0 @@ ...infer Rest extends Array<string | number>, |
@@ -1,2 +0,3 @@ | ||
import type {IsEqual, Subtract} from './internal'; | ||
import type {Subtract} from './internal'; | ||
import type {IsEqual} from './is-equal'; | ||
@@ -3,0 +4,0 @@ type Recursive<T> = Array<Recursive<T>>; |
@@ -1,2 +0,3 @@ | ||
import type {IsEqual, Subtract} from './internal'; | ||
import type {Subtract} from './internal'; | ||
import type {IsEqual} from './is-equal'; | ||
@@ -3,0 +4,0 @@ type Recursive<T> = ReadonlyArray<Recursive<T>>; |
@@ -297,3 +297,3 @@ import type {LiteralUnion} from './literal-union'; | ||
/** | ||
An alternative configuration for Yarn workspaces. | ||
An alternative configuration for workspaces. | ||
*/ | ||
@@ -309,3 +309,4 @@ export type WorkspaceConfig = { | ||
[Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) | ||
[Supported](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) by Yarn. | ||
[Not supported](https://github.com/npm/rfcs/issues/287) by npm. | ||
*/ | ||
@@ -328,11 +329,2 @@ nohoist?: WorkspacePattern[]; | ||
/** | ||
Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/). | ||
Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass. | ||
Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces. | ||
*/ | ||
workspaces?: WorkspacePattern[] | WorkspaceConfig; | ||
/** | ||
If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`. | ||
@@ -630,2 +622,11 @@ | ||
}; | ||
/** | ||
Used to configure [npm workspaces](https://docs.npmjs.com/cli/using-npm/workspaces) / [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/). | ||
Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run your install command once in order to install all of them in a single pass. | ||
Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces. | ||
*/ | ||
workspaces?: WorkspacePattern[] | WorkspaceConfig; | ||
} | ||
@@ -632,0 +633,0 @@ |
@@ -224,2 +224,17 @@ declare namespace TsConfigJson { | ||
export type ModuleResolution = | ||
| 'classic' | ||
| 'node' | ||
| 'node16' | ||
| 'nodenext' | ||
// Pascal-cased alternatives | ||
| 'Classic' | ||
| 'Node' | ||
| 'Node16' | ||
| 'NodeNext'; | ||
export type ModuleDetection = | ||
| 'auto' | ||
| 'legacy' | ||
| 'force'; | ||
} | ||
@@ -251,4 +266,2 @@ | ||
Specify output directory for generated declaration files. | ||
Requires TypeScript version 2.0 or later. | ||
*/ | ||
@@ -267,4 +280,2 @@ declarationDir?: string; | ||
Requires TypeScript version 4.0 or later. | ||
@default false | ||
@@ -277,4 +288,2 @@ */ | ||
Requires TypeScript version 4.2 or later. | ||
@default false | ||
@@ -301,4 +310,2 @@ */ | ||
Requires TypeScript version 4.4 or later. | ||
@default false | ||
@@ -355,4 +362,2 @@ */ | ||
Requires TypeScript version 2.1 or later. | ||
@default 'React.createElement' | ||
@@ -365,4 +370,2 @@ */ | ||
Requires TypeScript version 4.0 or later. | ||
@default 'React.Fragment' | ||
@@ -375,4 +378,2 @@ */ | ||
Requires TypeScript version 4.1 or later. | ||
@default 'react' | ||
@@ -406,3 +407,3 @@ */ | ||
*/ | ||
moduleResolution?: 'classic' | 'node'; | ||
moduleResolution?: CompilerOptions.ModuleResolution; | ||
@@ -454,4 +455,2 @@ /** | ||
Requires TypeScript version 2.0 or later. | ||
@default false | ||
@@ -464,4 +463,2 @@ */ | ||
Requires TypeScript version 2.0 or later. | ||
@default false | ||
@@ -500,4 +497,2 @@ */ | ||
Requires TypeScript version 2.0 or later. | ||
@default false | ||
@@ -607,4 +602,2 @@ */ | ||
Requires TypeScript version 4.4 or later. | ||
@default false | ||
@@ -625,4 +618,2 @@ */ | ||
Requires TypeScript version 3.8 or later. | ||
@deprecated Use watchOptions.fallbackPolling instead. | ||
@@ -635,4 +626,2 @@ */ | ||
Requires TypeScript version 3.8 or later. | ||
@default 'useFsEvents' | ||
@@ -646,4 +635,2 @@ @deprecated Use watchOptions.watchDirectory instead. | ||
Requires TypeScript version 3.8 or later. | ||
@default 'useFsEvents' | ||
@@ -685,4 +672,2 @@ @deprecated Use watchOptions.watchFile instead. | ||
Requires TypeScript version 4.1 or later. | ||
@default false | ||
@@ -723,4 +708,2 @@ */ | ||
Requires TypeScript version 3.7 or later. | ||
@default 'profile.cpuprofile' | ||
@@ -742,4 +725,2 @@ */ | ||
List of TypeScript language server plugins to load. | ||
Requires TypeScript version 2.3 or later. | ||
*/ | ||
@@ -755,4 +736,2 @@ plugins?: CompilerOptions.Plugin[]; | ||
Specify list of directories for type definition files to be included. | ||
Requires TypeScript version 2.0 or later. | ||
*/ | ||
@@ -763,4 +742,2 @@ typeRoots?: string[]; | ||
Type declaration files to be included in compilation. | ||
Requires TypeScript version 2.0 or later. | ||
*/ | ||
@@ -807,4 +784,2 @@ types?: string[]; | ||
Requires TypeScript version 2.0 or later. | ||
@default false | ||
@@ -817,4 +792,2 @@ */ | ||
Requires TypeScript version 2.0 or later. | ||
@default false | ||
@@ -826,4 +799,2 @@ */ | ||
List of library files to be included in the compilation. | ||
Requires TypeScript version 2.0 or later. | ||
*/ | ||
@@ -835,4 +806,2 @@ lib?: CompilerOptions.Lib[]; | ||
Requires TypeScript version 2.0 or later. | ||
@default false | ||
@@ -852,4 +821,2 @@ */ | ||
Requires TypeScript version 2.1 or later. | ||
@default false | ||
@@ -869,4 +836,2 @@ */ | ||
Requires TypeScript version 2.1 or later. | ||
@default false | ||
@@ -879,4 +844,2 @@ */ | ||
Requires TypeScript version 2.3 or later. | ||
@default false | ||
@@ -896,4 +859,2 @@ */ | ||
Requires TypeScript version 2.3 or later. | ||
@default false | ||
@@ -906,4 +867,2 @@ */ | ||
Requires TypeScript version 2.3 or later. | ||
@default false | ||
@@ -916,4 +875,2 @@ */ | ||
Requires TypeScript version 2.6 or later. | ||
@default false | ||
@@ -926,4 +883,2 @@ */ | ||
Requires TypeScript version 2.7 or later. | ||
@default false | ||
@@ -936,4 +891,2 @@ */ | ||
Requires TypeScript version 2.7 or later. | ||
@default false | ||
@@ -953,4 +906,2 @@ */ | ||
Requires TypeScript version 2.9 or later. | ||
@default false | ||
@@ -963,4 +914,2 @@ */ | ||
Requires TypeScript version 3.7 or later. | ||
@default false | ||
@@ -973,4 +922,2 @@ */ | ||
Requires TypeScript version 2.9 or later. | ||
@default false | ||
@@ -983,4 +930,2 @@ */ | ||
Requires TypeScript version 2.9 or later. | ||
@default false | ||
@@ -993,4 +938,2 @@ */ | ||
Requires TypeScript version 3.8 or later. | ||
@default false | ||
@@ -1024,4 +967,2 @@ */ | ||
Requires TypeScript version 3.8 or later. | ||
@default false | ||
@@ -1034,7 +975,24 @@ */ | ||
Requires TypeScript version 4.2 or later. | ||
@default false | ||
*/ | ||
explainFiles?: boolean; | ||
/** | ||
Preserve unused imported values in the JavaScript output that would otherwise be removed. | ||
@default true | ||
*/ | ||
preserveValueImports?: boolean; | ||
/** | ||
List of file name suffixes to search when resolving a module. | ||
*/ | ||
moduleSuffixes?: string[]; | ||
/** | ||
Control what method is used to detect module-format JS files. | ||
@default 'auto' | ||
*/ | ||
moduleDetection?: CompilerOptions.ModuleDetection; | ||
}; | ||
@@ -1069,4 +1027,2 @@ | ||
Requires TypeScript version 3.8 or later. | ||
@default 'UseFsEvents' | ||
@@ -1079,4 +1035,2 @@ */ | ||
Requires TypeScript version 3.8 or later. | ||
@default 'UseFsEvents' | ||
@@ -1088,4 +1042,2 @@ */ | ||
Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. | ||
Requires TypeScript version 3.8 or later. | ||
*/ | ||
@@ -1112,4 +1064,2 @@ fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase<WatchOptions.PollingWatchKind>; | ||
Auto type (.d.ts) acquisition options for this project. | ||
Requires TypeScript version 2.1 or later. | ||
*/ | ||
@@ -1176,4 +1126,2 @@ export type TypeAcquisition = { | ||
Auto type (.d.ts) acquisition options for this project. | ||
Requires TypeScript version 2.1 or later. | ||
*/ | ||
@@ -1189,4 +1137,2 @@ typeAcquisition?: TsConfigJson.TypeAcquisition; | ||
Path to base configuration file to inherit from. | ||
Requires TypeScript version 2.1 or later. | ||
*/ | ||
@@ -1211,4 +1157,2 @@ extends?: string; | ||
If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. | ||
Requires TypeScript version 2.0 or later. | ||
*/ | ||
@@ -1219,6 +1163,4 @@ include?: string[]; | ||
Referenced projects. | ||
Requires TypeScript version 3.0 or later. | ||
*/ | ||
references?: TsConfigJson.References[]; | ||
}; |
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
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
90
5556
905
239181