mirror of
https://github.com/dzeiocom/libs.git
synced 2025-04-22 10:52:11 +00:00
fix: missing exports
This commit is contained in:
parent
e7ceb74c73
commit
3793a3c450
@ -392,7 +392,7 @@ export function objectGet<T = any>(obj: any, path: Array<string | number | symbo
|
|||||||
* @param keys the keys to keep
|
* @param keys the keys to keep
|
||||||
* @returns a new copy of `obj` with only `keys` in it
|
* @returns a new copy of `obj` with only `keys` in it
|
||||||
*/
|
*/
|
||||||
function objectPick<V, K extends string | number | symbol>(obj: Record<K, V>, ...keys: Array<K>): Pick<Record<K, V>, K> {
|
export function objectPick<V, K extends string | number | symbol>(obj: Record<K, V>, ...keys: Array<K>): Pick<Record<K, V>, K> {
|
||||||
mustBeObject(obj)
|
mustBeObject(obj)
|
||||||
return objectFilter(obj, (_, k) => keys.includes(k)) as Pick<Record<K, V>, K>
|
return objectFilter(obj, (_, k) => keys.includes(k)) as Pick<Record<K, V>, K>
|
||||||
}
|
}
|
||||||
@ -404,7 +404,7 @@ function objectPick<V, K extends string | number | symbol>(obj: Record<K, V>, ..
|
|||||||
* @param fn the function to pass it through
|
* @param fn the function to pass it through
|
||||||
* @returns the filtered object
|
* @returns the filtered object
|
||||||
*/
|
*/
|
||||||
function objectFilter<V, K extends string | number | symbol>(obj: Record<K, V>, fn: (v: V, k: K, idx: number) => boolean): Partial<Record<K, V>> {
|
export function objectFilter<V, K extends string | number | symbol>(obj: Record<K, V>, fn: (v: V, k: K, idx: number) => boolean): Partial<Record<K, V>> {
|
||||||
mustBeObject(obj)
|
mustBeObject(obj)
|
||||||
const clone: Partial<Record<K, V>> = {}
|
const clone: Partial<Record<K, V>> = {}
|
||||||
objectLoop(obj, (v, k, idx) => {
|
objectLoop(obj, (v, k, idx) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user