_baseSetData.js 454 B

1234567891011121314151617
  1. import identity from './identity.js';
  2. import metaMap from './_metaMap.js';
  3. /**
  4. * The base implementation of `setData` without support for hot loop shorting.
  5. *
  6. * @private
  7. * @param {Function} func The function to associate metadata with.
  8. * @param {*} data The metadata.
  9. * @returns {Function} Returns `func`.
  10. */
  11. var baseSetData = !metaMap ? identity : function(func, data) {
  12. metaMap.set(func, data);
  13. return func;
  14. };
  15. export default baseSetData;