diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/README.md b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/README.md new file mode 100644 index 000000000000..9a3feef82a05 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/README.md @@ -0,0 +1,121 @@ + + +# isSymbolArray + +> Test if an input value is an array of [symbols][@stdlib/plot/base/assert/is-symbol]. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var isSymbolArray = require( '@stdlib/plot/base/assert/is-symbol-array' ); +``` + +#### isSymbolArray( value ) + +Tests if an input value is an array of [symbols][@stdlib/plot/base/assert/is-symbol]. + +```javascript +var bool = isSymbolArray( [ 'o' ] ); +// returns true +``` + +If provided an empty array, the function returns `false`. + +```javascript +var bool = isSymbolArray( [] ); +// returns false +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + + + +```javascript +var symbolAliases = require( '@stdlib/plot/base/symbol-aliases' ); +var isSymbolArray = require( '@stdlib/plot/base/assert/is-symbol-array' ); + +var bool = isSymbolArray( symbolAliases() ); +// returns true + +bool = isSymbolArray( {} ); +// returns false + +bool = isSymbolArray( 'foo' ); +// returns false +``` + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/benchmark/benchmark.js b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/benchmark/benchmark.js new file mode 100644 index 000000000000..8a73115233e9 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/benchmark/benchmark.js @@ -0,0 +1,87 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var isSymbolArray = require( './../lib' ); + + +// MAIN // + +bench( format( '%s::true', pkg ), function benchmark( b ) { + var values; + var out; + var i; + + values = [ + 'o', + 'circle' + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + out = isSymbolArray( [ values[ i%values.length ] ] ); + if ( typeof out !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + } + b.toc(); + if ( !isBoolean( out ) ) { + b.fail( 'should return a boolean' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( format( '%s::false', pkg ), function benchmark( b ) { + var values; + var out; + var v; + var i; + + values = [ + 'foo', + 'bar', + '', + 'beep', + 'boop', + [], + {} + ]; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + v = values[ i%values.length ]; + out = isSymbolArray( v ); + if ( typeof out !== 'boolean' ) { + b.fail( 'should return a boolean' ); + } + } + b.toc(); + if ( !isBoolean( out ) ) { + b.fail( 'should return a boolean' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/repl.txt b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/repl.txt new file mode 100644 index 000000000000..5a4176eb02b0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/repl.txt @@ -0,0 +1,24 @@ + +{{alias}}( value ) + Tests if an input value is an array of symbols. + + Parameters + ---------- + value: any + Value to test. + + Returns + ------- + bool: boolean + Boolean indicating if an input value is an array of symbols. + + Examples + -------- + > var bool = {{alias}}( [ 'o' ] ) + true + > bool = {{alias}}( {} ) + false + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/types/index.d.ts b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/types/index.d.ts new file mode 100644 index 000000000000..6659176e1482 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/types/index.d.ts @@ -0,0 +1,42 @@ +/* +* @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. +*/ + +// TypeScript Version: 4.1 + +/** +* Tests whether an input value is an array of symbols. +* +* @param v - value to test +* @returns boolean indicating whether an input value is an array of symbols +* +* @example +* var bool = isSymbolArray( [ 'o' ] ); +* // returns true +* +* bool = isSymbolArray( {} ); +* // returns false +* +* bool = isSymbolArray( 'foo' ); +* // returns false +*/ +declare function isSymbolArray( v: any ): boolean; + + +// EXPORTS // + +export = isSymbolArray; diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/types/test.ts b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/types/test.ts new file mode 100644 index 000000000000..c209399b4329 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/docs/types/test.ts @@ -0,0 +1,34 @@ +/* +* @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. +*/ + +import isSymbolArray = require( './index' ); + + +// TESTS // + +// The function returns a boolean... +{ + isSymbolArray( {} ); // $ExpectType boolean + isSymbolArray( 'foo' ); // $ExpectType boolean +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + isSymbolArray(); // $ExpectError + isSymbolArray( undefined, 123 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/examples/index.js b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/examples/index.js new file mode 100644 index 000000000000..4aecec3af79e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/examples/index.js @@ -0,0 +1,34 @@ +/** +* @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'; + +var symbolAliases = require( '@stdlib/plot/base/symbol-aliases' ); +var isSymbolArray = require( './../lib' ); + +var bool = isSymbolArray( symbolAliases() ); +console.log( bool ); +// => true + +bool = isSymbolArray( {} ); +console.log( bool ); +// => false + +bool = isSymbolArray( 'foo' ); +console.log( bool ); +// => false diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/lib/index.js b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/lib/index.js new file mode 100644 index 000000000000..a28e1b09053c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/lib/index.js @@ -0,0 +1,46 @@ +/** +* @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'; + +/** +* Test whether an input value is an array of symbols. +* +* @module @stdlib/plot/base/assert/is-symbol-array +* +* @example +* var isSymbolArray = require( '@stdlib/plot/base/assert/is-symbol-array' ); +* +* var bool = isSymbolArray( [ 'o' ] ); +* // returns true +* +* bool = isSymbolArray( {} ); +* // returns false +* +* bool = isSymbolArray( 'foo' ); +* // returns false +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/lib/main.js b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/lib/main.js new file mode 100644 index 000000000000..e4fed461f56f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/lib/main.js @@ -0,0 +1,52 @@ +/** +* @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 arraylikefcn = require( '@stdlib/assert/tools/array-like-function' ); +var isSymbol = require( '@stdlib/plot/base/assert/is-symbol' ); + + +// MAIN // + +/** +* Tests whether an input value is an array of symbols. +* +* @name isSymbolArray +* @type {Function} +* @param {*} value - value to test +* @returns {boolean} boolean indicating whether an input value is an array of symbols +* +* @example +* var bool = isSymbolArray( [ 'o' ] ); +* // returns true +* +* bool = isSymbolArray( {} ); +* // returns false +* +* bool = isSymbolArray( 'foo' ); +* // returns false +*/ +var isSymbolArray = arraylikefcn( isSymbol ); + + +// EXPORTS // + +module.exports = isSymbolArray; diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/package.json b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/package.json new file mode 100644 index 000000000000..32116875a73f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/package.json @@ -0,0 +1,71 @@ +{ + "name": "@stdlib/plot/base/assert/is-symbol-array", + "version": "0.0.0", + "description": "Test if an input value is an array of symbols.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "plot", + "base", + "symbol", + "array", + "utilities", + "utility", + "utils", + "util", + "assert", + "test", + "check", + "is", + "valid", + "validate", + "validation", + "isvalid" + ], + "__stdlib__": {} +} diff --git a/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/test/test.js b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/test/test.js new file mode 100644 index 000000000000..7e87b102800e --- /dev/null +++ b/lib/node_modules/@stdlib/plot/base/assert/is-symbol-array/test/test.js @@ -0,0 +1,75 @@ +/** +* @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 symbolShorthands = require( '@stdlib/plot/base/symbol-shorthands' ); +var symbolAliases = require( '@stdlib/plot/base/symbol-aliases' ); +var isSymbolArray = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof isSymbolArray, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function returns `true` if provided an array of symbols', function test( t ) { + var actual; + + actual = isSymbolArray( symbolAliases() ); + t.strictEqual( actual, true, 'returns expected value' ); + + actual = isSymbolArray( symbolShorthands() ); + t.strictEqual( actual, true, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `false` if not provided an array of symbols', function test( t ) { + var values; + var bool; + var i; + + values = [ + '', + 'beep', + 'boop', + 'foo', + 'bar', + 5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + for ( i = 0; i < values.length; i++ ) { + bool = isSymbolArray( values[ i ] ); + t.strictEqual( bool, false, 'returns expected value when provided '+values[ i ] ); + } + t.end(); +});