Skip to content

Commit faf9eff

Browse files
committedNov 14, 2023
deps: is-core-module@2.13.1
1 parent b00e780 commit faf9eff

15 files changed

+284
-129
lines changed
 

‎DEPENDENCIES.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ graph LR;
318318
glob-->minimatch;
319319
glob-->minipass;
320320
glob-->path-scurry;
321-
has-->function-bind;
321+
hasown-->function-bind;
322322
hosted-git-info-->lru-cache;
323323
http-proxy-agent-->agent-base;
324324
http-proxy-agent-->debug;
@@ -334,7 +334,7 @@ graph LR;
334334
init-package-json-->validate-npm-package-license;
335335
init-package-json-->validate-npm-package-name;
336336
is-cidr-->cidr-regex;
337-
is-core-module-->has;
337+
is-core-module-->hasown;
338338
isaacs-cliui-->string-width-cjs;
339339
isaacs-cliui-->string-width;
340340
isaacs-cliui-->strip-ansi-cjs;

‎node_modules/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
!/glob
118118
!/graceful-fs
119119
!/has-unicode
120-
!/has
120+
!/hasown
121121
!/hosted-git-info
122122
!/http-cache-semantics
123123
!/http-proxy-agent

‎node_modules/function-bind/implementation.js

+44-12
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,75 @@
33
/* eslint no-invalid-this: 1 */
44

55
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
6-
var slice = Array.prototype.slice;
76
var toStr = Object.prototype.toString;
7+
var max = Math.max;
88
var funcType = '[object Function]';
99

10+
var concatty = function concatty(a, b) {
11+
var arr = [];
12+
13+
for (var i = 0; i < a.length; i += 1) {
14+
arr[i] = a[i];
15+
}
16+
for (var j = 0; j < b.length; j += 1) {
17+
arr[j + a.length] = b[j];
18+
}
19+
20+
return arr;
21+
};
22+
23+
var slicy = function slicy(arrLike, offset) {
24+
var arr = [];
25+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
26+
arr[j] = arrLike[i];
27+
}
28+
return arr;
29+
};
30+
31+
var joiny = function (arr, joiner) {
32+
var str = '';
33+
for (var i = 0; i < arr.length; i += 1) {
34+
str += arr[i];
35+
if (i + 1 < arr.length) {
36+
str += joiner;
37+
}
38+
}
39+
return str;
40+
};
41+
1042
module.exports = function bind(that) {
1143
var target = this;
12-
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
44+
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
1345
throw new TypeError(ERROR_MESSAGE + target);
1446
}
15-
var args = slice.call(arguments, 1);
47+
var args = slicy(arguments, 1);
1648

1749
var bound;
1850
var binder = function () {
1951
if (this instanceof bound) {
2052
var result = target.apply(
2153
this,
22-
args.concat(slice.call(arguments))
54+
concatty(args, arguments)
2355
);
2456
if (Object(result) === result) {
2557
return result;
2658
}
2759
return this;
28-
} else {
29-
return target.apply(
30-
that,
31-
args.concat(slice.call(arguments))
32-
);
3360
}
61+
return target.apply(
62+
that,
63+
concatty(args, arguments)
64+
);
65+
3466
};
3567

36-
var boundLength = Math.max(0, target.length - args.length);
68+
var boundLength = max(0, target.length - args.length);
3769
var boundArgs = [];
3870
for (var i = 0; i < boundLength; i++) {
39-
boundArgs.push('$' + i);
71+
boundArgs[i] = '$' + i;
4072
}
4173

42-
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
74+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
4375

4476
if (target.prototype) {
4577
var Empty = function Empty() {};

‎node_modules/function-bind/package.json

+38-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "function-bind",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Implementation of Function.prototype.bind",
55
"keywords": [
66
"function",
@@ -9,7 +9,13 @@
99
"es5"
1010
],
1111
"author": "Raynos <raynos2@gmail.com>",
12-
"repository": "git://github.com/Raynos/function-bind.git",
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/Raynos/function-bind.git"
15+
},
16+
"funding": {
17+
"url": "https://github.com/sponsors/ljharb"
18+
},
1319
"main": "index",
1420
"homepage": "https://github.com/Raynos/function-bind",
1521
"contributors": [
@@ -25,24 +31,29 @@
2531
"url": "https://github.com/Raynos/function-bind/issues",
2632
"email": "raynos2@gmail.com"
2733
},
28-
"dependencies": {},
2934
"devDependencies": {
30-
"@ljharb/eslint-config": "^12.2.1",
31-
"covert": "^1.1.0",
32-
"eslint": "^4.5.0",
33-
"jscs": "^3.0.7",
34-
"tape": "^4.8.0"
35+
"@ljharb/eslint-config": "^21.1.0",
36+
"aud": "^2.0.3",
37+
"auto-changelog": "^2.4.0",
38+
"eslint": "=8.8.0",
39+
"in-publish": "^2.0.1",
40+
"npmignore": "^0.3.0",
41+
"nyc": "^10.3.2",
42+
"safe-publish-latest": "^2.0.0",
43+
"tape": "^5.7.1"
3544
},
3645
"license": "MIT",
3746
"scripts": {
47+
"prepublishOnly": "safe-publish-latest",
48+
"prepublish": "not-in-publish || npm run prepublishOnly",
49+
"prepack": "npmignore --auto --commentLines=autogenerated",
3850
"pretest": "npm run lint",
3951
"test": "npm run tests-only",
40-
"posttest": "npm run coverage -- --quiet",
41-
"tests-only": "node test",
42-
"coverage": "covert test/*.js",
43-
"lint": "npm run jscs && npm run eslint",
44-
"jscs": "jscs *.js */*.js",
45-
"eslint": "eslint *.js */*.js"
52+
"posttest": "aud --production",
53+
"tests-only": "nyc tape 'test/**/*.js'",
54+
"lint": "eslint --ext=js,mjs .",
55+
"version": "auto-changelog && git add CHANGELOG.md",
56+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
4657
},
4758
"testling": {
4859
"files": "test/index.js",
@@ -59,5 +70,18 @@
5970
"iphone/6.0..latest",
6071
"android-browser/4.2..latest"
6172
]
73+
},
74+
"auto-changelog": {
75+
"output": "CHANGELOG.md",
76+
"template": "keepachangelog",
77+
"unreleased": false,
78+
"commitLimit": false,
79+
"backfillLimit": false,
80+
"hideCredit": true
81+
},
82+
"publishConfig": {
83+
"ignore": [
84+
".github/workflows"
85+
]
6286
}
6387
}

‎node_modules/has/LICENSE-MIT

-22
This file was deleted.

‎node_modules/has/package.json

-48
This file was deleted.

‎node_modules/has/src/index.js

-5
This file was deleted.

‎node_modules/has/test/index.js

-10
This file was deleted.

‎node_modules/hasown/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Jordan Harband and contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎node_modules/hasown/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
var call = Function.prototype.call;
4+
var $hasOwn = Object.prototype.hasOwnProperty;
5+
var bind = require('function-bind');
6+
7+
/** @type {(o: {}, p: PropertyKey) => p is keyof o} */
8+
module.exports = bind.call(call, $hasOwn);

‎node_modules/hasown/package.json

+91
Original file line numberDiff line numberDiff line change

‎node_modules/hasown/tsconfig.json

+49
Original file line numberDiff line numberDiff line change

‎node_modules/is-core-module/index.js

+2-2
Original file line numberDiff line numberDiff line change

‎node_modules/is-core-module/package.json

+4-4
Original file line numberDiff line numberDiff line change

‎package-lock.json

+24-9
Original file line numberDiff line numberDiff line change

0 commit comments

Comments
 (0)
Please sign in to comment.