Skip to content

Commit 3f178be

Browse files
committed
chore: lint
1 parent ac2745d commit 3f178be

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/internal/errors.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ const captureLargerStackTrace = hideStackFrames(function (error: unknown) {
167167

168168
function getMessage(key: string, parameters: unknown[], self: Error): string {
169169
const message = messages.get(key);
170-
assert(message !== undefined, "expected `message` to be found");
170+
assert.ok(message !== undefined, "expected `message` to be found");
171171

172172
if (typeof message === "function") {
173-
assert(
173+
assert.ok(
174174
message.length <= parameters.length, // Default options do not count.
175175
`Code: ${key}; The provided arguments length (${parameters.length}) does not ` +
176176
`match the required ones (${message.length}).`,
@@ -181,7 +181,7 @@ function getMessage(key: string, parameters: unknown[], self: Error): string {
181181
const regex = /%[dfijoOs]/g;
182182
let expectedLength = 0;
183183
while (regex.exec(message) !== null) expectedLength++;
184-
assert(
184+
assert.ok(
185185
expectedLength === parameters.length,
186186
`Code: ${key}; The provided arguments length (${parameters.length}) does not ` +
187187
`match the required ones (${expectedLength}).`,
@@ -229,7 +229,7 @@ function determineSpecificType(value: unknown): string {
229229
export const ERR_INVALID_ARG_TYPE = createError(
230230
"ERR_INVALID_ARG_TYPE",
231231
(name: string, expected: Array<string> | string, actual: unknown) => {
232-
assert(typeof name === "string", "'name' must be a string");
232+
assert.ok(typeof name === "string", "'name' must be a string");
233233
if (!Array.isArray(expected)) {
234234
expected = [expected];
235235
}
@@ -250,15 +250,15 @@ export const ERR_INVALID_ARG_TYPE = createError(
250250
const other: string[] = [];
251251

252252
for (const value of expected) {
253-
assert(
253+
assert.ok(
254254
typeof value === "string",
255255
"All expected entries have to be of type string",
256256
);
257257

258258
if (kTypes.has(value)) {
259259
types.push(value.toLowerCase());
260260
} else if (classRegExp.exec(value) === null) {
261-
assert(
261+
assert.ok(
262262
value !== "object",
263263
'The value "object" should be written as "Object"',
264264
);
@@ -347,7 +347,7 @@ export const ERR_INVALID_PACKAGE_TARGET = createError(
347347
target.length > 0 &&
348348
!target.startsWith("./");
349349
if (key === ".") {
350-
assert(isImport === false);
350+
assert.ok(isImport === false);
351351
return (
352352
`Invalid "exports" main target ${JSON.stringify(target)} defined ` +
353353
`in the package config ${packagePath}package.json${

src/internal/resolve.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ export function moduleResolve(
10231023
}
10241024
}
10251025

1026-
assert(resolved !== undefined, "expected to be defined");
1026+
assert.ok(resolved !== undefined, "expected to be defined");
10271027

10281028
if (resolved.protocol !== "file:") {
10291029
return resolved;

0 commit comments

Comments
 (0)