Test if an input value is a supported ndarray index mode.
npm install @stdlib/ndarray-base-assert-is-index-modeAlternatively,
- To load the package in a website via a
scripttag without installation and bundlers, use the ES Module available on theesmbranch. - If you are using Deno, visit the
denobranch. - For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the
umdbranch.
The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.
var isIndexMode = require( '@stdlib/ndarray-base-assert-is-index-mode' );Tests if an input value is a supported ndarray index mode.
var bool = isIndexMode( 'throw' );
// returns true
bool = isIndexMode( 'clamp' );
// returns true
bool = isIndexMode( 'wrap' );
// returns truevar isIndexMode = require( '@stdlib/ndarray-base-assert-is-index-mode' );
var bool = isIndexMode( 'throw' );
// returns true
bool = isIndexMode( 'wrap' );
// returns true
bool = isIndexMode( 'clamp' );
// returns true
bool = isIndexMode( '' );
// returns false
bool = isIndexMode( 'foo' );
// returns falseThis package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2022. The Stdlib Authors.