ES6 spec-compliant Function.prototype.name sham.
Installations
npm install function.prototype.name
Score
71.4
Supply Chain
83.5
Quality
75.2
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Developer
es-shims
Developer Guide
Module System
CommonJS
Min. Node Version
>= 0.4
Typescript Support
No
Node Version
20.5.1
NPM Version
9.8.0
Statistics
11 Stars
122 Commits
6 Forks
5 Watching
1 Branches
2 Contributors
Updated on 05 May 2024
Bundle Size
20.21 kB
Minified
5.87 kB
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
3,668,887,405
Last day
-5.9%
5,645,470
Compared to previous day
Last week
1.8%
32,566,955
Compared to previous week
Last month
7.9%
135,498,614
Compared to previous month
Last year
29.9%
1,431,399,186
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
function.prototype.name
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
1var functionName = require('function.prototype.name'); 2var assert = require('assert'); 3 4assert.equal(functionName(function foo() {}), 'foo'); 5 6functionName.shim(); 7assert.equal(function foo() {}.name, 'foo');
Supported engines
Automatically tested in every minor version of node.
Manually tested in:
- Safari: v4 - v15 (4, 5, 5.1, 6.0.5, 6.2, 7.1, 8, 9.1.3, 10.1.2, 11.1.2, 12.1, 13.1.2, 14.1.2, 15.3, 15.6.1)
- Chrome: v15 - v81, v83 - v106(every integer version)
- Note: This includes Edge v80+ and Opera v15+, which matches Chrome
- Firefox: v3, v3.6, v4 - v105 (every integer version)
- Note: in v42 - v63,
Function.prototype.toString
throws on HTML element constructors, or a Proxy to a function - Note: in v20 - v35, HTML element constructors are not callable, despite having typeof
function
- Note: in v42 - v63,
- IE: v6 - v11(every integer version
- Opera: v11.1, v11.5, v11.6, v12.0, v12.1, v12.14, v12.15, v12.16, v15+ v15+ matches Chrome
Tests
Simply clone the repo, npm install
, and run npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/es-shims/.github/SECURITY.md:1
- Info: Found linked content: github.com/es-shims/.github/SECURITY.md:1
- Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy
- Info: Found text in security policy: github.com/es-shims/.github/SECURITY.md:1
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/require-allow-edits.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/es-shims/Function.prototype.name/require-allow-edits.yml/main?enable=pin
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/browsers.yml:1
- Warn: no topLevel permission defined: .github/workflows/node-aught.yml:1
- Warn: no topLevel permission defined: .github/workflows/node-pretest.yml:1
- Warn: no topLevel permission defined: .github/workflows/node-tens.yml:1
- Warn: no topLevel permission defined: .github/workflows/rebase.yml:1
- Warn: no topLevel permission defined: .github/workflows/require-allow-edits.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
4.4
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More