README.md (2467B)
1 <!-- 2 3 @license Apache-2.0 4 5 Copyright (c) 2018 The Stdlib Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 19 --> 20 21 # isIndexMode 22 23 > Test if an input value is a supported ndarray index mode. 24 25 <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> 26 27 <section class="intro"> 28 29 </section> 30 31 <!-- /.intro --> 32 33 <!-- Package usage documentation. --> 34 35 <section class="usage"> 36 37 ## Usage 38 39 ```javascript 40 var isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' ); 41 ``` 42 43 #### isIndexMode( value ) 44 45 Tests if an input `value` is a supported ndarray index mode. 46 47 ```javascript 48 var bool = isIndexMode( 'throw' ); 49 // returns true 50 51 bool = isIndexMode( 'clamp' ); 52 // returns true 53 54 bool = isIndexMode( 'wrap' ); 55 // returns true 56 ``` 57 58 </section> 59 60 <!-- /.usage --> 61 62 <!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 63 64 <section class="notes"> 65 66 </section> 67 68 <!-- /.notes --> 69 70 <!-- Package usage examples. --> 71 72 <section class="examples"> 73 74 ## Examples 75 76 <!-- eslint no-undef: "error" --> 77 78 ```javascript 79 var isIndexMode = require( '@stdlib/ndarray/base/assert/is-index-mode' ); 80 81 var bool = isIndexMode( 'throw' ); 82 // returns true 83 84 bool = isIndexMode( 'wrap' ); 85 // returns true 86 87 bool = isIndexMode( 'clamp' ); 88 // returns true 89 90 bool = isIndexMode( '' ); 91 // returns false 92 93 bool = isIndexMode( 'foo' ); 94 // returns false 95 ``` 96 97 </section> 98 99 <!-- /.examples --> 100 101 <!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 102 103 <section class="references"> 104 105 </section> 106 107 <!-- /.references --> 108 109 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> 110 111 <section class="links"> 112 113 </section> 114 115 <!-- /.links -->