Comparing version 0.1.2 to 0.1.3
/// <reference types="node" resolution-mode="require"/> | ||
import type * as FS from 'fs'; | ||
export declare function filterObject<T extends object, K extends keyof T>(object: T, ...keys: K[]): Omit<T, K>; | ||
export declare function filterObject<T extends object, K extends keyof T>(object: T, ...keys: K[]): Pick<T, K>; | ||
export declare function isJSON(str: string): boolean; | ||
@@ -5,0 +5,0 @@ export declare abstract class FileMap<V> implements Map<string, V> { |
{ | ||
"name": "utilium", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Typescript utilies", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import type * as FS from 'fs'; | ||
export function filterObject<T extends object, K extends keyof T>(object: T, ...keys: K[]): Omit<T, K> { | ||
export function filterObject<T extends object, K extends keyof T>(object: T, ...keys: K[]): Pick<T, K> { | ||
const entries = <[K, T[K]][]>Object.entries(object); | ||
return <Omit<T, K>>(<unknown>Object.fromEntries(entries.filter(([key]) => keys.includes(key)))); | ||
return <Pick<T, K>>Object.fromEntries(entries.filter(([key]) => keys.includes(key))); | ||
} | ||
@@ -7,0 +7,0 @@ |
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
23398