Welcome to mirror list, hosted at ThFree Co, Russian Federation.

baseSetData.js « internal « lodash « node_modules « cli-table2 « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5c98622d8df155a77ab7cc9948ee6d3d27b2103b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var identity = require('../utility/identity'),
    metaMap = require('./metaMap');

/**
 * The base implementation of `setData` without support for hot loop detection.
 *
 * @private
 * @param {Function} func The function to associate metadata with.
 * @param {*} data The metadata.
 * @returns {Function} Returns `func`.
 */
var baseSetData = !metaMap ? identity : function(func, data) {
  metaMap.set(func, data);
  return func;
};

module.exports = baseSetData;