Home Reference Source Test Repository

buildDocs/utils/copyMetaData.js

import { forOwn } from 'lodash';
/**
 * Used to copy over meta data from function to function.
 * If meta data is attached to a function. This can get lost
 * when wrapping functions. This tries to persist that.
 * @private
 */
export function copyMetadata(to, from) {
    forOwn(from, (value, key) => to[key] = value);
    return to;
}