PHP 8.2.30
Preview: index.js Size: 988 B
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/fn.name/index.js

'use strict';

var toString = Object.prototype.toString;

/**
 * Extract names from functions.
 *
 * @param {Function} fn The function who's name we need to extract.
 * @returns {String} The name of the function.
 * @public
 */
module.exports = function name(fn) {
  if ('string' === typeof fn.displayName && fn.constructor.name) {
    return fn.displayName;
  } else if ('string' === typeof fn.name && fn.name) {
    return fn.name;
  }

  //
  // Check to see if the constructor has a name.
  //
  if (
       'object' === typeof fn
    && fn.constructor
    && 'string' === typeof fn.constructor.name
  ) return fn.constructor.name;

  //
  // toString the given function and attempt to parse it out of it, or determine
  // the class.
  //
  var named = fn.toString()
    , type = toString.call(fn).slice(8, -1);

  if ('Function' === type) {
    named = named.substring(named.indexOf('(') + 1, named.indexOf(')'));
  } else {
    named = type;
  }

  return named || 'anonymous';
};

Directory Contents

Dirs: 0 × Files: 7

Name Size Perms Modified Actions
25 B lrw-r--r-- 2026-02-21 00:53:18
Edit Download
181 B lrw-r--r-- 2026-02-21 00:53:20
Edit Download
988 B lrw-r--r-- 2026-02-21 00:53:22
Edit Download
1.09 KB lrw-r--r-- 2026-02-21 00:53:22
Edit Download
883 B lrw-r--r-- 2026-02-21 00:53:16
Edit Download
1.10 KB lrw-r--r-- 2026-02-21 00:53:24
Edit Download
1.84 KB lrw-r--r-- 2026-02-21 00:53:24
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).