UNPKG

@base-framework/base

Version:

This is a javascript framework.

63 lines (62 loc) 2.43 kB
export namespace Objects { /** * Creates a new object, optionally extending from another object. * * @param {object} [prototype] - The prototype object to extend from. * @returns {object} The newly created object. */ function create(prototype?: object): object; /** * Extends properties from the source object to the target object. * Only copies properties that are not already defined on the target object. * * @param {object} sourceObj - The source object. * @param {object} targetObj - The target object to extend. * @returns {object|false} The extended target object or false if invalid. */ function extendObject(sourceObj: object, targetObj: object): object | false; /** * Deep clones an object in a safe and scalable manner. * * @param {object} obj - The object to clone. * @returns {object} A deep clone of the object. */ function clone(obj: object): object; /** * Retrieves the prototype of a class or object. * * @param {function|object} entity - The class or object. * @returns {object} The prototype of the entity. */ function getClassObject(entity: Function | object): object; /** * Extends a class or object with the properties of another class or object. * * @param {function|object} sourceClass - The source class or object. * @param {function|object} targetClass - The target class or object. * @returns {object|false} The resulting extended object or false if invalid. */ function extendClass(sourceClass: Function | object, targetClass: Function | object): object | false; /** * Checks if an object has a specific property. * * @param {object} obj - The object to check. * @param {string} prop - The property to check for. * @returns {boolean} True if the object has the property. */ function hasOwnProp(obj: object, prop: string): boolean; /** * Determines if a value is a plain object. * * @param {object} obj - The value to check. * @returns {boolean} True if the value is a plain object. */ function isPlainObject(obj: object): boolean; /** * Checks if an object is empty. * * @param {object} obj - The object to check. * @returns {boolean} True if the object has no own properties. */ function isEmpty(obj: object): boolean; }