Socket
Socket
Sign inDemoInstall

function.prototype.name

Package Overview
Dependencies
64
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    function.prototype.name

An ES2015 spec-compliant `Function.prototype.name` shim


Version published
Weekly downloads
29M
increased by0.03%
Maintainers
1
Install size
1.79 MB
Created
Weekly downloads
 

Changelog

Source

v1.1.6 - 2023-08-28

Commits

<!-- auto-changelog-above -->

1.1.5 / 2021-10-01

  • [Deps] update es-abstract
  • [meta] use prepublishOnly script for npm 7+
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, aud, tape
  • [actions] update workflows
  • [actions] use node/install instead of node/run; use codecov action

1.1.4 / 2021-02-22

  • [readme] remove travis badge
  • [meta] remove audit-level
  • [meta] gitignore coverage output
  • [meta] do not publish github action workflow files
  • [Deps] update call-bind, es-abstract, functions-have-names
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, has-strict-mode, tape
  • [Tests] increase coverage
  • [actions] update workflows

1.1.3 / 2020-11-27

  • [Deps] update es-abstract, functions-have-names; use call-bind where applicable
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape, make-arrow-function, make-generator-function; add aud, make-async-function
  • [actions] add "Allow Edits" workflow
  • [actions] switch Automatic Rebase workflow to pull_request_target event
  • [Tests] migrate tests to Github Actions
  • [Tests] run nyc on all tests
  • [Tests] add implementation test; run es-shim-api in postlint; use tape runner
  • [Tests] only audit prod deps

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

  • [Refactor] use functions-have-names
  • [meta] clean up package.json scripts
  • [meta] update links
  • [meta] create FUNDING.yml
  • [Deps] update is-callable, define-properties
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape, safe-publish-latest, covert
  • [Tests] use eccheck over editorconfig-tools
  • [Tests] use npx aud instead of nsp or npm audit with hoops
  • [Tests] up to node v11.7, v10.15, v9.11, v8.15, v6.16, v4.9
  • [Test] remove jscs

1.1.0 / 2017-12-31

  • [New] add auto entry point
  • [Deps] update function-bind
  • [Dev Deps] update uglify-register, tape, nsp, eslint, @ljharb/eslint-config, @es-shims/api
  • [Tests] up to node v9.3, v8.9, v6.12; use nvm install-latest-npm; pin included builds to LTS

1.0.3 / 2017-07-21

  • [Fix] be robust against function name mangling
  • [Refactor] move function name detection to separate file

1.0.2 / 2017-07-14

  • [Refactor] shim: Remove unnecessary !functionsHaveNames check

1.0.1 / 2017-07-11

  • [Fix] in IE 9-11, we must rely on .call being available (#13)
  • [Fix] ensure that Function.prototype.name does not erase the getter
  • [Deps] update is-callable
  • [Dev Deps] add safe-publish-latest
  • [Dev Deps] update tape, jscs, nsp, eslint, @ljharb/eslint-config, @es-shims/api
  • [Tests] up to node v8.1; v7.10, v6.11, v4.8; improve matrix; newer npm fails on older nodes
  • [Tests] use Object to avoid function name inference in node 7

1.0.0 / 2016-02-27

  • Initial release.

Readme

Source

function.prototype.name Version Badge

dependency status dev dependency status License Downloads

npm badge

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.

This package implements the es-shim API interface. It works in an ES5-supported environment and complies with the spec.

Most common usage:

Example

var functionName = require('function.prototype.name');
var assert = require('assert');

assert.equal(functionName(function foo() {}), 'foo');

functionName.shim();
assert.equal(function foo() {}.name, 'foo');

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Last updated on 02 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc