object-path-resolver
Version:
A simple object path resolver
9 lines (8 loc) • 544 B
TypeScript
import { GetValueOptions } from './get-value-from-obj-with-path';
type PathResolver = (value: any, path: string) => any;
export interface PathResolverOptions extends GetValueOptions {
sync?: boolean;
}
export declare function pathResolver<Options extends PathResolverOptions = PathResolverOptions>(obj: any, path: string, options?: Options): Options['sync'] extends true ? any : Promise<any>;
export declare function createPathResolver<Options extends PathResolverOptions = PathResolverOptions>(options?: Options): PathResolver;
export {};