@bscotch/utility
Advanced tools
Comparing version 1.1.0 to 1.1.1
export declare type EmptyArray = []; | ||
export declare type HttpMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS'; | ||
export declare type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>; | ||
@@ -11,10 +12,7 @@ export declare type RequiredBy<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>; | ||
export declare type ExtractKeysByValue<Container, ValueTypeFilter> = { | ||
[Key in keyof Container]-?: Container[Key] extends ValueTypeFilter ? Key : never; | ||
[Key in keyof Container]-?: Container[Key] extends Function ? ValueTypeFilter extends Container[Key] ? Key : never : Container[Key] extends ValueTypeFilter ? Key : never; | ||
}[keyof Container]; | ||
export declare type ExcludeKeysByValue<Container, ValueTypeFilter> = { | ||
[Key in keyof Container]-?: Container[Key] extends ValueTypeFilter ? never : Key; | ||
}[keyof Container]; | ||
export declare type ExcludeKeysByValue<Container, ValueTypeFilter> = Exclude<keyof Container, ExtractKeysByValue<Container, ValueTypeFilter>>; | ||
export declare type PickByValue<Container, ValueTypeFilter> = Pick<Container, ExtractKeysByValue<Container, ValueTypeFilter>>; | ||
export declare type OmitByValue<Container, ValueTypeFilter> = Pick<Container, ExcludeKeysByValue<Container, ValueTypeFilter>>; | ||
export declare type HttpMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS'; | ||
export declare type OmitByValue<Container, ValueTypeFilter> = Omit<Container, ExtractKeysByValue<Container, ValueTypeFilter>>; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -0,1 +1,10 @@ | ||
## [1.1.1](https://github.com/bscotch/node-util/compare/v1.1.0...v1.1.1) (2021-04-16) | ||
### Bug Fixes | ||
* Update ExtractKeysByValue and related utility types to treat function-type filters differently. Type narrowing with functions in Typescript is weird and not very useful, this way is more likely to do what the user expects. ([573d862](https://github.com/bscotch/node-util/commit/573d8620eae4fd1b9c00e1d093098f64857188db)) | ||
# [1.1.0](https://github.com/bscotch/node-util/compare/v1.0.0...v1.1.0) (2021-04-15) | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "@bscotch/utility", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Bscotch Utilities: Methods for common Node.js needs.", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
99263
1209