type-fest
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -23,2 +23,3 @@ // Basic | ||
export {ConditionalPick} from './source/conditional-pick'; | ||
export {UnionToIntersection} from './source/union-to-intersection'; | ||
@@ -25,0 +26,0 @@ // Miscellaneous |
{ | ||
"name": "type-fest", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "A collection of essential TypeScript types", | ||
@@ -11,6 +11,6 @@ "license": "(MIT OR CC0-1.0)", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=10" | ||
}, | ||
@@ -37,17 +37,12 @@ "scripts": { | ||
"@sindresorhus/tsconfig": "^0.7.0", | ||
"@typescript-eslint/eslint-plugin": "2.17.0", | ||
"@typescript-eslint/parser": "2.17.0", | ||
"eslint-config-xo-typescript": "^0.24.1", | ||
"@typescript-eslint/eslint-plugin": "^2.22.0", | ||
"@typescript-eslint/parser": "^2.22.0", | ||
"eslint-config-xo-typescript": "^0.26.0", | ||
"tsd": "^0.7.3", | ||
"typescript": "3.7.5", | ||
"xo": "^0.25.3" | ||
"typescript": "^3.8.3", | ||
"xo": "^0.27.2" | ||
}, | ||
"types": "index.d.ts", | ||
"xo": { | ||
"extends": "xo-typescript", | ||
"extensions": [ | ||
"ts" | ||
], | ||
"rules": { | ||
"import/no-unresolved": "off", | ||
"@typescript-eslint/indent": "off" | ||
@@ -54,0 +49,0 @@ } |
@@ -82,2 +82,3 @@ <div align="center"> | ||
- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type. | ||
- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type. | ||
@@ -95,2 +96,4 @@ ### Miscellaneous | ||
- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary<number>` vs `Record<string, number>`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now. | ||
- [`SubType`](https://github.com/sindresorhus/type-fest/issues/22) - The type is powerful, but lacks good use-cases and is prone to misuse. | ||
- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies. | ||
@@ -97,0 +100,0 @@ ## Tips |
@@ -20,3 +20,3 @@ /// <reference lib="esnext"/> | ||
*/ | ||
export type Class<T = unknown, Arguments extends any[] = any[]> = new(...arguments_: Arguments) => T; | ||
export type Class<T = unknown, Arguments extends any[] = any[]> = new(...arguments_: Arguments) => T; // eslint-disable-line @typescript-eslint/type-annotation-spacing | ||
@@ -23,0 +23,0 @@ /** |
// TODO: Remove this when we target TypeScript >=3.5. | ||
// eslint-disable-next-line @typescript-eslint/generic-type-naming | ||
type _Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>; | ||
@@ -4,0 +3,0 @@ |
@@ -0,1 +1,3 @@ | ||
import {Except} from './except'; | ||
/** | ||
@@ -26,3 +28,3 @@ Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type. | ||
// Pick just the keys that are not optional from the base type. | ||
Pick<BaseType, Exclude<keyof BaseType, Keys>> & | ||
Except<BaseType, Keys> & | ||
// Pick the keys that should be optional from the base type and make them optional. | ||
@@ -29,0 +31,0 @@ Partial<Pick<BaseType, Keys>> extends |
@@ -0,1 +1,3 @@ | ||
import {Except} from './except'; | ||
/** | ||
@@ -26,3 +28,3 @@ Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type. | ||
// Pick just the keys that are not required from the base type. | ||
Pick<BaseType, Exclude<keyof BaseType, Keys>> & | ||
Except<BaseType, Keys> & | ||
// Pick the keys that should be required from the base type and make them required. | ||
@@ -29,0 +31,0 @@ Required<Pick<BaseType, Keys>> extends |
Sorry, the diff of this file is not supported yet
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
87136
26
1816
641