File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
lib/node_modules/@stdlib/fs/read-json/lib Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
77var readFile = require ( '@stdlib/fs/read-file' ) . sync ;
88var removeBOM = require ( '@stdlib/string/remove-utf8-bom' ) ;
99var parseJSON = require ( '@stdlib/utils/parse-json' ) ;
10+ var instanceOf = require ( '@stdlib/assert/instance-of' ) ;
1011
1112
1213// MAIN //
@@ -24,9 +25,10 @@ var parseJSON = require( '@stdlib/utils/parse-json' );
2425*
2526* @example
2627* var resolve = require( 'path' ).resolve;
28+ * var instanceOf = require( '@stdlib/assert/instance-of' );
2729*
28- * var out = readJSONSync( resolve( __dirname, '../ package.json' ) );
29- * if ( out instanceof Error ) {
30+ * var out = readJSONSync( resolve( __dirname, '..', ' package.json' ) );
31+ * if ( instanceOf( out, Error ) ) {
3032* throw out;
3133* }
3234* console.dir( out );
@@ -49,7 +51,7 @@ function readJSONSync( file, options ) {
4951 opts = { } ;
5052 }
5153 f = readFile ( file , opts ) ;
52- if ( f instanceof Error ) {
54+ if ( instanceOf ( f , Error ) ) {
5355 return f ;
5456 }
5557 f = f . toString ( ) ;
You can’t perform that action at this time.
0 commit comments