@newdash/newdash
Version:
javascript/typescript utility library
20 lines (19 loc) • 788 B
TypeScript
export default mergeData;
/**
* Merges the function metadata of `source` into `data`.
*
* Merging metadata reduces the number of wrappers used to invoke a function.
* This is possible because methods like `bind`, `curry`, and `partial`
* may be applied regardless of execution order. Methods like `ary` and
* `rearg` modify function arguments, making the order in which they are
* executed important, preventing the merging of metadata. However, we make
* an exception for a safe combined case where curried functions have `ary`
* and or `rearg` applied.
*
* @private
* @ignore
* @param {Array} data The destination metadata.
* @param {Array} source The source metadata.
* @returns {Array} Returns `data`.
*/
declare function mergeData(data: any[], source: any[]): any[];