| 1 | /**
|
|---|
| 2 | * Iterates over an object's properties in reverse order and calls the `iteratee` function for each property.
|
|---|
| 3 | *
|
|---|
| 4 | * It only iterates over the object's own properties, not including inherited properties or properties with `Symbol` keys.
|
|---|
| 5 | *
|
|---|
| 6 | * The `iteratee` function can terminate the iteration early by returning `false`.
|
|---|
| 7 | *
|
|---|
| 8 | * @template T - The type of the object.
|
|---|
| 9 | * @param {T} object The object to iterate over.
|
|---|
| 10 | * @param {(value: T[keyof T], key: string, collection: T) => any} [iteratee=identity] The function invoked per iteration. If not provided, the identity function will be used.
|
|---|
| 11 | * @return {T} Returns object.
|
|---|
| 12 | *
|
|---|
| 13 | * @example
|
|---|
| 14 | * function Foo() {
|
|---|
| 15 | * this.a = 1;
|
|---|
| 16 | * this.b = 2;
|
|---|
| 17 | * }
|
|---|
| 18 | *
|
|---|
| 19 | * Foo.prototype.c = 3;
|
|---|
| 20 | *
|
|---|
| 21 | * forOwnRight(new Foo(), function(value, key) {
|
|---|
| 22 | * console.log(key);
|
|---|
| 23 | * });
|
|---|
| 24 | * // => Logs 'b' then 'a' (iteration order is not guaranteed).
|
|---|
| 25 | */
|
|---|
| 26 | declare function forOwnRight<T>(object: T, iteratee?: (value: T[keyof T], key: string, collection: T) => any): T;
|
|---|
| 27 | /**
|
|---|
| 28 | * Iterates over an object's properties in reverse order and calls the `iteratee` function for each property.
|
|---|
| 29 | *
|
|---|
| 30 | * It only iterates over the object's own properties, not including inherited properties or properties with `Symbol` keys.
|
|---|
| 31 | *
|
|---|
| 32 | * The `iteratee` function can terminate the iteration early by returning `false`.
|
|---|
| 33 | *
|
|---|
| 34 | * @template T - The type of the object.
|
|---|
| 35 | * @param {T | null | undefined} object The object to iterate over.
|
|---|
| 36 | * @param {(value: T[keyof T], key: string, collection: T) => any} [iteratee=identity] The function invoked per iteration. If not provided, the identity function will be used.
|
|---|
| 37 | * @return {T | null | undefined} Returns object.
|
|---|
| 38 | *
|
|---|
| 39 | * @example
|
|---|
| 40 | * function Foo() {
|
|---|
| 41 | * this.a = 1;
|
|---|
| 42 | * this.b = 2;
|
|---|
| 43 | * }
|
|---|
| 44 | *
|
|---|
| 45 | * Foo.prototype.c = 3;
|
|---|
| 46 | *
|
|---|
| 47 | * forOwnRight(new Foo(), function(value, key) {
|
|---|
| 48 | * console.log(key);
|
|---|
| 49 | * });
|
|---|
| 50 | * // => Logs 'b' then 'a' (iteration order is not guaranteed).
|
|---|
| 51 | */
|
|---|
| 52 | declare function forOwnRight<T>(object: T | null | undefined, iteratee?: (value: T[keyof T], key: string, collection: T) => any): T | null | undefined;
|
|---|
| 53 |
|
|---|
| 54 | export { forOwnRight };
|
|---|