diff --git a/lib/node_modules/@stdlib/_tools/licenses/licenses/README.md b/lib/node_modules/@stdlib/_tools/licenses/licenses/README.md index c9a778dc965c..21c61e0d445a 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/licenses/README.md +++ b/lib/node_modules/@stdlib/_tools/licenses/licenses/README.md @@ -97,11 +97,22 @@ function onResults( error, results ) {
- -``` --> +```javascript +var licenses = require( '@stdlib/_tools/licenses/licenses' ); + +licenses( onResults ); + +function onResults( error, results ) { + if ( error ) { + throw error; + } + console.log( JSON.stringify( results ) ); +} +```
diff --git a/lib/node_modules/@stdlib/_tools/licenses/licenses/package.json b/lib/node_modules/@stdlib/_tools/licenses/licenses/package.json index 077e0db18df4..3e0b6ffd75a6 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/licenses/package.json +++ b/lib/node_modules/@stdlib/_tools/licenses/licenses/package.json @@ -20,7 +20,8 @@ "directories": { "doc": "./docs", "example": "./examples", - "lib": "./lib" + "lib": "./lib", + "test": "./test" }, "scripts": {}, "homepage": "https://github.com/stdlib-js/stdlib", diff --git a/lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js b/lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js new file mode 100644 index 000000000000..5619176920aa --- /dev/null +++ b/lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var licenses = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof licenses, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if not provided a callback argument which is a function', function test( t ) { + var values; + var i; + + values = [ + '5', + 5, + NaN, + true, + false, + null, + undefined, + [], + {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided '+values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + licenses( value ); + }; + } +});