Skip to content

Commit 5235143

Browse files
committed
[Refactor] use call-bound directly
1 parent d5c5bab commit 5235143

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22

3-
var callBound = require('call-bind/callBound');
3+
var callBound = require('call-bound');
44

5+
/** @type {undefined | ((thisArg: SharedArrayBuffer) => number)} */
56
var $byteLength = callBound('SharedArrayBuffer.prototype.byteLength', true);
67

78
/** @type {import('.')} */
@@ -11,13 +12,13 @@ module.exports = $byteLength
1112
return false;
1213
}
1314
try {
15+
// @ts-expect-error TS can't figure out this closed-over variable is non-nullable, and it's fine that `obj` might not be a SAB
1416
$byteLength(obj);
1517
return true;
1618
} catch (e) {
1719
return false;
1820
}
1921
}
20-
// @ts-expect-error
21-
: function isSharedArrayBuffer(obj) { // eslint-disable-line no-unused-vars
22+
: function isSharedArrayBuffer(_obj) { // eslint-disable-line no-unused-vars
2223
return false;
2324
};

Diff for: package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"@arethetypeswrong/cli": "^0.17.1",
5252
"@ljharb/eslint-config": "^21.1.1",
5353
"@ljharb/tsconfig": "^0.2.2",
54-
"@types/call-bind": "^1.0.5",
5554
"@types/es-value-fixtures": "^1.4.4",
5655
"@types/for-each": "^0.3.3",
5756
"@types/node": "^20.17.10",
@@ -80,7 +79,7 @@
8079
"hideCredit": true
8180
},
8281
"dependencies": {
83-
"call-bind": "^1.0.8"
82+
"call-bound": "^1.0.3"
8483
},
8584
"publishConfig": {
8685
"ignore": [

0 commit comments

Comments
 (0)