Skip to content

Commit 86003ad

Browse files
committed
docs: update dtype type
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 6c43167 commit 86003ad

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

lib/node_modules/@stdlib/random/tools/unary-factory/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
- factory: returns a new unary pseudorandom value generator.
1212

13-
idtypes: Array<string>
13+
idtypes: Array<string|DataType>
1414
List of supported input data types.
1515

16-
odtypes: Array<string>
16+
odtypes: Array<string|DataType>
1717
List of supported output data types.
1818

1919
policies: Object

lib/node_modules/@stdlib/random/tools/unary-factory/lib/main.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var isOutputDataTypePolicy = require( '@stdlib/ndarray/base/assert/is-output-dat
3333
var isOrder = require( '@stdlib/ndarray/base/assert/is-order' );
3434
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
3535
var everyBy = require( '@stdlib/array/base/every-by' );
36+
var dtypes2strings = require( '@stdlib/ndarray/base/dtypes2strings' );
3637
var constantFunction = require( '@stdlib/utils/constant-function' );
3738
var noop = require( '@stdlib/utils/noop' );
3839
var Random = require( '@stdlib/random/tools/unary' );
@@ -46,8 +47,8 @@ var format = require( '@stdlib/string/format' );
4647
*
4748
* @param {Function} prng - unary pseudorandom value generator
4849
* @param {Function} prng.factory - method which returns a new unary pseudorandom value generator
49-
* @param {StringArray} idtypes - list of supported input data types
50-
* @param {StringArray} odtypes - list of supported output data types
50+
* @param {ArrayLikeObject} idtypes - list of supported input data types
51+
* @param {ArrayLikeObject} odtypes - list of supported output data types
5152
* @param {Object} policies - policies
5253
* @param {string} policies.output - output data type policy
5354
* @param {Object} options - options
@@ -125,13 +126,17 @@ function createFactory( prng, idtypes, odtypes, policies, options ) {
125126
) {
126127
throw new TypeError( format( 'invalid argument. Second argument must be an array of data types. Value: `%s`.', idtypes ) );
127128
}
129+
idtypes = dtypes2strings( idtypes );
130+
128131
if (
129132
!isCollection( odtypes ) ||
130133
odtypes.length < 1 ||
131134
!everyBy( odtypes, isDataType )
132135
) {
133136
throw new TypeError( format( 'invalid argument. Third argument must be an array of data types. Value: `%s`.', odtypes ) );
134137
}
138+
odtypes = dtypes2strings( odtypes );
139+
135140
if ( !isObject( policies ) ) {
136141
throw new TypeError( format( 'invalid argument. Fourth argument must be an object. Value: `%s`.', policies ) );
137142
}
@@ -206,10 +211,10 @@ function createFactory( prng, idtypes, odtypes, policies, options ) {
206211
* @param {NonNegativeIntegerArray} shape - output ndarray shape
207212
* @param {(ndarrayLike|*)} param1 - PRNG parameter
208213
* @param {Options} [options] - function options
209-
* @param {string} [options.dtype] - output data type
214+
* @param {*} [options.dtype] - output data type
210215
* @param {string} [options.order] - memory layout (either row-major or column-major)
211216
* @param {string} [options.mode] - specifies how to handle indices which exceed ndarray dimensions
212-
* @param {StringArray} [options.submode] - specifies how to handle subscripts which exceed ndarray dimensions on a per dimension basis
217+
* @param {ArrayLikeObject<string>} [options.submode] - specifies how to handle subscripts which exceed ndarray dimensions on a per dimension basis
213218
* @param {boolean} [options.readonly] - boolean indicating whether an ndarray should be read-only
214219
* @throws {TypeError} first argument must be a valid shape
215220
* @throws {TypeError} must provide valid PRNG parameters

0 commit comments

Comments
 (0)