Skip to content

Commit 623678e

Browse files
committed
Move functionality to separate packages
1 parent 9450b74 commit 623678e

4 files changed

Lines changed: 7 additions & 76 deletions

File tree

lib/node_modules/@stdlib/ndarray/dtypes/lib/enum.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@
2323
// MAIN //
2424

2525
/**
26-
* Returns an object mapping supported dtypes to integer values for purposes of C inter-operation.
26+
* Returns an object mapping supported data type strings to enumeration constants.
2727
*
2828
* ## Notes
2929
*
3030
* - Downstream consumers of this mapping should **not** rely on specific integer values (e.g., `INT8 == 0`). Instead, the object should be used in an opaque manner.
3131
* - The main purpose of this function is JavaScript and C inter-operation of ndarray objects. While certain dtypes, such as "generic" and "binary", have special behavior in JavaScript, they do not have a direct complement in C.
3232
*
33-
* @returns {Object} object mapping supported dtypes to integer values
33+
* @private
34+
* @returns {Object} object mapping supported dtypes to enumeration constants
3435
*
3536
* @example
36-
* var table = enumerated();
37+
* var table = enumeration();
3738
* // returns <Object>
3839
*/
39-
function enumerated() {
40+
function enumeration() {
4041
// NOTE: the following should match the C `dtypes.h` enumeration!!!!
4142
return {
4243
// Boolean data types:
@@ -85,4 +86,4 @@ function enumerated() {
8586

8687
// EXPORTS //
8788

88-
module.exports = enumerated;
89+
module.exports = enumeration;

lib/node_modules/@stdlib/ndarray/dtypes/lib/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@
3535
var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' );
3636
var dtypes = require( './main.js' );
3737
var enumeration = require( './enum.js' );
38-
var str2enum = require( './str2enum.js' );
3938
var assign = require( './assign.js' );
4039

4140

4241
// MAIN //
4342

4443
setReadOnly( dtypes, 'enum', enumeration );
45-
setReadOnly( dtypes, 'str2enum', str2enum );
4644
assign( dtypes, enumeration() );
4745

4846

lib/node_modules/@stdlib/ndarray/dtypes/lib/str2enum.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

lib/node_modules/@stdlib/ndarray/dtypes/test/test.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ tape( 'the function returns a list of ndarray data types', function test( t ) {
8080
t.end();
8181
});
8282

83-
tape( 'attached to the main function is an `enum` method to return an object mapping dtypes to integer values for C inter-operation', function test( t ) {
83+
tape( 'attached to the main function is an `enum` method to return an object mapping dtypes to enumeration constants for C inter-operation', function test( t ) {
8484
var obj;
8585
var i;
8686

@@ -98,18 +98,6 @@ tape( 'attached to the main function is an `enum` method to return an object map
9898
t.end();
9999
});
100100

101-
tape( 'attached to the main function is a `str2enum` method to retrieve the integer value associated with a provided dtype string for C inter-operation', function test( t ) {
102-
var i;
103-
104-
t.strictEqual( hasOwnProp( dtypes, 'str2enum' ), true, 'has property' );
105-
t.strictEqual( typeof dtypes.str2enum, 'function', 'has method' );
106-
107-
for ( i = 0; i < DTYPES.length; i++ ) {
108-
t.strictEqual( isNonNegativeInteger( dtypes.str2enum( DTYPES[i] ) ), true, 'returns expected value' );
109-
}
110-
t.end();
111-
});
112-
113101
tape( 'attached to the main function are dtype enumeration constants', function test( t ) {
114102
var i;
115103
for ( i = 0; i < DTYPES.length; i++ ) {

0 commit comments

Comments
 (0)