@studiometa/js-toolkit
Version:
A set of useful little bits of JavaScript to boost your project! 🚀
12 lines (11 loc) • 527 B
TypeScript
/**
* Gets all non-builtin properties up the prototype chain.
*
* @param {Object} object
* The object to get the propeties from.
* @param {Array} [props=[]]
* The already existing properties.
* @param {(name:string, proto:any) => boolean} testFn
* @returns {Array<[string, Object]>} An array of properties and the prototype they belong to.
*/
export declare function getAllProperties(object: unknown, props?: Array<[string, unknown]>, testFn?: (name: string, proto: unknown) => boolean): Array<[string, unknown]>;