Skip to content

Commit 46844a1

Browse files
committed
Lowercase property values for easier consumption in JavaScript
1 parent 89c6bc1 commit 46844a1

2 files changed

Lines changed: 32 additions & 32 deletions

File tree

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,40 @@
3939
function enumerated() {
4040
// NOTE: the following should match the C `dtypes.h` enumeration!!!!
4141
return {
42-
// 'BOOL': 0, // uncomment once supported
42+
// 'bool': 0, // uncomment once supported
4343

44-
'INT8': 0,
45-
'UINT8': 1,
46-
'INT16': 2,
47-
'UINT16': 3,
48-
'INT32': 4,
49-
'UINT32': 5,
50-
'INT64': 6,
51-
'UINT64': 7,
52-
// 'INT128': 9, // uncomment once supported
53-
// 'UINT128': 10, // uncomment once supported
54-
// 'INT256': 11, // uncomment once supported
55-
// 'UINT256': 12, // uncomment once supported
44+
'int8': 0,
45+
'uint8': 1,
46+
'int16': 2,
47+
'uint16': 3,
48+
'int32': 4,
49+
'uint32': 5,
50+
'int64': 6,
51+
'uint64': 7,
52+
// 'int128': 9, // uncomment once supported
53+
// 'uint128': 10, // uncomment once supported
54+
// 'int256': 11, // uncomment once supported
55+
// 'uint256': 12, // uncomment once supported
5656

57-
// 'FLOAT16': 13, // uncomment once supported
58-
'FLOAT32': 8,
59-
'FLOAT64': 9,
60-
// 'FLOAT128': 16, // uncomment once supported
57+
// 'float16': 13, // uncomment once supported
58+
'float32': 8,
59+
'float64': 9,
60+
// 'float128': 16, // uncomment once supported
6161

6262
// Define a signaling value which is guaranteed not to be a valid type enumeration value:
63-
'NOTYPE': 11,
63+
'notype': 11,
6464

6565
// The following is a special dtype, which is, in more recent Node.js versions, effectively equivalent to `uint8` when calling into C; however, in older Node.js versions, the `Buffer` object was not based on the `Uint8Array` typed array. Here, we treat "binary" as an alias for `uint8`.
66-
'BINARY': 1,
66+
'binary': 1,
6767

6868
// The following is a special dtype which is only applicable in JavaScript, not in C. Here, we treat "uint8c" as an alias for `uint8`.
69-
'UINT8C': 1,
69+
'uint8c': 1,
7070

7171
// The following corresponds to a "generic" JavaScript `Array` instance. This has no equivalent native C type.
72-
'GENERIC': 11,
72+
'generic': 11,
7373

7474
// Indicate the start of user defined type numbers (leaving room for type growth above):
75-
'USERDEFINED_TYPE': 256
75+
'userdefined_type': 256
7676
};
7777
}
7878

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ tape( 'attached to the main function is an `enum` method to return an object map
7070

7171
// List of native C types which should be supported...
7272
dt = [
73-
'INT8',
74-
'UINT8',
75-
'INT16',
76-
'UINT16',
77-
'INT32',
78-
'UINT32',
79-
'INT64',
80-
'UINT64',
81-
'FLOAT32',
82-
'FLOAT64'
73+
'int8',
74+
'uint8',
75+
'int16',
76+
'uint16',
77+
'int32',
78+
'uint32',
79+
'int64',
80+
'uint64',
81+
'float32',
82+
'float64'
8383
];
8484
for ( i = 0; i < dt.length; i++ ) {
8585
t.strictEqual( hasOwnProp( obj, dt[ i ] ), true, 'has property `' + dt[ i ] + '`' );

0 commit comments

Comments
 (0)