Urara-Blog/node_modules/.pnpm-store/v3/files/1d/4f9393b1b6cb3b9e64527edddf25192dcb0711442b61cfa4696c0cc58ff920c9a0caf4dd98b9872e54c7944c8e11e9b6c10a5b5d8841dcde3b5dbc623f7784
2022-08-14 01:14:53 +08:00

31 lines
756 B
Text

var realNames = require('./_realNames');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the name of `func`.
*
* @private
* @param {Function} func The function to query.
* @returns {string} Returns the function name.
*/
function getFuncName(func) {
var result = (func.name + ''),
array = realNames[result],
length = hasOwnProperty.call(realNames, result) ? array.length : 0;
while (length--) {
var data = array[length],
otherFunc = data.func;
if (otherFunc == null || otherFunc == func) {
return data.name;
}
}
return result;
}
module.exports = getFuncName;