@stdlib/iter-to-array-view-right
Advanced tools
@@ -62,3 +62,3 @@ /* | ||
| */ | ||
| type Tertiary = ( value: any, index: number, src: ArrayLike<any> ) => any; | ||
| type Ternary = ( value: any, index: number, src: ArrayLike<any> ) => any; | ||
@@ -73,3 +73,3 @@ /** | ||
| */ | ||
| type MapFunction = Nullary | Unary | Binary | Tertiary; | ||
| type MapFunction = Nullary | Unary | Binary | Ternary; | ||
@@ -76,0 +76,0 @@ /** |
+5
-7
@@ -27,3 +27,3 @@ /** | ||
| var isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive; | ||
| var hasOwnProp = require( '@stdlib/assert-has-own-property' ); | ||
| var arraylike2object = require( '@stdlib/array-base-arraylike2object' ); | ||
@@ -66,2 +66,3 @@ | ||
| var fcn; | ||
| var set; | ||
| var i; | ||
@@ -144,2 +145,3 @@ var v; | ||
| } | ||
| set = arraylike2object( out ).setter; | ||
| i = end; | ||
@@ -150,8 +152,6 @@ if ( fcn ) { | ||
| v = iterator.next(); | ||
| if ( hasOwnProp( v, 'value' ) ) { | ||
| out[ i ] = fcn.call( thisArg, v.value, i, end-i-1 ); | ||
| } | ||
| if ( v.done ) { | ||
| break; | ||
| } | ||
| set( out, i, fcn.call( thisArg, v.value, i, end-i-1 ) ); | ||
| } | ||
@@ -163,8 +163,6 @@ return out; | ||
| v = iterator.next(); | ||
| if ( hasOwnProp( v, 'value' ) ) { | ||
| out[ i ] = v.value; | ||
| } | ||
| if ( v.done ) { | ||
| break; | ||
| } | ||
| set( out, i, v.value ); | ||
| } | ||
@@ -171,0 +169,0 @@ return out; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| Copyright (c) 2016-2021 The Stdlib Authors. | ||
| Copyright (c) 2016-2022 The Stdlib Authors. |
+5
-2
| { | ||
| "name": "@stdlib/iter-to-array-view-right", | ||
| "version": "0.0.6", | ||
| "version": "0.0.7", | ||
| "description": "Fill an array-like object view from right to left with values returned from an iterator.", | ||
@@ -40,3 +40,3 @@ "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@stdlib/assert-has-own-property": "^0.0.x", | ||
| "@stdlib/array-base-arraylike2object": "^0.0.x", | ||
| "@stdlib/assert-is-collection": "^0.0.x", | ||
@@ -49,7 +49,10 @@ "@stdlib/assert-is-function": "^0.0.x", | ||
| "devDependencies": { | ||
| "@stdlib/array-complex128": "^0.0.x", | ||
| "@stdlib/array-float64": "^0.0.x", | ||
| "@stdlib/array-to-iterator": "^0.0.x", | ||
| "@stdlib/bench": "^0.0.x", | ||
| "@stdlib/complex-float64": "^0.0.x", | ||
| "@stdlib/math-base-assert-is-nan": "^0.0.x", | ||
| "@stdlib/random-iter-randu": "^0.0.x", | ||
| "@stdlib/strided-base-reinterpret-complex128": "^0.0.x", | ||
| "@stdlib/utils-noop": "^0.0.x", | ||
@@ -56,0 +59,0 @@ "tape": "git+https://github.com/kgryte/tape.git#fix/globby", |
+45
-5
@@ -23,3 +23,3 @@ <!-- | ||
| [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url] | ||
| [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] --> | ||
@@ -136,5 +136,5 @@ > Fill an array-like object view from right to left with values returned from an iterator. | ||
| - `value`: iterated value | ||
| - `index`: destination index (zero-based) | ||
| - `n`: iteration index (zero-based) | ||
| - **value**: iterated value. | ||
| - **index**: destination index (zero-based). | ||
| - **n**: iteration index (zero-based). | ||
@@ -188,2 +188,3 @@ ```javascript | ||
| - Iteration stops when an output array view is full **or** an iterator finishes; whichever comes first. | ||
| - The function supports output array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/complex64`][@stdlib/array/complex64]). | ||
@@ -235,2 +236,18 @@ </section> | ||
| <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. --> | ||
| <section class="related"> | ||
| * * * | ||
| ## See Also | ||
| - <span class="package-name">[`@stdlib/array/from-iterator`][@stdlib/array/from-iterator]</span><span class="delimiter">: </span><span class="description">create (or fill) an array from an iterator.</span> | ||
| - <span class="package-name">[`@stdlib/array/to-view-iterator-right`][@stdlib/array/to-view-iterator-right]</span><span class="delimiter">: </span><span class="description">create an iterator from an array-like object view, iterating from right to left.</span> | ||
| - <span class="package-name">[`@stdlib/iter/to-array-view`][@stdlib/iter/to-array-view]</span><span class="delimiter">: </span><span class="description">fill an array-like object view with values returned from an iterator.</span> | ||
| </section> | ||
| <!-- /.related --> | ||
| <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> | ||
@@ -262,3 +279,3 @@ | ||
| Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors]. | ||
| Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors]. | ||
@@ -282,5 +299,16 @@ </section> | ||
| <!-- | ||
| [dependencies-image]: https://img.shields.io/david/stdlib-js/iter-to-array-view-right.svg | ||
| [dependencies-url]: https://david-dm.org/stdlib-js/iter-to-array-view-right/main | ||
| --> | ||
| [umd]: https://github.com/umdjs/umd | ||
| [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules | ||
| [deno-url]: https://github.com/stdlib-js/iter-to-array-view-right/tree/deno | ||
| [umd-url]: https://github.com/stdlib-js/iter-to-array-view-right/tree/umd | ||
| [esm-url]: https://github.com/stdlib-js/iter-to-array-view-right/tree/esm | ||
| [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
@@ -295,4 +323,16 @@ [chat-url]: https://gitter.im/stdlib-js/stdlib/ | ||
| [@stdlib/array/complex64]: https://www.npmjs.com/package/@stdlib/array-complex64 | ||
| <!-- <related-links> --> | ||
| [@stdlib/array/from-iterator]: https://www.npmjs.com/package/@stdlib/array-from-iterator | ||
| [@stdlib/array/to-view-iterator-right]: https://www.npmjs.com/package/@stdlib/array-to-view-iterator-right | ||
| [@stdlib/iter/to-array-view]: https://www.npmjs.com/package/@stdlib/iter-to-array-view | ||
| <!-- </related-links> --> | ||
| </section> | ||
| <!-- /.links --> |
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
53160
3.91%332
13.7%12
33.33%420
-0.47%+ Added