UNPKG

sikits

Version:

A powerful and comprehensive utility library for JavaScript and TypeScript with 100+ functions for strings, numbers, arrays, and objects

16 lines (15 loc) 1.36 kB
export declare const deepClone: <T>(obj: T) => T; export declare const mergeObjects: <T extends object, U extends object>(obj1: T, obj2: U) => T & U; export declare const isEmptyObject: (obj: Record<string, unknown>) => boolean; export declare const getNestedValue: <T extends Record<string, any>, K extends keyof T>(obj: T, key: K) => T[K]; export declare const setNestedValue: (obj: Record<string, any>, path: string, value: any) => void; export declare const pick: <T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]) => Pick<T, K>; export declare const omit: <T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]) => Omit<T, K>; export declare const toQueryString: (obj: Record<string, any>) => string; export declare const fromQueryString: (query: string) => Record<string, string>; export declare const deepFreeze: <T>(obj: T) => Readonly<T>; export declare const flattenObject: (obj: Record<string, any>, prefix?: string) => Record<string, any>; export declare const unflattenObject: (obj: Record<string, any>) => Record<string, any>; export declare const findDeepKey: (obj: any, targetKey: string) => any; export declare const mapKeys: <T>(obj: Record<string, T>, fn: (key: string) => string) => Record<string, T>; export declare const mapValues: <T, U>(obj: Record<string, T>, fn: (value: T) => U) => Record<string, U>;