Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import bufferDataTypeEnum = require( '@stdlib/ndarray/base/buffer-dtype-enum' );
import bytesPerElement = require( '@stdlib/ndarray/base/bytes-per-element' );
import char2dtype = require( '@stdlib/ndarray/base/char2dtype' );
import clampIndex = require( '@stdlib/ndarray/base/clamp-index' );
import clipIndex = require( '@stdlib/ndarray/base/clip-index' );
import complementShape = require( '@stdlib/ndarray/base/complement-shape' );
import consensusOrder = require( '@stdlib/ndarray/base/consensus-order' );
import copy = require( '@stdlib/ndarray/base/copy' );
Expand Down Expand Up @@ -1248,6 +1249,25 @@ interface Namespace {
*/
clampIndex: typeof clampIndex;

/**
* Clips an index to the interval `[0,max]`.
*
* @param idx - index
* @param max - maximum index
* @returns index
*
* @example
* var idx = ns.clipIndex( -2, 10 );
* // returns 8
*
* idx = ns.clipIndex( 15, 10 );
* // returns 10
*
* idx = ns.clipIndex( 5, 10 );
* // returns 5
*/
clipIndex: typeof clipIndex;

/**
* Returns the shape defined by the dimensions which are not included in a list of dimensions.
*
Expand Down