import { isEqual } from "../internal/utils.js"; /** * Creates a shallow clone of value. * * @param value - The value to clone * @returns Returns the cloned value * * @example * const objects = [{ 'a': 1 }, { 'b': 2 }]; * const shallow = clone(objects); * console.log(shallow[0] === objects[0]); * // => true */ export declare function shallowClone(value: T): T; /** * This method is like `clone` except that it recursively clones value. * * @param value - The value to recursively clone * @returns Returns the deep cloned value * * @example * const objects = [{ 'a': 1 }, { 'b': 2 }]; * const deep = cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ export declare function cloneDeep(value: T): T; /** * This method is like `cloneDeep` except that it accepts customizer which * is invoked to produce the cloned value. * * @param value - The value to recursively clone * @param customizer - The function to customize cloning * @returns Returns the deep cloned value */ export declare function cloneDeepWith(value: T, customizer?: (value: any, key?: string | number | symbol, object?: any, stack?: any) => any): T; /** * Checks if object conforms to source by invoking the predicate properties * of source with the corresponding property values of object. * * @param object - The object to inspect * @param source - The object of property predicates to conform to * @returns Returns true if object conforms, else false * * @example * const object = { 'a': 1, 'b': 2 }; * * conformsTo(object, { 'b': n => n > 1 }); * // => true * * conformsTo(object, { 'b': n => n > 2 }); * // => false */ export declare function conformsTo(object: T, source: Partial boolean>>): boolean; /** * Performs a deep comparison between two values to determine if they are * equivalent. * * @param value - The value to compare * @param other - The other value to compare * @returns Returns true if the values are equivalent, else false * * @example * const object = { 'a': 1 }; * const other = { 'a': 1 }; * * isEqual(object, other); * // => true * * object === other; * // => false */ export { isEqual }; /** * Creates an object composed of the picked object properties. * * @param object - The source object * @param paths - The property paths to pick * @returns Returns the new object * * @example * const object = { 'a': 1, 'b': '2', 'c': 3 }; * * pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ export declare function pick(object: T, paths: readonly K[]): Pick; /** * The opposite of `pick`; this method creates an object composed of the * own and inherited enumerable property paths of object that are not omitted. * * @param object - The source object * @param paths - The property paths to omit * @returns Returns the new object * * @example * const object = { 'a': 1, 'b': '2', 'c': 3 }; * * omit(object, ['a', 'c']); * // => { 'b': '2' } */ export declare function omit(object: T, paths: readonly K[]): Omit; /** * This method is like `pick` except that it picks object properties not * listed in the given array of property names. * * @param object - The source object * @param predicate - The function invoked per property * @returns Returns the new object */ export declare function pickBy(object: T, predicate?: (value: any, key: string) => boolean): Partial; /** * The opposite of `pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of object that * predicate doesn't return truthy for. * * @param object - The source object * @param predicate - The function invoked per property * @returns Returns the new object */ export declare function omitBy(object: T, predicate?: (value: any, key: string) => boolean): Partial; /** * Creates an array of own enumerable property names of object. * * @param object - The object to query * @returns Returns the array of property names * * @example * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) */ export declare function keys(object?: T): string[]; /** * Creates an array of the own enumerable property names and symbols of object. * * @param object - The object to query * @returns Returns the array of property names and symbols */ export declare function keysIn(object?: T): string[]; /** * Creates an array of own enumerable string keyed-value pairs for object * which can be consumed by `fromPairs`. * * @param object - The object to query * @returns Returns the key-value pairs * * @example * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ export declare function toPairs(object?: T): Array<[string, any]>; /** * Creates an array of own and inherited enumerable string keyed-value * pairs for object which can be consumed by `fromPairs`. * * @param object - The object to query * @returns Returns the key-value pairs */ export declare function toPairsIn(object?: T): Array<[string, any]>; /** * Creates an array of own enumerable property values of object. * * @param object - The object to query * @returns Returns the array of property values * * @example * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * values('hi'); * // => ['h', 'i'] */ export declare function values(object?: T): any[]; /** * Creates an array of own and inherited enumerable property values of object. * * @param object - The object to query * @returns Returns the array of property values */ export declare function valuesIn(object?: T): any[]; /** * Iterates over own enumerable string keyed properties of an object and * invokes iteratee for each property. * * @param object - The object to iterate over * @param iteratee - The function invoked per iteration * @returns Returns object * * @example * forOwn({ 'a': 1, 'b': 2 }, (value, key) => { * console.log(key); * }); * // => Logs 'a' then 'b' */ export declare function forOwn(object: T, iteratee?: (value: any, key: string, object: T) => void | boolean): T; /** * This method is like `forOwn` except that it iterates over properties of * object in the opposite order. * * @param object - The object to iterate over * @param iteratee - The function invoked per iteration * @returns Returns object */ export declare function forOwnRight(object: T, iteratee?: (value: any, key: string, object: T) => void | boolean): T; /** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes iteratee for each property. * * @param object - The object to iterate over * @param iteratee - The function invoked per iteration * @returns Returns object * * @example * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * forIn(new Foo, (value, key) => { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' */ export declare function forIn(object: T, iteratee?: (value: any, key: string, object: T) => void | boolean): T; /** * This method is like `forIn` except that it iterates over properties of * object in the opposite order. * * @param object - The object to iterate over * @param iteratee - The function invoked per iteration * @returns Returns object */ export declare function forInRight(object: T, iteratee?: (value: any, key: string, object: T) => void | boolean): T; /** * Creates an object with the same keys as object and values generated * by running each own enumerable string keyed property of object thru iteratee. * * @param object - The object to iterate over * @param iteratee - The function invoked per iteration * @returns Returns the new mapped object * * @example * const users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * mapValues(users, o => o.age); * // => { 'fred': 40, 'pebbles': 1 } */ export declare function mapValues(object: Record, iteratee?: (value: T, key: string, object: Record) => U): Record; /** * Creates an object with the same values as object and keys generated * by running each own enumerable string keyed property of object thru iteratee. * * @param object - The object to iterate over * @param iteratee - The function invoked per iteration * @returns Returns the new mapped object * * @example * mapKeys({ 'a': 1, 'b': 2 }, (value, key) => key + value); * // => { 'a1': 1, 'b2': 2 } */ export declare function mapKeys(object: Record, iteratee?: (value: T, key: string, object: Record) => string): Record; /** * Creates an array of own enumerable string keyed-value pairs for object. * * @param object - The object to query * @returns Returns the key-value pairs * * @example * entries({ 'a': 1, 'b': 2 }); * // => [['a', 1], ['b', 2]] */ export declare function entries(object?: T): Array<[string, any]>; /** * Creates an array of own and inherited enumerable string keyed-value pairs for object. * * @param object - The object to query * @returns Returns the key-value pairs */ export declare function entriesIn(object?: T): Array<[string, any]>; /** * Assigns own enumerable string keyed properties of source objects to the * destination object. * * @param object - The destination object * @param sources - The source objects * @returns Returns object * * @example * assign({ 'a': 0 }, { 'b': 1 }, { 'c': 2 }); * // => { 'a': 0, 'b': 1, 'c': 2 } */ export declare function assign>(object: T, ...sources: Array | null | undefined>): T; /** * This method is like `assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. * * @param object - The destination object * @param sources - The source objects * @returns Returns object * * @example * const object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * const other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ export declare function merge>(object: T, ...sources: Array | null | undefined>): T; /** * Creates an object composed of the inverted keys and values of object. * * @param object - The object to invert * @returns Returns the new inverted object * * @example * invert({ 'a': 1, 'b': 2, 'c': 1 }); * // => { '1': 'c', '2': 'b' } */ export declare function invert>(object: T): Record; /** * Checks if path is a direct property of object. * * @param object - The object to query * @param path - The path to check * @returns Returns true if path exists, else false * * @example * has({ 'a': { 'b': 2 } }, 'a'); * // => true * * has({ 'a': { 'b': 2 } }, 'a.b'); * // => true */ export declare function has(object: T, path: string | string[]): boolean; /** * Creates an object composed of the own and inherited enumerable property * paths of object that are not omitted. * * @param object - The source object * @returns Returns the new object * * @example * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ export declare function defaults>(object: T, ...sources: Array | null | undefined>): T;