source: imaps-frontend/node_modules/lodash-es/_getFuncName.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 754 bytes
Line 
1import realNames from './_realNames.js';
2
3/** Used for built-in method references. */
4var objectProto = Object.prototype;
5
6/** Used to check objects for own properties. */
7var hasOwnProperty = objectProto.hasOwnProperty;
8
9/**
10 * Gets the name of `func`.
11 *
12 * @private
13 * @param {Function} func The function to query.
14 * @returns {string} Returns the function name.
15 */
16function getFuncName(func) {
17 var result = (func.name + ''),
18 array = realNames[result],
19 length = hasOwnProperty.call(realNames, result) ? array.length : 0;
20
21 while (length--) {
22 var data = array[length],
23 otherFunc = data.func;
24 if (otherFunc == null || otherFunc == func) {
25 return data.name;
26 }
27 }
28 return result;
29}
30
31export default getFuncName;
Note: See TracBrowser for help on using the repository browser.