@@ -25,7 +25,7 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">nda
2525 < div class ='fl pad1y space-right2 '>
2626 < span class ="strong "> 100% </ span >
2727 < span class ="quiet "> Statements</ span >
28- < span class ='fraction '> 73/73 </ span >
28+ < span class ='fraction '> 80/80 </ span >
2929 </ div >
3030
3131
@@ -46,7 +46,7 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">nda
4646 < div class ='fl pad1y space-right2 '>
4747 < span class ="strong "> 100% </ span >
4848 < span class ="quiet "> Lines</ span >
49- < span class ='fraction '> 73/73 </ span >
49+ < span class ='fraction '> 80/80 </ span >
5050 </ div >
5151
5252
@@ -136,7 +136,14 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">nda
136136< a name ='L71 '> </ a > < a href ='#L71 '> 71</ a >
137137< a name ='L72 '> </ a > < a href ='#L72 '> 72</ a >
138138< a name ='L73 '> </ a > < a href ='#L73 '> 73</ a >
139- < a name ='L74 '> </ a > < a href ='#L74 '> 74</ a > </ td > < td class ="line-coverage quiet "> < span class ="cline-any cline-yes "> 1x</ span >
139+ < a name ='L74 '> </ a > < a href ='#L74 '> 74</ a >
140+ < a name ='L75 '> </ a > < a href ='#L75 '> 75</ a >
141+ < a name ='L76 '> </ a > < a href ='#L76 '> 76</ a >
142+ < a name ='L77 '> </ a > < a href ='#L77 '> 77</ a >
143+ < a name ='L78 '> </ a > < a href ='#L78 '> 78</ a >
144+ < a name ='L79 '> </ a > < a href ='#L79 '> 79</ a >
145+ < a name ='L80 '> </ a > < a href ='#L80 '> 80</ a >
146+ < a name ='L81 '> </ a > < a href ='#L81 '> 81</ a > </ td > < td class ="line-coverage quiet "> < span class ="cline-any cline-yes "> 1x</ span >
140147< span class ="cline-any cline-yes "> 1x</ span >
141148< span class ="cline-any cline-yes "> 1x</ span >
142149< span class ="cline-any cline-yes "> 1x</ span >
@@ -180,30 +187,37 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">nda
180187< span class ="cline-any cline-yes "> 1x</ span >
181188< span class ="cline-any cline-yes "> 1x</ span >
182189< span class ="cline-any cline-yes "> 1x</ span >
183- < span class ="cline-any cline-yes "> 1536x</ span >
184- < span class ="cline-any cline-yes "> 1536x</ span >
185- < span class ="cline-any cline-yes "> 1536x</ span >
186- < span class ="cline-any cline-yes "> 256x</ span >
187- < span class ="cline-any cline-yes "> 256x</ span >
188- < span class ="cline-any cline-yes "> 1280x</ span >
189- < span class ="cline-any cline-yes "> 1536x</ span >
190- < span class ="cline-any cline-yes "> 80x</ span >
191- < span class ="cline-any cline-yes "> 80x</ span >
192- < span class ="cline-any cline-yes "> 1200x</ span >
193- < span class ="cline-any cline-yes "> 1536x</ span >
194- < span class ="cline-any cline-yes "> 480x</ span >
195- < span class ="cline-any cline-yes "> 480x</ span >
196- < span class ="cline-any cline-yes "> 720x</ span >
197- < span class ="cline-any cline-yes "> 1536x</ span >
198- < span class ="cline-any cline-yes "> 240x</ span >
199- < span class ="cline-any cline-yes "> 240x</ span >
200- < span class ="cline-any cline-yes "> 480x</ span >
201- < span class ="cline-any cline-yes "> 1536x</ span >
202- < span class ="cline-any cline-yes "> 240x</ span >
203- < span class ="cline-any cline-yes "> 240x</ span >
204- < span class ="cline-any cline-yes "> 240x</ span >
205- < span class ="cline-any cline-yes "> 240x</ span >
206- < span class ="cline-any cline-yes "> 1536x</ span >
190+ < span class ="cline-any cline-yes "> 1x</ span >
191+ < span class ="cline-any cline-yes "> 4644x</ span >
192+ < span class ="cline-any cline-yes "> 4644x</ span >
193+ < span class ="cline-any cline-yes "> 4644x</ span >
194+ < span class ="cline-any cline-yes "> 4644x</ span >
195+ < span class ="cline-any cline-yes "> 4644x</ span >
196+ < span class ="cline-any cline-yes "> 4644x</ span >
197+ < span class ="cline-any cline-yes "> 774x</ span >
198+ < span class ="cline-any cline-yes "> 774x</ span >
199+ < span class ="cline-any cline-yes "> 3870x</ span >
200+ < span class ="cline-any cline-yes "> 3870x</ span >
201+ < span class ="cline-any cline-yes "> 3870x</ span >
202+ < span class ="cline-any cline-yes "> 3870x</ span >
203+ < span class ="cline-any cline-yes "> 4644x</ span >
204+ < span class ="cline-any cline-yes "> 260x</ span >
205+ < span class ="cline-any cline-yes "> 260x</ span >
206+ < span class ="cline-any cline-yes "> 3610x</ span >
207+ < span class ="cline-any cline-yes "> 4644x</ span >
208+ < span class ="cline-any cline-yes "> 1444x</ span >
209+ < span class ="cline-any cline-yes "> 1444x</ span >
210+ < span class ="cline-any cline-yes "> 2166x</ span >
211+ < span class ="cline-any cline-yes "> 4644x</ span >
212+ < span class ="cline-any cline-yes "> 722x</ span >
213+ < span class ="cline-any cline-yes "> 722x</ span >
214+ < span class ="cline-any cline-yes "> 1444x</ span >
215+ < span class ="cline-any cline-yes "> 4644x</ span >
216+ < span class ="cline-any cline-yes "> 722x</ span >
217+ < span class ="cline-any cline-yes "> 722x</ span >
218+ < span class ="cline-any cline-yes "> 722x</ span >
219+ < span class ="cline-any cline-yes "> 722x</ span >
220+ < span class ="cline-any cline-yes "> 4644x</ span >
207221< span class ="cline-any cline-yes "> 1x</ span >
208222< span class ="cline-any cline-yes "> 1x</ span >
209223< span class ="cline-any cline-yes "> 1x</ span >
@@ -234,15 +248,16 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">nda
234248var isSafeCast = require( '@stdlib/ndarray/base/assert/is-safe-data-type-cast' );
235249var isMostlySafeCast = require( '@stdlib/ndarray/base/assert/is-mostly-safe-data-type-cast' );
236250var isSameKindCast = require( '@stdlib/ndarray/base/assert/is-same-kind-data-type-cast' );
251+ var resolveStr = require( '@stdlib/ndarray/base/dtype-resolve-str' );
237252
238253
239254// MAIN //
240255
241256/**
242257* Returns a boolean indicating if a provided ndarray data type can be cast to another ndarray data type according to a specified casting mode.
243258*
244- * @param {string } from - ndarray data type
245- * @param {string } to - ndarray data type
259+ * @param {* } from - ndarray data type
260+ * @param {* } to - ndarray data type
246261* @param {string} casting - ndarray casting mode
247262* @returns {boolean} boolean indicating if a data type can be cast to another data type
248263*
@@ -254,12 +269,18 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">nda
254269* // returns false
255270*/
256271function isAllowedCast( from, to, casting ) {
272+ var dt1;
273+ var dt2;
274+
257275 // Anything goes for "unsafe" casting...
258276 if ( casting === 'unsafe' ) {
259277 return true;
260278 }
279+ dt1 = resolveStr( from );
280+ dt2 = resolveStr( to );
281+
261282 // "Casting" to the same data type is always allowed, regardless of the casting mode...
262- if ( from === to ) {
283+ if ( dt1 === dt2 ) {
263284 return true;
264285 }
265286 // No casts between different data types are allowed in "none" or "equiv" casting modes...
@@ -289,7 +310,7 @@ <h1><a href="../../../../../index.html">All files</a> / <a href="index.html">nda
289310 < div class ='footer quiet pad2 space-top1 center small '>
290311 Code coverage generated by
291312 < a href ="https://istanbul.js.org/ " target ="_blank " rel ="noopener noreferrer "> istanbul</ a >
292- at 2025-06-29T06:51:38.352Z
313+ at 2025-09-20T09:19:00.053Z
293314 </ div >
294315 < script src ="../../../../../prettify.js "> </ script >
295316 < script >
0 commit comments