Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Signed-off-by: Athan <[email protected]>
  • Loading branch information
kgryte authored Dec 3, 2024
1 parent c7e9201 commit 21225c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
12 changes: 2 additions & 10 deletions lib/node_modules/@stdlib/array/fixed-endian-factory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ var idx = arr.indexOf( 5.0 );

#### TypedArrayFE.prototype.includes( searchElement\[, fromIndex] )

Returns `true` if the specified `searchElement` is present in the array.
Returns a boolean indicating whether an array includes a provided value.

```javascript
var Float64ArrayFE = fixedEndianFactory( 'float64' );
Expand All @@ -534,16 +534,8 @@ idx = arr.includes( 2.0, 2 );

idx = arr.includes( 2.0, -4 );
// returns true
```

If the specified `searchElement` is not present in the array, the method returns `false`.

```javascript
var Float64ArrayFE = fixedEndianFactory( 'float64' );

var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0, 4.0, 2.0 ] );

var idx = arr.includes( 5.0 );
idx = arr.includes( 5.0 );
// returns false
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,18 +675,19 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
}
return -1;
});

/**
* Returns `true` if the specified `searchElement` is present in the array.
* Returns a boolean indicating whether an array includes a provided value.
*
* @private
* @name includes
* @memberof TypedArray.prototype
* @type {Function}
* @param {*} searchElement - element to search for
* @param {*} searchElement - search element
* @param {integer} [fromIndex=0] - starting index (inclusive)
* @throws {TypeError} `this` must be a typed array instance
* @throws {TypeError} second argument must be an integer
* @returns {boolean} boolean indicating that `searchElement` is found
* @returns {boolean} boolean indicating whether an array includes a provided value
*/
setReadOnly( TypedArray.prototype, 'includes', function includes( searchElement, fromIndex ) {
var buf;
Expand Down

0 comments on commit 21225c3

Please sign in to comment.