Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-function-name-x

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-function-name-x - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

5

index.js
/**
* @file Get the name of the function.
* @version 2.0.3
* @version 2.0.4
* @author Xotic750 <Xotic750@gmail.com>

@@ -26,4 +26,3 @@ * @copyright Xotic750

var normalise = require('normalize-space-x');
var x = '^(?:async )?(?:function|class) ?(?:\\* )?([\\w\\$]+)';
var reName = new RegExp(x, 'i');
var reName = /^(?:async )?(?:function|class) ?(?:\* )?([\w$]+)/i;
getFnName = function getName(fn) {

@@ -30,0 +29,0 @@ var match;

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.returnExports = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/**
* @file Get the name of the function.
* @version 2.0.3
* @version 2.0.4
* @author Xotic750 <Xotic750@gmail.com>

@@ -27,4 +27,3 @@ * @copyright Xotic750

var normalise = _dereq_('normalize-space-x');
var x = '^(?:async )?(?:function|class) ?(?:\\* )?([\\w\\$]+)';
var reName = new RegExp(x, 'i');
var reName = /^(?:async )?(?:function|class) ?(?:\* )?([\w$]+)/i;
getFnName = function getName(fn) {

@@ -31,0 +30,0 @@ var match;

4

lib/get-function-name-x.min.js
!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).returnExports=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module,exports){/**
* @file Get the name of the function.
* @version 2.0.3
* @version 2.0.4
* @author Xotic750 <Xotic750@gmail.com>

@@ -9,3 +9,3 @@ * @copyright Xotic750

*/
"use strict";var getFnName,isFunction=_dereq_("is-function-x");if("test1"===function test1(){}.name){var createsAnonymous="anonymous"===Function().name;getFnName=function _getName(fn){return createsAnonymous&&"anonymous"===fn.name?"":fn.name}}else{var replaceComments=_dereq_("replace-comments-x"),fToString=Function.prototype.toString,normalise=_dereq_("normalize-space-x"),reName=new RegExp("^(?:async )?(?:function|class) ?(?:\\* )?([\\w\\$]+)","i");getFnName=function getName(fn){var match;try{if(match=normalise(replaceComments(fToString.call(fn)," ")).match(reName)){var name=match[1];return"anonymous"===name?"":name}}catch(ignore){}return""}}module.exports=function getFunctionName(fn){return isFunction(fn,!0)?getFnName(fn):void 0}},{"is-function-x":4,"normalize-space-x":9,"replace-comments-x":10}],2:[function(_dereq_,module,exports){/**
"use strict";var getFnName,isFunction=_dereq_("is-function-x");if("test1"===function test1(){}.name){var createsAnonymous="anonymous"===Function().name;getFnName=function _getName(fn){return createsAnonymous&&"anonymous"===fn.name?"":fn.name}}else{var replaceComments=_dereq_("replace-comments-x"),fToString=Function.prototype.toString,normalise=_dereq_("normalize-space-x"),reName=/^(?:async )?(?:function|class) ?(?:\* )?([\w$]+)/i;getFnName=function getName(fn){var match;try{if(match=normalise(replaceComments(fToString.call(fn)," ")).match(reName)){var name=match[1];return"anonymous"===name?"":name}}catch(ignore){}return""}}module.exports=function getFunctionName(fn){return isFunction(fn,!0)?getFnName(fn):void 0}},{"is-function-x":4,"normalize-space-x":9,"replace-comments-x":10}],2:[function(_dereq_,module,exports){/**
* @file Tests if ES6 Symbol is supported.

@@ -12,0 +12,0 @@ * @version 1.4.0

{
"name": "get-function-name-x",
"version": "2.0.3",
"version": "2.0.4",
"description": "Get the name of the function.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/Xotic750/get-function-name-x",

@@ -26,3 +26,3 @@ <a href="https://travis-ci.org/Xotic750/get-function-name-x"

**Version**: 2.0.3
**Version**: 2.0.4
**Author**: Xotic750 <Xotic750@gmail.com>

@@ -29,0 +29,0 @@ **License**: [MIT](&lt;https://opensource.org/licenses/MIT&gt;)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc