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

set-function-length

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

set-function-length - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

.nycrc

9

CHANGELOG.md

@@ -8,2 +8,11 @@ # Changelog

## [v1.1.0](https://github.com/ljharb/set-function-length/compare/v1.0.1...v1.1.0) - 2023-10-13
### Commits
- [New] add `env` entry point [`475c87a`](https://github.com/ljharb/set-function-length/commit/475c87aa2f59b700aaed589d980624ec596acdcb)
- [Tests] add coverage with `nyc` [`14f0bf8`](https://github.com/ljharb/set-function-length/commit/14f0bf8c145ae60bf14a026420a06bb7be132c36)
- [eslint] fix linting failure [`fb516f9`](https://github.com/ljharb/set-function-length/commit/fb516f93c664057138c53559ef63c8622a093335)
- [Deps] update `define-data-property` [`d727e7c`](https://github.com/ljharb/set-function-length/commit/d727e7c6c9a40d7bf26797694e500ea68741feea)
## [v1.0.1](https://github.com/ljharb/set-function-length/compare/v1.0.0...v1.0.1) - 2023-10-12

@@ -10,0 +19,0 @@

8

env.js

@@ -7,8 +7,14 @@ 'use strict';

var functionsHaveWritableLengths = gOPD && gOPD(function () {}, 'length').writable;
var boundFnsHaveConfigurableLengths = gOPD && gOPD(function () {}.bind(), 'length').configurable;
var boundFnsHaveWritableLengths = gOPD && gOPD(function () {}.bind(), 'length').writable;
module.exports = {
__proto__: null,
boundFnsHaveConfigurableLengths: boundFnsHaveConfigurableLengths,
functionsHaveConfigurableLengths: functionsHaveConfigurableLengths
boundFnsHaveWritableLengths: boundFnsHaveWritableLengths,
functionsHaveConfigurableLengths: functionsHaveConfigurableLengths,
functionsHaveWritableLengths: functionsHaveWritableLengths
};

@@ -22,2 +22,3 @@ 'use strict';

var functionLengthIsConfigurable = true;
var functionLengthIsWritable = true;
if ('length' in fn && gOPD) {

@@ -28,5 +29,8 @@ var desc = gOPD(fn, 'length');

}
if (desc && !desc.writable) {
functionLengthIsWritable = false;
}
}
if (functionLengthIsConfigurable || !loose) {
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
if (hasDescriptors) {

@@ -33,0 +37,0 @@ define(fn, 'length', length, true, true);

8

package.json
{
"name": "set-function-length",
"version": "1.0.1",
"version": "1.1.0",
"description": "Set a function's length property",

@@ -8,2 +8,3 @@ "main": "index.js",

".": "./index.js",
"./env": "./env.js",
"./package.json": "./package.json"

@@ -21,3 +22,3 @@ },

"pretest": "npm run lint",
"tests-only": "tape 'test/**/*.js'",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",

@@ -50,2 +51,3 @@ "posttest": "aud --production",

"auto-changelog": "^2.4.0",
"define-data-property": "^1.1.1",
"es-value-fixtures": "^1.4.2",

@@ -57,2 +59,3 @@ "eslint": "=8.8.0",

"npmignore": "^0.3.0",
"nyc": "^10.3.2",
"object-inspect": "^1.12.3",

@@ -63,3 +66,2 @@ "safe-publish-latest": "^2.0.0",

"dependencies": {
"define-data-property": "^1.1.0",
"get-intrinsic": "^1.2.1",

@@ -66,0 +68,0 @@ "gopd": "^1.0.1",

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