diff --git a/lib/main.js b/lib/main.js index c143543..8b54646 100644 --- a/lib/main.js +++ b/lib/main.js @@ -22,7 +22,7 @@ var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; var isCollection = require( '@stdlib/assert-is-collection' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); var UNICODE_MAX = require( '@stdlib/constants-unicode-max' ); var UNICODE_MAX_BMP = require( '@stdlib/constants-unicode-max-bmp' ); @@ -84,16 +84,16 @@ function fromCodePoint( args ) { } } if ( len === 0 ) { - throw new Error( 'insufficient arguments. Must provide either an array of code points or one or more code points as separate arguments.' ); + throw new Error( format('1Oh1V') ); } str = ''; for ( i = 0; i < len; i++ ) { pt = arr[ i ]; if ( !isNonNegativeInteger( pt ) ) { - throw new TypeError( format( 'invalid argument. Must provide valid code points (i.e., nonnegative integers). Value: `%s`.', pt ) ); + throw new TypeError( format( '1OhAM', pt ) ); } if ( pt > UNICODE_MAX ) { - throw new RangeError( format( 'invalid argument. Must provide a valid code point (i.e., cannot exceed %u). Value: `%s`.', UNICODE_MAX, pt ) ); + throw new RangeError( format( '1OhE5', UNICODE_MAX, pt ) ); } if ( pt <= UNICODE_MAX_BMP ) { str += fromCharCode( pt ); diff --git a/package.json b/package.json index afd1555..2839f96 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "@stdlib/process-read-stdin": "^0.2.3", "@stdlib/regexp-eol": "^0.2.3", "@stdlib/streams-node-stdin": "^0.2.3", - "@stdlib/string-format": "^0.2.3", + "@stdlib/error-tools-fmtprodmsg": "^0.2.3", "@stdlib/types": "^0.5.1", "@stdlib/utils-regexp-from-string": "^0.2.3", "@stdlib/error-tools-fmtprodmsg": "^0.2.3"