@newdash/newdash
Version:
javascript/typescript utility library
18 lines (17 loc) • 573 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const GLOBAL_1 = require("./GLOBAL");
const identity_1 = require("./identity");
/**
* The base implementation of `setData` without support for hot loop shorting.
*
* @private
* @param {Function} func The function to associate metadata with.
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
const baseSetData = !GLOBAL_1.metaMap ? identity_1.identity : function (func, data) {
GLOBAL_1.metaMap.set(func, data);
return func;
};
exports.default = baseSetData;