From a80ec6a04b5a0778c9ba68c9799c434b40d6dbc3 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 25 May 2026 04:20:17 +0000 Subject: [PATCH 1/2] docs: populate `Examples` section and add baseline tests for `_tools/licenses/licenses` - Filled in placeholder `## Examples` section in README.md using the existing `examples/index.js` snippet (the `
` wrapper was present but the heading and code block were commented out; 9 of 11 sibling packages in `@stdlib/_tools/licenses` already populate this section). - Added `test/test.js` with a smoke test asserting the main export is a function and a callback-argument validation test (9 of 11 sibling packages already have a `test/test.js`; `licenses` had no tests at all). - Added the corresponding `test` entry to `directories` in `package.json`. --- .../_tools/licenses/licenses/README.md | 17 +++++- .../_tools/licenses/licenses/package.json | 3 +- .../_tools/licenses/licenses/test/test.js | 61 +++++++++++++++++++ 3 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js 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..e0d52a2721b5 --- /dev/null +++ b/lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js @@ -0,0 +1,61 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2018 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 ); + }; + } +}); From 2cf314eece8adc7467e6ab6898ef121e0b461f49 Mon Sep 17 00:00:00 2001 From: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com> Date: Tue, 26 May 2026 17:11:57 +0000 Subject: [PATCH 2/2] chore: update copyright years --- lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js b/lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js index e0d52a2721b5..5619176920aa 100644 --- a/lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js +++ b/lib/node_modules/@stdlib/_tools/licenses/licenses/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* 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.