File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
lib/node_modules/@stdlib/ndarray/base/assert/is-order/lib Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change 20
20
21
21
// MODULES //
22
22
23
+ var contains = require ( '@stdlib/array/base/assert/contains' ) . factory ;
23
24
var orders = require ( '@stdlib/ndarray/orders' ) ;
24
25
25
26
26
- // VARIABLES //
27
-
28
- var ORDERS = orders ( ) ;
29
- var len = ORDERS . length ;
30
-
31
-
32
27
// MAIN //
33
28
34
29
/**
35
30
* Tests whether an input value is an ndarray order.
36
31
*
32
+ * @name isOrder
33
+ * @type {Function }
37
34
* @param {* } v - value to test
38
35
* @returns {boolean } boolean indicating whether an input value is an ndarray order
39
36
*
@@ -47,15 +44,7 @@ var len = ORDERS.length;
47
44
* bool = isOrder( 'foo' );
48
45
* // returns false
49
46
*/
50
- function isOrder ( v ) {
51
- var i ;
52
- for ( i = 0 ; i < len ; i ++ ) {
53
- if ( v === ORDERS [ i ] ) {
54
- return true ;
55
- }
56
- }
57
- return false ;
58
- }
47
+ var isOrder = contains ( orders ( ) ) ;
59
48
60
49
61
50
// EXPORTS //
You can’t perform that action at this time.
0 commit comments