@@ -167,10 +167,10 @@ const captureLargerStackTrace = hideStackFrames(function (error: unknown) {
167167
168168function 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 = / % [ d f i j o O s ] / 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 {
229229export 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${
0 commit comments