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

function.prototype.name

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function.prototype.name - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

.github/workflows/rebase.yml

10

CHANGELOG.md

@@ -0,1 +1,11 @@

1.1.2 / 2019-12-14
=================
* [Refactor] use `es-abstract`
* [Deps] update `functions-have-names`
* [meta] add `funding` field
* [meta] fix repo capitalization
* [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`
* [Tests] use shared travis-ci configs
* [actions] add automatic rebasing / merge commit blocking
1.1.1 / 2019-07-24

@@ -2,0 +12,0 @@ =================

18

implementation.js
'use strict';
var isCallable = require('is-callable');
var IsCallable = require('es-abstract/2019/IsCallable');
var functionsHaveNames = require('functions-have-names')();
var bind = require('function-bind');
var functionToString = bind.call(Function.call, Function.prototype.toString);
var stringMatch = bind.call(Function.call, String.prototype.match);
var callBound = require('es-abstract/helpers/callBound');
var $functionToString = callBound('Function.prototype.toString');
var $stringMatch = callBound('String.prototype.match');

@@ -12,3 +12,3 @@ var classRegex = /^class /;

var isClass = function isClassConstructor(fn) {
if (isCallable(fn)) {
if (IsCallable(fn)) {
return false;

@@ -20,3 +20,3 @@ }

try {
var match = stringMatch(functionToString(fn), classRegex);
var match = $stringMatch($functionToString(fn), classRegex);
return !!match;

@@ -32,3 +32,3 @@ } catch (e) {}

module.exports = function getName() {
if (!isClass(this) && !isCallable(this)) {
if (!isClass(this) && !IsCallable(this)) {
throw new TypeError('Function.prototype.name sham getter called on non-function');

@@ -42,6 +42,6 @@ }

}
var str = functionToString(this);
var match = stringMatch(str, regex);
var str = $functionToString(this);
var match = $stringMatch(str, regex);
var name = match && match[1];
return name;
};
'use strict';
var define = require('define-properties');
var bind = require('function-bind');
var callBind = require('es-abstract/helpers/callBind');

@@ -10,3 +10,3 @@ var implementation = require('./implementation');

var bound = bind.call(Function.call, implementation);
var bound = callBind(implementation);

@@ -13,0 +13,0 @@ define(bound, {

{
"name": "function.prototype.name",
"version": "1.1.1",
"author": "Jordan Harband",
"description": "An ES6 spec-compliant `Function.prototype.name` shim",
"version": "1.1.2",
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"description": "An ES2015 spec-compliant `Function.prototype.name` shim",
"license": "MIT",

@@ -20,8 +23,10 @@ "main": "index.js",

"type": "git",
"url": "git://github.com/es-shims/function.prototype.name.git"
"url": "git://github.com/es-shims/Function.prototype.name.git"
},
"keywords": [
"Function.prototype.name",
"function",
"name",
"ES6",
"ES2015",
"shim",

@@ -33,15 +38,14 @@ "polyfill",

"define-properties": "^1.1.3",
"function-bind": "^1.1.1",
"functions-have-names": "^1.1.1",
"is-callable": "^1.1.4"
"es-abstract": "^1.17.0-next.1",
"functions-have-names": "^1.2.0"
},
"devDependencies": {
"@es-shims/api": "^2.1.2",
"@ljharb/eslint-config": "^13.1.1",
"@ljharb/eslint-config": "^15.0.2",
"covert": "^1.1.1",
"eclint": "^2.8.1",
"eslint": "^5.16.0",
"eslint": "^6.7.2",
"make-arrow-function": "^1.1.0",
"make-generator-function": "^1.1.0",
"safe-publish-latest": "^1.1.2",
"safe-publish-latest": "^1.1.4",
"tape": "^4.11.0",

@@ -48,0 +52,0 @@ "uglify-register": "^1.0.1"

@@ -11,3 +11,3 @@ # function.prototype.name <sup>[![Version Badge][2]][1]</sup>

An ES6 spec-compliant `Function.prototype.name` shim. Invoke its "shim" method to shim Function.prototype.name if it is unavailable.
An ES2015 spec-compliant `Function.prototype.name` shim. Invoke its "shim" method to shim Function.prototype.name if it is unavailable.
*Note*: `Function#name` requires a true ES5 environment - specifically, one with ES5 getters.

@@ -35,9 +35,9 @@

[1]: https://npmjs.org/package/function.prototype.name
[2]: http://versionbadg.es/es-shims/function.prototype.name.svg
[3]: https://travis-ci.org/es-shims/function.prototype.name.svg
[4]: https://travis-ci.org/es-shims/function.prototype.name
[5]: https://david-dm.org/es-shims/function.prototype.name.svg
[6]: https://david-dm.org/es-shims/function.prototype.name
[7]: https://david-dm.org/es-shims/function.prototype.name/dev-status.svg
[8]: https://david-dm.org/es-shims/function.prototype.name#info=devDependencies
[2]: http://versionbadg.es/es-shims/Function.prototype.name.svg
[3]: https://travis-ci.org/es-shims/Function.prototype.name.svg
[4]: https://travis-ci.org/es-shims/Function.prototype.name
[5]: https://david-dm.org/es-shims/Function.prototype.name.svg
[6]: https://david-dm.org/es-shims/Function.prototype.name
[7]: https://david-dm.org/es-shims/Function.prototype.name/dev-status.svg
[8]: https://david-dm.org/es-shims/Function.prototype.name#info=devDependencies
[11]: https://nodei.co/npm/function.prototype.name.png?downloads=true&stars=true

@@ -44,0 +44,0 @@ [license-image]: http://img.shields.io/npm/l/function.prototype.name.svg

Sorry, the diff of this file is not supported yet

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