8000 Transform error messages · stdlib-js/fs-read-json@6c479f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c479f8

Browse files
committed
Transform error messages
1 parent 840dec3 commit 6c479f8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/async.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var readFile = require( '@stdlib/fs-read-file' );
2727
var removeBOM = require( '@stdlib/string-remove-utf8-bom' );
2828
var parseJSON = require( '@stdlib/utils-parse-json' );
2929
var instanceOf = require( '@stdlib/assert-instance-of' );
30-
var format = require( '@stdlib/string-format' );
30+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3131

3232

3333
// MAIN //
@@ -69,14 +69,14 @@ function readJSON( file, options, clbk ) {
6969
};
7070
} else {
7171
if ( !isObject( options ) ) {
72-
throw new TypeError( format( 'invalid argument. Options argument must be either a string or an object. Value: `%s`.', options ) );
72+
throw new TypeError( format( '0OH3t', options ) );
7373
}
7474
opts = options;
7575
}
7676
done = clbk;
7777
}
7878
if ( !isFunction( done ) ) {
79-
throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', done ) );
79+
throw new TypeError( format( '0OH2b', done ) );
8080
}
8181
readFile( file, opts, onRead );
8282

lib/sync.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var readFile = require( '@stdlib/fs-read-file' ).sync;
2626
var removeBOM = require( '@stdlib/string-remove-utf8-bom' );
2727
var parseJSON = require( '@stdlib/utils-parse-json' );
2828
var instanceOf = require( '@stdlib/assert-instance-of' );
29-
var format = require( '@stdlib/string-format' );
29+
var format = require( '@stdlib/error-tools-fmtprodmsg' );
3030

3131

3232
// MAIN //
@@ -62,7 +62,7 @@ function readJSONSync( file, options ) {
6262
};
6363
} else {
6464
if ( !isObject( options ) ) {
65-
throw new TypeError( format( 'invalid argument. Options argument must be either a string or an object. Value: `%s`.', options ) );
65+
throw new TypeError( format( '0OH3t', options ) );
6666
}
6767
opts = options;
6868
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@stdlib/assert-is-plain-object": "^0.2.2",
4343
"@stdlib/assert-is-string": "^0.2.2",
44 56DF 44
"@stdlib/fs-read-file": "^0.2.2",
45-
"@stdlib/string-format": "^0.2.2",
45+
"@stdlib/error-tools-fmtprodmsg": "^0.2.2",
4646
"@stdlib/string-remove-utf8-bom": "^0.2.2",
4747
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
4848
"@stdlib/utils-parse-json": "^0.2.2",

0 commit comments

Comments
 (0)
0