Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/node_modules/@stdlib/utils/library-manifest/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
var resolve = require( 'resolve' ).sync;
var parentPath = require( '@stdlib/fs/resolve-parent-path' ).sync;
var convertPath = require( '@stdlib/utils/convert-path' );
var format = require( '@stdlib/string/format' );
var isObject = require( './is_object.js' );
var unique = require( './unique.js' );
var validate = require( './validate.js' );
Expand Down Expand Up @@ -60,7 +61,7 @@
* @example
* var conf = manifest( './manifest.json', {} );
*/
function manifest( fpath, conditions, options ) {

Check warning on line 64 in lib/node_modules/@stdlib/utils/library-manifest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Function 'manifest' has too many statements (107). Maximum allowed is 100
var coptnames;
var mpath;
var ropts;
Expand All @@ -79,7 +80,7 @@
var k;

if ( typeof fpath !== 'string' ) {
throw new TypeError( 'invalid argument. First argument must be a string. Value: `'+fpath+'`.' );
throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', fpath ) );
}
opts = defaults();
if ( arguments.length > 2 ) {
Expand All @@ -94,7 +95,7 @@
debug( 'Options: %s', JSON.stringify( opts ) );

fpath = path.resolve( opts.basedir, fpath );
dir = path.dirname( fpath );

Check failure on line 98 in lib/node_modules/@stdlib/utils/library-manifest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Use `@stdlib/utils/dirname` instead of path.dirname
debug( 'Manifest file path: %s', fpath );

conf = require( fpath ); // eslint-disable-line stdlib/no-dynamic-require
Expand All @@ -103,11 +104,11 @@
conf = JSON.parse( JSON.stringify( conf ) );
debug( 'Manifest: %s', JSON.stringify( conf ) );

// TODO: validate a loaded manifest (conf) according to a JSON schema

Check warning on line 107 in lib/node_modules/@stdlib/utils/library-manifest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unexpected 'todo' comment: 'TODO: validate a loaded manifest (conf)...'

// Handle input conditions...
if ( !isObject( conditions ) ) {
throw new TypeError( 'invalid argument. Second argument must be an object. Value: `' + conditions + '`.' );
throw new TypeError( format( 'invalid argument. Second argument must be an object. Value: `%s`.', conditions ) );
}
debug( 'Provided conditions: %s', JSON.stringify( conditions ) );
coptnames = objectKeys( conf.options );
Expand Down Expand Up @@ -174,9 +175,9 @@

// Resolve a dependency's path by finding the dependency's `package.json`:
mpath = parentPath( 'package.json', {
'dir': path.dirname( mpath )

Check failure on line 178 in lib/node_modules/@stdlib/utils/library-manifest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Use `@stdlib/utils/dirname` instead of path.dirname
});
mpath = path.dirname( mpath );

Check failure on line 180 in lib/node_modules/@stdlib/utils/library-manifest/lib/main.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Use `@stdlib/utils/dirname` instead of path.dirname
debug( 'Dependency path: %s', mpath );

// Load the dependency configuration (recursive):
Expand Down
Loading