Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Oct 14, 2023
1 parent 4d4d9a0 commit 00a018b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 71 deletions.
4 changes: 3 additions & 1 deletion data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3666,8 +3666,9 @@ ndarray.prototype.set,"\nndarray.prototype.set( ...idx:integer, v:any )\n Set
ndarray.prototype.iset,"\nndarray.prototype.iset( idx:integer, v:any )\n Sets an array element located at a specified linear index.\n"
ndarray.prototype.toString,"\nndarray.prototype.toString()\n Serializes an ndarray as a string.\n"
ndarray.prototype.toJSON,"\nndarray.prototype.toJSON()\n Serializes an ndarray as a JSON object.\n"
ndarray2array,"\nndarray2array( arr:ndarray )\n Converts an ndarray to a generic array.\n"
ndarray2array,"\nndarray2array( x:ndarray )\n Converts an ndarray to a generic array.\n"
ndarrayCastingModes,"\nndarrayCastingModes()\n Returns a list of ndarray casting modes.\n"
ndarrayDataBuffer,"\nndarrayDataBuffer( x:ndarray )\n Returns the underlying data buffer of a provided ndarray.\n"
ndarrayDataType,"\nndarrayDataType( x:ndarray )\n Returns the data type of a provided ndarray.\n"
ndarrayDataTypes,"\nndarrayDataTypes( [kind:string] )\n Returns a list of ndarray data types.\n"
ndarrayDispatch,"\nndarrayDispatch( fcns:Function|ArrayLikeObject<Function>, \n types:ArrayLikeObject, data:ArrayLikeObject|null, nargs:integer, nin:integer, \n nout:integer )\n Returns an ndarray function interface which performs multiple dispatch.\n"
Expand All @@ -3692,6 +3693,7 @@ nditerRows,"\nnditerRows( x:ndarray[, options:Object] )\n Returns an iterator
nditerValues,"\nnditerValues( x:ndarray[, options:Object] )\n Returns an iterator which returns individual elements from a provided\n ndarray.\n"
ndslice,"\nndslice( x:ndarray, ...s:MultiSlice|Slice|null|undefined|integer|ArrayLike[, \n options:Object] )\n Returns a read-only view of an input ndarray.\n"
ndsliceAssign,"\nndsliceAssign( x:ndarray, y:ndarray, \n ...s:MultiSlice|Slice|null|undefined|integer|ArrayLike[, options:Object] )\n Assigns element values from a broadcasted input ndarray to corresponding\n elements in an output ndarray view.\n"
ndsliceDimension,"\nndsliceDimension( x:ndarray, dim:integer, slice:Slice|integer|null|undefined[, \n options:Object] )\n Returns a read-only view of an input ndarray when sliced along a specified\n dimension.\n"
ndzeros,"\nndzeros( shape:ArrayLikeObject<integer>|integer[, options:Object] )\n Returns a zero-filled ndarray having a specified shape and data type.\n"
ndzerosLike,"\nndzerosLike( x:ndarray[, options:Object] )\n Returns a zero-filled ndarray having the same shape and data type as a\n provided input ndarray.\n"
nextGraphemeClusterBreak,"\nnextGraphemeClusterBreak( str:string[, fromIndex:integer] )\n Returns the next extended grapheme cluster break in a string after a\n specified position.\n"
Expand Down
2 changes: 1 addition & 1 deletion data/data.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.js.map

Large diffs are not rendered by default.

70 changes: 4 additions & 66 deletions test/dist/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
* Copyright (c) 2023 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.
Expand All @@ -21,75 +21,13 @@
// MODULES //

var tape = require( 'tape' );
var aliases = require( '@stdlib/namespace-aliases' );
var DATA = require( './../../data/data.json' );
var info = require( './../../dist' );
var main = require( './../../dist' );


// TESTS //

tape( 'main export is a function', function test( t ) {
tape( 'main export is defined', function test( t ) {
t.ok( true, __filename );
t.strictEqual( typeof info, 'function', 'main export is a function' );
t.end();
});

tape( 'the function throws an error if not provided a string', function test( t ) {
var values;
var i;

values = [
5,
NaN,
true,
false,
null,
void 0,
[],
{},
function noop() {}
];
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() {
info( value );
};
}
});

tape( 'the function returns abbreviated help text', function test( t ) {
var expected;
var actual;
var list;
var i;

list = aliases();
for ( i = 0; i < list.length; i++ ) {
expected = DATA[ list[i] ];
if ( expected === void 0 ) {
expected = null;
}
actual = info( list[i] );
t.strictEqual( actual, expected, 'returns expected value for '+list[i] );
}
t.end();
});

tape( 'the function returns `null` if provided an unrecognized alias', function test( t ) {
var values;
var i;

values = [
'adfkaljdfdsafs',
'adklfadjflajdslfjalsdf',
'adflkajdlkfjasdlkfjsadlkfjlasdjflsdjfla'
];
for ( i = 0; i < values.length; i++ ) {
t.strictEqual( info( values[ i ] ), null, 'returns expected value' );
}
t.strictEqual( main !== void 0, true, 'main export is defined' );
t.end();
});

0 comments on commit 00a018b

Please sign in to comment.