Skip to content

Commit 57aec1d

Browse files
committed
Auto-generated commit
1 parent c074d7c commit 57aec1d

File tree

13 files changed

+189
-202
lines changed

13 files changed

+189
-202
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2024-12-02)
7+
## Unreleased (2024-12-03)
88

99
<section class="features">
1010

@@ -46,6 +46,8 @@ A total of 11 issues were closed in this release:
4646

4747
<details>
4848

49+
- [`e5d32c5`](https://github.com/stdlib-js/stdlib/commit/e5d32c53f8f552fae4d672c8750619a59ce078ac) - **chore:** minor clean-up _(by Philipp Burckhardt)_
50+
- [`9798530`](https://github.com/stdlib-js/stdlib/commit/97985302871b99c45462d43479e246c4549c3991) - **chore:** minor clean-up _(by Philipp Burckhardt)_
4951
- [`a0ba090`](https://github.com/stdlib-js/stdlib/commit/a0ba090515dfdfe617e1179ddb7581db24fec44b) - **feat:** add `with` method to `array/fixed-endian-factory` [(#3291)](https://github.com/stdlib-js/stdlib/pull/3291) _(by Aayush Khanna, Philipp Burckhardt)_
5052
- [`1242bbf`](https://github.com/stdlib-js/stdlib/commit/1242bbf3e43a142f8d0bd4a66aece5baa33c03fe) - **feat:** add `filter` method to `array/fixed-endian-factory` [(#3278)](https://github.com/stdlib-js/stdlib/pull/3278) _(by Aayush Khanna, Philipp Burckhardt)_
5153
- [`41af546`](https://github.com/stdlib-js/stdlib/commit/41af5467a9067f22ec8facdb535389bac10093bd) - **feat:** add `reduceRight` method to `array/fixed-endian-factory` [(#3300)](https://github.com/stdlib-js/stdlib/pull/3300) _(by Aayush Khanna, Philipp Burckhardt)_

README.md

Lines changed: 59 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -423,35 +423,35 @@ var count = context.count;
423423
// returns 3
424424
```
425425

426-
<a name="method-for-each"></a>
426+
<a name="method-filter"></a>
427427

428-
#### TypedArrayFE.prototype.forEach( callbackFn\[, thisArg] )
428+
#### TypedArrayFE.prototype.filter( predicate\[, thisArg] )
429429

430-
Invokes a function once for each array element.
430+
Returns a new array containing the elements of an array which pass a test implemented by a predicate function.
431431

432432
```javascript
433-
function log( v, i ) {
434-
console.log( '%s: %s', i.toString(), v.toString() );
433+
function predicate( v ) {
434+
return ( v % 2 === 0 );
435435
}
436436

437437
var Float64ArrayFE = fixedEndianFactory( 'float64' );
438438

439-
var arr = new Float64ArrayFE( 'little-endian', 3 );
439+
var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0, 4.0 ] );
440+
441+
var out = arr.filter( predicate );
440442
// returns <Float64ArrayFE>
441443

442-
arr.set( 1.5, 0 );
443-
arr.set( 2.5, 1 );
444-
arr.set( 3.5, 2 );
444+
var len = out.length;
445+
// returns 2
445446

446-
arr.forEach( log );
447-
/* =>
448-
0: 1.5
449-
1: 2.5
450-
2: 3.5
451-
*/
447+
var v = out.get( 0 );
448+
// returns 2.0
449+
450+
v = out.get( 1 );
451+
// return 4.0
452452
```
453453

454-
The invoked function is provided three arguments:
454+
The `predicate` function is provided three arguments:
455455

456456
- **value**: current array element.
457457
- **index**: current array element index.
@@ -460,59 +460,58 @@ The invoked function is provided three arguments:
460460
To set the function execution context, provide a `thisArg`.
461461

462462
```javascript
463-
function fcn( v, i ) {
463+
function predicate( v, i ) {
464464
this.count += 1;
465-
console.log( '%s: %s', i.toString(), v.toString() );
465+
return ( v % 2 === 0 );
466466
}
467467

468-
var Float64ArrayFE = fixedEndianFactory( 'float64' );
469-
470-
var arr = new Float64ArrayFE( 'little-endian', 3 );
471-
// returns <Float64ArrayFE>
472-
473468
var context = {
474469
'count': 0
475470
};
476471

477-
arr.set( 1.0, 0 );
478-
arr.set( 2.0, 1 );
479-
arr.set( 3.0, 2 );
472+
var Float64ArrayFE = fixedEndianFactory( 'float64' );
480473

481-
arr.forEach( fcn, context );
474+
var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0, 4.0 ] );
475+
476+
var out = arr.filter( predicate, context );
477+
// returns <Float64ArrayFE>
478+
479+
var len = out.length;
480+
// returns 2
482481

483482
var count = context.count;
484-
// returns 3
483+
// returns 4
485484
```
486485

487-
<a name="method-filter"></a>
486+
<a name="method-for-each"></a>
488487

489-
#### TypedArrayFE.prototype.filter( predicate\[, thisArg] )
488+
#### TypedArrayFE.prototype.forEach( callbackFn\[, thisArg] )
490489

491-
Returns a new array containing the elements of an array which pass a test implemented by a predicate function.
490+
Invokes a function once for each array element.
492491

493492
```javascript
494-
function predicate( v ) {
495-
return ( v % 2 === 0 );
493+
function log( v, i ) {
494+
console.log( '%s: %s', i.toString(), v.toString() );
496495
}
497496

498497
var Float64ArrayFE = fixedEndianFactory( 'float64' );
499498

500-
var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0, 4.0 ] );
501-
502-
var out = arr.filter( predicate );
499+
var arr = new Float64ArrayFE( 'little-endian', 3 );
503500
// returns <Float64ArrayFE>
504501

505-
var len = out.length;
506-
// returns 2
507-
508-
var v = out.get( 0 );
509-
// returns 2.0
502+
arr.set( 1.5, 0 );
503+
arr.set( 2.5, 1 );
504+
arr.set( 3.5, 2 );
510505

511-
v = out.get( 1 );
512-
// return 4.0
506+
arr.forEach( log );
507+
/* =>
508+
0: 1.5
509+
1: 2.5
510+
2: 3.5
511+
*/
513512
```
514513

515-
The `predicate` function is provided three arguments:
514+
The invoked function is provided three arguments:
516515

517516
- **value**: current array element.
518517
- **index**: current array element index.
@@ -521,27 +520,28 @@ The `predicate` function is provided three arguments:
521520
To set the function execution context, provide a `thisArg`.
522521

523522
```javascript
524-
function predicate( v, i ) {
523+
function fcn( v, i ) {
525524
this.count += 1;
526-
return ( v % 2 === 0 );
525+
console.log( '%s: %s', i.toString(), v.toString() );
527526
}
528527

528+
var Float64ArrayFE = fixedEndianFactory( 'float64' );
529+
530+
var arr = new Float64ArrayFE( 'little-endian', 3 );
531+
// returns <Float64ArrayFE>
532+
529533
var context = {
530534
'count': 0
531535
};
532536

533-
var Float64ArrayFE = fixedEndianFactory( 'float64' );
534-
535-
var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0, 4.0 ] );
536-
537-
var out = arr.filter( predicate, context );
538-
// returns <Float64ArrayFE>
537+
arr.set( 1.0, 0 );
538+
arr.set( 2.0, 1 );
539+
arr.set( 3.0, 2 );
539540

540-
var len = out.length;
541-
// returns 2
541+
arr.forEach( fcn, context );
542542

543543
var count = context.count;
544-
// returns 4
544+
// returns 3
545545
```
546546

547547
<a name="method-get"></a>
@@ -916,7 +916,7 @@ var str = arr.toString();
916916

917917
#### TypedArrayFE.prototype.join( \[separator] )
918918

919-
Serializes the array elements into a string, with elements separated by the specified `separator`. If no `separator` is provided, a comma (`,`) is used as the default.
919+
Returns a new string by concatenating all array elements.
920920

921921
```javascript
922922
var Float64ArrayFE = fixedEndianFactory( 'float64' );
@@ -925,20 +925,17 @@ var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0 ] );
925925

926926
var str = arr.join();
927927
// returns '1,2,3'
928-
929-
str = arr.join( ' - ' );
930-
// returns '1 - 2 - 3'
931928
```
932929

933-
If the provided `separator` is not a string, it is coerced to a string.
930+
By default, the method separates serialized array elements with a comma. To use an alternative separator, provide a `separator` string.
934931

935932
```javascript
936933
var Float64ArrayFE = fixedEndianFactory( 'float64' );
937934

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

940-
var str = arr.join( 0 );
941-
// returns '10203'
937+
var str = arr.join( ' - ' );
938+
// returns '1 - 2 - 3'
942939
```
943940

944941
<a name="method-with"></a>

benchmark/benchmark.join.length.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ var Float64ArrayFE = factory( 'float64' );
4242
* @returns {Function} benchmark function
4343
*/
4444
function createBenchmark( len ) {
45-
var arr;
46-
arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) );
45+
var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) );
4746
return benchmark;
4847

4948
/**
File renamed without changes.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)