stdlib-js / ndarray-safe-casts

Compare cfa61c3 ... +4 ... e39858b

Coverage Reach
main.js index.js

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 1 of 15 files from the diff.

@@ -22,6 +22,7 @@
Loading
22 22
23 23
var objectKeys = require( '@stdlib/utils-keys' );
24 24
var hasOwnProp = require( '@stdlib/assert-has-own-property' );
25 +
var resolve = require( '@stdlib/ndarray-base-dtype-resolve-str' );
25 26
var SAFE_CASTS = require( './safe_casts.json' );
26 27
27 28
@@ -106,7 +107,7 @@
Loading
106 107
/**
107 108
* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast.
108 109
*
109 -
* @param {string} [dtype] - ndarray data type
110 +
* @param {*} [dtype] - ndarray data type value
110 111
* @returns {(Object|StringArray|null)} list of ndarray data types or null
111 112
*
112 113
* @example
@@ -121,6 +122,7 @@
Loading
121 122
		// Lazily generate table...
122 123
		TABLE = generateTable();
123 124
	}
125 +
	dtype = resolve( dtype );
124 126
	if ( hasOwnProp( TABLE, dtype ) ) {
125 127
		return TABLE[ dtype ].slice();
126 128
	}

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
lib 100.00%
Project Totals (2 files) 100.00%
Loading