Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7c6f6c

Browse files
committed
fix: 🐛 remove dependence on "assert" module
1 parentfb14a3d commitc7c6f6c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎src/vendor/node/internal/errors.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Adapted from Node.js ../internal/errors.js, used for throwing similar errors to Node.js.
22

3-
import*asassertfrom'assert';
43
import{inspect,format}from'../util';
54

65
constkCode=typeofSymbol==='undefined' ?'_kCode' :(Symbolasany)('code');
@@ -50,10 +49,9 @@ class AssertionError extends g.Error {
5049
}
5150

5251
functionmessage(key,args){
53-
assert.strictEqual(typeofkey,'string');
54-
// const msg = messages.get(key);
52+
if(typeofkey!=='string')thrownewError('Error message key must be a string');
5553
constmsg=messages[key];
56-
assert(msg,`An invalid error message key was used:${key}.`);
54+
if(!msg)thrownewError(`An invalid error message key was used:${key}.`);
5755
letfmt;
5856
if(typeofmsg==='function'){
5957
fmt=msg;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp