Skip to content

Commit d0be57d

Browse files
committed
refactor: reduce dtype string duplication
1 parent d88c946 commit d0be57d

7 files changed

Lines changed: 8 additions & 32 deletions

File tree

lib/node_modules/@stdlib/array/typed-float-dtypes/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,9 @@ Returns a list of typed array floating-point data types.
4646

4747
```javascript
4848
var out = dtypes();
49-
// e.g., returns [ 'float32', 'float64', 'complex64', 'complex128' ]
49+
// e.g., returns [ 'float32', ... ]
5050
```
5151

52-
The output `array` contains the following data types:
53-
54-
- `float32`: single-precision floating-point numbers.
55-
- `float64`: double-precision floating-point numbers.
56-
- `complex64`: single-precision complex floating-point numbers.
57-
- `complex128`: double-precision complex floating-point numbers.
58-
5952
</section>
6053

6154
<!-- /.usage -->

lib/node_modules/@stdlib/array/typed-float-dtypes/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bench( pkg, function benchmark( b ) {
3636
for ( i = 0; i < b.iterations; i++ ) {
3737
out = dtypes();
3838
if ( out.length <= 2 ) {
39-
b.fail( 'should return an array of strings' );
39+
b.fail( 'should return an array' );
4040
}
4141
}
4242
b.toc();

lib/node_modules/@stdlib/array/typed-float-dtypes/docs/repl.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
{{alias}}()
33
Returns a list of typed array floating-point data types.
44

5-
The output array contains the following data types:
6-
7-
- float32: single-precision floating-point numbers.
8-
- float64: double-precision floating-point numbers.
9-
- complex64: single-precision complex floating-point numbers.
10-
- complex128: double-precision complex floating-point numbers.
11-
125
Returns
136
-------
147
out: Array<string>

lib/node_modules/@stdlib/array/typed-float-dtypes/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { FloatingPointDataType as DataType } from '@stdlib/types/array';
2929
*
3030
* @example
3131
* var list = dtypes();
32-
* // e.g., returns [ 'float32', 'float64', 'complex64', 'complex128' ]
32+
* // e.g., returns [ 'float32', ... ]
3333
*/
3434
declare function dtypes(): Array<DataType>;
3535

lib/node_modules/@stdlib/array/typed-float-dtypes/lib/dtypes.json

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

lib/node_modules/@stdlib/array/typed-float-dtypes/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
// MODULES //
2222

23-
var DTYPES = require( './dtypes.json' );
23+
var dt = require( '@stdlib/array/dtypes' );
2424

2525

2626
// MAIN //
@@ -32,10 +32,10 @@ var DTYPES = require( './dtypes.json' );
3232
*
3333
* @example
3434
* var list = dtypes();
35-
* // e.g., returns [ 'float32', 'float64', 'complex64', 'complex128' ]
35+
* // e.g., returns [ 'float32', ... ]
3636
*/
3737
function dtypes() {
38-
return DTYPES.slice();
38+
return dt( 'floating_point' );
3939
}
4040

4141

lib/node_modules/@stdlib/array/typed-float-dtypes/test/test.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24+
var dt = require( '@stdlib/array/dtypes' );
2425
var dtypes = require( './../lib' );
2526

2627

@@ -36,12 +37,7 @@ tape( 'the function returns a list of typed array floating-point data types', fu
3637
var expected;
3738
var actual;
3839

39-
expected = [
40-
'float32',
41-
'float64',
42-
'complex64',
43-
'complex128'
44-
];
40+
expected = dt( 'floating_point' );
4541
actual = dtypes();
4642

4743
t.deepEqual( actual, expected, 'returns expected value' );

0 commit comments

Comments
 (0)