Sha256: dfaa1bafcf33f44164fb81fed925d4a2987f280eec2f6f7d16474c22368fadcd

Contents?: true

Size: 429 Bytes

Versions: 100

Compression:

Stored size: 429 Bytes

Contents

/*!
 * Chai - getName utility
 * Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
 * MIT Licensed
 */

/**
 * # getName(func)
 *
 * Gets the name of a function, in a cross-browser way.
 *
 * @param {Function} a function (usually a constructor)
 */

module.exports = function (func) {
  if (func.name) return func.name;

  var match = /^\s?function ([^(]*)\(/.exec(func);
  return match && match[1] ? match[1] : "";
};

Version data entries

100 entries across 68 versions & 1 rubygems

Version Path
ende-0.2.18 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.17 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.16 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.15 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.14 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.13 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.12 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.11 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.10 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.3 vendor/assets/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.3 vendor/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.3 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.2 vendor/assets/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.2 vendor/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.2 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.1 vendor/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.1 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.1 vendor/assets/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.0 vendor/assets/components/chaijs-chai/lib/chai/utils/getName.js
ende-0.2.0 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js