@newdash/newdash
Version:
javascript/typescript utility library
35 lines (34 loc) • 878 B
TypeScript
/**
* Assigns own enumerable string keyed properties of source objects to the
* destination object. Source objects are applied from left to right.
* Subsequent sources overwrite property assignments of previous sources.
*
* **Note:** This method mutates `object` and is loosely based on
* [`Object.assign`](https://mdn.io/Object/assign).
*
* @since 5.5.0
* @category Object
* @param object The destination object.
* @param sources The source objects.
* @returns Returns `object`.
* @see [[assignIn]]
* @example
*
* ```js
* function Foo() {
* this.a = 1;
* }
*
* function Bar() {
* this.c = 3;
* }
*
* Foo.prototype.b = 2;
* Bar.prototype.d = 4;
*
* assign({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'c': 3 }
* ```
*/
export declare function assign(target: any, ...args: any[]): any;
export default assign;