UNPKG

1.32 kBTypeScriptView Raw
1import type { Thunk, ObjMap } from './definitions';
2export declare function resolveMaybeThunk<T>(thingOrThunk: Thunk<T>): T;
3export declare function camelCase(str: string): string;
4export declare function getPluralName(name: string): string;
5export declare function upperFirst(str: string): string;
6export declare function clearName(str: string): string;
7export declare function omit(obj: Record<any, any>, keys: string | string[]): Record<any, any>;
8export declare function only(obj: Record<any, any>, keys: string | string[]): Record<any, any>;
9export declare function inspect(value: unknown): string;
10export declare function forEachKey<V>(obj: {
11 [key: string]: V;
12} | ObjMap<V>, callback: (value: V, key: string) => void): void;
13export declare function mapEachKey<NewV = any, T extends Object | undefined = {}>(obj: T, callback: (value: NonNullable<T>[keyof NonNullable<T>], key: keyof NonNullable<T>) => NewV): T extends undefined ? undefined : ObjMap<NewV>;
14export declare function keyValMap<T, V>(list: ReadonlyArray<T>, keyFn: (item: T) => string, valFn: (item: T) => V): ObjMap<V>;
15export declare function keyMap<T>(list: ReadonlyArray<T>, keyFn: (item: T) => string): ObjMap<T>;
16export declare function invariant(condition: unknown, message?: string): asserts condition;
17//# sourceMappingURL=misc.d.ts.map
\No newline at end of file