Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@stdlib/iter-to-array-view-right

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/iter-to-array-view-right - npm Package Compare versions

Comparing version
0.0.7
to
0.1.0
CITATION.cff

Sorry, the diff of this file is not supported yet

+3
/// <reference path="../docs/types/index.d.ts" />
import iterator2arrayviewRight from '../docs/types/index';
export = iterator2arrayviewRight;
"use strict";var d=function(t,e){return function(){return e||t((e={exports:{}}).exports,e),e.exports}};var c=d(function(F,o){
var g=require('@stdlib/assert-is-function/dist'),w=require('@stdlib/assert-is-collection/dist'),b=require('@stdlib/assert-is-iterator-like/dist'),h=require('@stdlib/assert-is-integer/dist').isPrimitive,p=require('@stdlib/array-base-assert-is-accessor-array/dist'),q=require('@stdlib/array-base-accessor-setter/dist'),y=require('@stdlib/array-base-setter/dist'),T=require('@stdlib/array-dtype/dist'),u=require('@stdlib/error-tools-fmtprodmsg/dist');function x(t,e){var l,m,n,r,a,f,v,i,s;if(!b(t))throw new TypeError(u('0Pz46',t));if(!w(e))throw new TypeError(u('0Pz2y',e));if(m=arguments.length,m===2)n=0,r=e.length;else if(m===3)g(arguments[2])?(n=0,a=arguments[2]):n=arguments[2],r=e.length;else if(m===4)g(arguments[2])?(n=0,r=e.length,a=arguments[2],l=arguments[3]):g(arguments[3])?(n=arguments[2],r=e.length,a=arguments[3]):(n=arguments[2],r=arguments[3]);else if(m===5){if(n=arguments[2],g(arguments[3]))r=e.length,a=arguments[3],l=arguments[4];else if(r=arguments[3],a=arguments[4],!g(a))throw new TypeError(u('0Pz31',a))}else{if(n=arguments[2],r=arguments[3],a=arguments[4],!g(a))throw new TypeError(u('0Pz31',a));l=arguments[5]}if(!h(n))throw new TypeError(u('0PzE2',n));if(!h(r))throw new TypeError(u('0PzE3',r));if(r<0?(r=e.length+r,r<0&&(r=0)):r>e.length&&(r=e.length),n<0&&(n=e.length+n,n<0&&(n=0)),v=T(e),p(e)?f=q(v):f=y(v),i=r,a){for(;i>n&&(i-=1,s=t.next(),!s.done);)f(e,i,a.call(l,s.value,i,r-i-1));return e}for(;i>n&&(i-=1,s=t.next(),!s.done);)f(e,i,s.value);return e}o.exports=x
});var E=c();module.exports=E;
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map
{
"version": 3,
"sources": ["../lib/main.js", "../lib/index.js"],
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar isIteratorLike = require( '@stdlib/assert-is-iterator-like' );\nvar isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;\nvar isAccessorArray = require( '@stdlib/array-base-assert-is-accessor-array' );\nvar accessorSetter = require( '@stdlib/array-base-accessor-setter' );\nvar setter = require( '@stdlib/array-base-setter' );\nvar dtype = require( '@stdlib/array-dtype' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Fills an array-like object view from right to left with values returned from an iterator.\n*\n* @param {Iterator} iterator - source iterator\n* @param {Collection} out - output array\n* @param {integer} [begin=0] - starting index (inclusive)\n* @param {integer} [end=out.length] - ending index (non-inclusive)\n* @param {Function} [mapFcn] - function to invoke for each iterated value\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be an iterator\n* @throws {TypeError} second argument must be an array-like object\n* @throws {TypeError} third argument must be an integer (starting index) or a callback function\n* @throws {TypeError} fourth argument must be an integer (ending index) or a callback function\n* @throws {TypeError} fifth argument must be a function\n* @returns {Collection} output array\n*\n* @example\n* var randu = require( '@stdlib/random-iter-randu' );\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var iter = randu({\n* 'iter': 10\n* });\n*\n* var arr = iterator2arrayviewRight( iter, new Float64Array( 20 ), 5 );\n* // returns <Float64Array>\n*/\nfunction iterator2arrayviewRight( iterator, out ) {\n\tvar thisArg;\n\tvar nargs;\n\tvar begin;\n\tvar end;\n\tvar fcn;\n\tvar set;\n\tvar dt;\n\tvar i;\n\tvar v;\n\n\tif ( !isIteratorLike( iterator ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be an iterator protocol-compliant object. Value: `%s`.', iterator ) );\n\t}\n\tif ( !isCollection( out ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', out ) );\n\t}\n\tnargs = arguments.length;\n\tif ( nargs === 2 ) {\n\t\tbegin = 0;\n\t\tend = out.length;\n\t} else if ( nargs === 3 ) {\n\t\tif ( isFunction( arguments[ 2 ] ) ) {\n\t\t\tbegin = 0;\n\t\t\tfcn = arguments[ 2 ];\n\t\t} else {\n\t\t\tbegin = arguments[ 2 ];\n\t\t}\n\t\tend = out.length;\n\t} else if ( nargs === 4 ) {\n\t\tif ( isFunction( arguments[ 2 ] ) ) {\n\t\t\tbegin = 0;\n\t\t\tend = out.length;\n\t\t\tfcn = arguments[ 2 ];\n\t\t\tthisArg = arguments[ 3 ];\n\t\t} else if ( isFunction( arguments[ 3 ] ) ) {\n\t\t\tbegin = arguments[ 2 ];\n\t\t\tend = out.length;\n\t\t\tfcn = arguments[ 3 ];\n\t\t} else {\n\t\t\tbegin = arguments[ 2 ];\n\t\t\tend = arguments[ 3 ];\n\t\t}\n\t} else if ( nargs === 5 ) {\n\t\tbegin = arguments[ 2 ];\n\t\tif ( isFunction( arguments[ 3 ] ) ) {\n\t\t\tend = out.length;\n\t\t\tfcn = arguments[ 3 ];\n\t\t\tthisArg = arguments[ 4 ];\n\t\t} else {\n\t\t\tend = arguments[ 3 ];\n\t\t\tfcn = arguments[ 4 ];\n\t\t\tif ( !isFunction( fcn ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Fifth argument must be a function. Value: `%s`.', fcn ) );\n\t\t\t}\n\t\t}\n\t} else { // nargs > 5\n\t\tbegin = arguments[ 2 ];\n\t\tend = arguments[ 3 ];\n\t\tfcn = arguments[ 4 ];\n\t\tif ( !isFunction( fcn ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Fifth argument must be a function. Value: `%s`.', fcn ) );\n\t\t}\n\t\tthisArg = arguments[ 5 ];\n\t}\n\tif ( !isInteger( begin ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be either an integer (starting index) or a function. Value: `%s`.', begin ) );\n\t}\n\tif ( !isInteger( end ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be either an integer (ending index) or a function. Value: `%s`.', end ) );\n\t}\n\tif ( end < 0 ) {\n\t\tend = out.length + end;\n\t\tif ( end < 0 ) {\n\t\t\tend = 0;\n\t\t}\n\t} else if ( end > out.length ) {\n\t\tend = out.length;\n\t}\n\tif ( begin < 0 ) {\n\t\tbegin = out.length + begin;\n\t\tif ( begin < 0 ) {\n\t\t\tbegin = 0;\n\t\t}\n\t}\n\tdt = dtype( out );\n\tif ( isAccessorArray( out ) ) {\n\t\tset = accessorSetter( dt );\n\t} else {\n\t\tset = setter( dt );\n\t}\n\ti = end;\n\tif ( fcn ) {\n\t\twhile ( i > begin ) {\n\t\t\ti -= 1;\n\t\t\tv = iterator.next();\n\t\t\tif ( v.done ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tset( out, i, fcn.call( thisArg, v.value, i, end-i-1 ) );\n\t\t}\n\t\treturn out;\n\t}\n\twhile ( i > begin ) {\n\t\ti -= 1;\n\t\tv = iterator.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\tset( out, i, v.value );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterator2arrayviewRight;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Fill an array-like object view from right to left with values returned from an iterator.\n*\n* @module @stdlib/iter-to-array-view-right\n*\n* @example\n* var randu = require( '@stdlib/random-iter-randu' );\n* var Float64Array = require( '@stdlib/array-float64' );\n* var iterator2arrayviewRight = require( '@stdlib/iter-to-array-view-right' );\n*\n* var iter = randu({\n* 'iter': 10\n* });\n*\n* var arr = iterator2arrayviewRight( iter, new Float64Array( 20 ), 5 );\n* // returns <Float64Array>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
"mappings": "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",
"names": ["require_main", "__commonJSMin", "exports", "module", "isFunction", "isCollection", "isIteratorLike", "isInteger", "isAccessorArray", "accessorSetter", "setter", "dtype", "format", "iterator2arrayviewRight", "iterator", "out", "thisArg", "nargs", "begin", "end", "fcn", "set", "dt", "v", "main"]
}
+12
-13

@@ -19,12 +19,11 @@ /*

// TypeScript Version: 2.0
// TypeScript Version: 4.1
/// <reference types="@stdlib/types"/>
import { Iterator as Iter, IterableIterator } from '@stdlib/types/iter';
import { ArrayLike } from '@stdlib/types/array';
import { Collection } from '@stdlib/types/object';
import { TypedIterator, TypedIterableIterator } from '@stdlib/types/iter';
import { Collection } from '@stdlib/types/array';
// Define a union type representing both iterable and non-iterable iterators:
type Iterator = Iter | IterableIterator;
type Iterator<T> = TypedIterator<T> | TypedIterableIterator<T>;

@@ -36,3 +35,3 @@ /**

*/
type Nullary = () => any;
type Nullary<U, V> = ( this: V ) => U;

@@ -45,3 +44,3 @@ /**

*/
type Unary = ( value: any ) => any;
type Unary<T, U, V> = ( this: V, value: T ) => U;

@@ -55,3 +54,3 @@ /**

*/
type Binary = ( value: any, index: number ) => any;
type Binary<T, U, V> = ( this: V, value: T, index: number ) => U;

@@ -66,3 +65,3 @@ /**

*/
type Ternary = ( value: any, index: number, src: ArrayLike<any> ) => any;
type Ternary<T, U, V> = ( this: V, value: T, index: number, src: Collection<U> ) => U;

@@ -77,3 +76,3 @@ /**

*/
type MapFunction = Nullary | Unary | Binary | Ternary;
type MapFunction<T, U, V> = Nullary<U, V> | Unary<T, U, V> | Binary<T, U, V> | Ternary<T, U, V>;

@@ -101,3 +100,3 @@ /**

*/
declare function iterator2arrayviewRight( iterator: Iterator, out: Collection, mapFcn?: MapFunction, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
declare function iterator2arrayviewRight<T = unknown, U = unknown, V = unknown>( iterator: Iterator<T>, out: Collection<U>, mapFcn?: MapFunction<T, U, V>, thisArg?: ThisParameterType<MapFunction<T, U, V>> ): Collection<U>;

@@ -126,3 +125,3 @@ /**

*/
declare function iterator2arrayviewRight( iterator: Iterator, out: Collection, begin: number, mapFcn?: MapFunction, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
declare function iterator2arrayviewRight<T = unknown, U = unknown, V = unknown>( iterator: Iterator<T>, out: Collection<U>, begin: number, mapFcn?: MapFunction<T, U, V>, thisArg?: ThisParameterType<MapFunction<T, U, V>> ): Collection<U>;

@@ -153,3 +152,3 @@ /**

*/
declare function iterator2arrayviewRight( iterator: Iterator, out: Collection, begin: number, end: number, mapFcn?: MapFunction, thisArg?: any ): Collection; // tslint:disable-line:max-line-length
declare function iterator2arrayviewRight<T = unknown, U = unknown, V = unknown>( iterator: Iterator<T>, out: Collection<U>, begin: number, end: number, mapFcn?: MapFunction<T, U, V>, thisArg?: ThisParameterType<MapFunction<T, U, V>> ): Collection<U>;

@@ -156,0 +155,0 @@

@@ -27,3 +27,7 @@ /**

var isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;
var arraylike2object = require( '@stdlib/array-base-arraylike2object' );
var isAccessorArray = require( '@stdlib/array-base-assert-is-accessor-array' );
var accessorSetter = require( '@stdlib/array-base-accessor-setter' );
var setter = require( '@stdlib/array-base-setter' );
var dtype = require( '@stdlib/array-dtype' );
var format = require( '@stdlib/string-format' );

@@ -67,2 +71,3 @@

var set;
var dt;
var i;

@@ -72,6 +77,6 @@ var v;

if ( !isIteratorLike( iterator ) ) {
throw new TypeError( 'invalid argument. First argument must be an iterator protocol-compliant object. Value: `' + iterator + '`.' );
throw new TypeError( format( 'invalid argument. First argument must be an iterator protocol-compliant object. Value: `%s`.', iterator ) );
}
if ( !isCollection( out ) ) {
throw new TypeError( 'invalid argument. Second argument must be an array-like object. Value: `' + out + '`.' );
throw new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', out ) );
}

@@ -114,3 +119,3 @@ nargs = arguments.length;

if ( !isFunction( fcn ) ) {
throw new TypeError( 'invalid argument. Fifth argument must be a callback function. Value: `' + fcn + '`.' );
throw new TypeError( format( 'invalid argument. Fifth argument must be a function. Value: `%s`.', fcn ) );
}

@@ -123,3 +128,3 @@ }

if ( !isFunction( fcn ) ) {
throw new TypeError( 'invalid argument. Fifth argument must be a callback function. Value: `' + fcn + '`.' );
throw new TypeError( format( 'invalid argument. Fifth argument must be a function. Value: `%s`.', fcn ) );
}

@@ -129,6 +134,6 @@ thisArg = arguments[ 5 ];

if ( !isInteger( begin ) ) {
throw new TypeError( 'invalid argument. Third argument must be either an integer (starting index) or a callback function. Value: `' + begin + '`.' );
throw new TypeError( format( 'invalid argument. Third argument must be either an integer (starting index) or a function. Value: `%s`.', begin ) );
}
if ( !isInteger( end ) ) {
throw new TypeError( 'invalid argument. Fourth argument must be either an integer (ending index) or a callback function. Value: `' + end + '`.' );
throw new TypeError( format( 'invalid argument. Fourth argument must be either an integer (ending index) or a function. Value: `%s`.', end ) );
}

@@ -149,3 +154,8 @@ if ( end < 0 ) {

}
set = arraylike2object( out ).setter;
dt = dtype( out );
if ( isAccessorArray( out ) ) {
set = accessorSetter( dt );
} else {
set = setter( dt );
}
i = end;

@@ -152,0 +162,0 @@ if ( fcn ) {

+0
-304

@@ -178,305 +178,1 @@

END OF TERMS AND CONDITIONS
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by this
license (the "Software") to use, reproduce, display, distribute, execute, and
transmit the Software, and to prepare derivative works of the Software, and to
permit third-parties to whom the Software is furnished to do so, all subject to
the following:
The copyright notices in the Software and this entire statement, including the
above license grant, this restriction and the following disclaimer, must be
included in all copies of the Software, in whole or in part, and all derivative
works of the Software, unless such copies or derivative works are solely in the
form of machine-executable object code generated by a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
DEPENDENCIES
The library links against the following external libraries, which have their own
licenses:
* OpenBLAS <https://raw.githubusercontent.com/xianyi/OpenBLAS/
def146efed8d5908ea04e22668feeab7099599a0/LICENSE>
Copyright (c) 2011-2014, The OpenBLAS Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Neither the name of the OpenBLAS project nor the names of
its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Electron <https://raw.githubusercontent.com/electron/electron/
c4cfb3e7110266b9d7ad80e1ae097c4db564501c/LICENSE>
Copyright (c) 2013-2017 GitHub Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Boost <http://www.boost.org/LICENSE_1_0.txt>
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
* Cephes <http://www.netlib.org/cephes/readme>
Copyright (c) 1984-2000 Stephen L. Moshier
Some software in this archive may be from the book _Methods and Programs for
Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989)
or from the Cephes Mathematical Library, a commercial product. In either event,
it is copyrighted by the author. What you see here may be used freely but it
comes with no support or guarantee.
Stephen L. Moshier
moshier@na-net.ornl.gov
ATTRIBUTION
The library contains implementations from the following external libraries,
which have their own licenses:
* FreeBSD <https://svnweb.freebsd.org/>
Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved.
Developed at SunPro, a Sun Microsystems, Inc. business.
Permission to use, copy, modify, and distribute this
software is freely granted, provided that this notice
is preserved.
* FDLIBM <http://www.netlib.org/fdlibm/>
Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
Developed at SunPro, a Sun Microsystems, Inc. business.
Permission to use, copy, modify, and distribute this
software is freely granted, provided that this notice
is preserved.
* Go <https://raw.githubusercontent.com/golang/go/master/LICENSE>
Copyright (c) 2009 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>
Public domain.
* ESLint <https://raw.githubusercontent.com/eslint/eslint/master/LICENSE>
Copyright JS Foundation and other contributors, https://js.foundation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
* StatsFuns.jl <https://raw.githubusercontent.com/JuliaStats/StatsFuns.jl/
e66dd973650c375bc1739c820e5b96bb5bd000a8/LICENSE.md>
Copyright (c) 2015: Dahua Lin.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/
SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE>
The MIT License (MIT)
Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others:
https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
* MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/
mt19937ar.c>
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+1
-1

@@ -1,1 +0,1 @@

Copyright (c) 2016-2022 The Stdlib Authors.
Copyright (c) 2016-2023 The Stdlib Authors.
{
"name": "@stdlib/iter-to-array-view-right",
"version": "0.0.7",
"version": "0.1.0",
"description": "Fill an array-like object view from right to left with values returned from an iterator.",

@@ -40,22 +40,27 @@ "license": "Apache-2.0",

"dependencies": {
"@stdlib/array-base-arraylike2object": "^0.0.x",
"@stdlib/assert-is-collection": "^0.0.x",
"@stdlib/assert-is-function": "^0.0.x",
"@stdlib/assert-is-integer": "^0.0.x",
"@stdlib/assert-is-iterator-like": "^0.0.x",
"@stdlib/types": "^0.0.x"
"@stdlib/array-base-accessor-setter": "^0.1.0",
"@stdlib/array-base-assert-is-accessor-array": "^0.1.0",
"@stdlib/array-base-setter": "^0.1.0",
"@stdlib/array-dtype": "^0.1.0",
"@stdlib/assert-is-collection": "^0.1.0",
"@stdlib/assert-is-function": "^0.1.0",
"@stdlib/assert-is-integer": "^0.1.0",
"@stdlib/assert-is-iterator-like": "^0.1.0",
"@stdlib/string-format": "^0.1.0",
"@stdlib/types": "^0.1.0",
"@stdlib/error-tools-fmtprodmsg": "^0.1.0"
},
"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",
"@stdlib/array-complex128": "^0.1.0",
"@stdlib/array-float64": "^0.1.0",
"@stdlib/array-to-iterator": "^0.0.6",
"@stdlib/bench": "^0.1.0",
"@stdlib/complex-float64": "^0.1.0",
"@stdlib/math-base-assert-is-nan": "^0.1.0",
"@stdlib/random-iter-randu": "^0.0.6",
"@stdlib/strided-base-reinterpret-complex128": "^0.1.0",
"@stdlib/utils-noop": "^0.1.0",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
"istanbul": "^0.4.1",
"tap-spec": "5.x.x"
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
},

@@ -103,5 +108,5 @@ "engines": {

"funding": {
"type": "patreon",
"url": "https://www.patreon.com/athan"
"type": "opencollective",
"url": "https://opencollective.com/stdlib"
}
}
+26
-14

@@ -21,2 +21,13 @@ <!--

<details>
<summary>
About stdlib...
</summary>
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
</details>
# iterator2arrayviewRight

@@ -187,3 +198,3 @@

- 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]).
- The function supports output array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array-complex64`][@stdlib/array/complex64]).

@@ -243,5 +254,5 @@ </section>

- <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>
- <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>

@@ -278,3 +289,3 @@ </section>

Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].
Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].

@@ -292,4 +303,4 @@ </section>

[test-image]: https://github.com/stdlib-js/iter-to-array-view-right/actions/workflows/test.yml/badge.svg
[test-url]: https://github.com/stdlib-js/iter-to-array-view-right/actions/workflows/test.yml
[test-image]: https://github.com/stdlib-js/iter-to-array-view-right/actions/workflows/test.yml/badge.svg?branch=v0.1.0
[test-url]: https://github.com/stdlib-js/iter-to-array-view-right/actions/workflows/test.yml?query=branch:v0.1.0

@@ -306,2 +317,9 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/iter-to-array-view-right/main.svg

[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
[stdlib]: https://github.com/stdlib-js/stdlib
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
[umd]: https://github.com/umdjs/umd

@@ -313,10 +331,4 @@ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules

[esm-url]: https://github.com/stdlib-js/iter-to-array-view-right/tree/esm
[branches-url]: https://github.com/stdlib-js/iter-to-array-view-right/blob/main/branches.md
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
[chat-url]: https://gitter.im/stdlib-js/stdlib/
[stdlib]: https://github.com/stdlib-js/stdlib
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/iter-to-array-view-right/main/LICENSE

@@ -323,0 +335,0 @@

{{alias}}( iterator, dest[, begin[, end]][, mapFcn[, thisArg]] )
Fills an array-like object view from right to left with values returned from
an iterator.
When invoked, an input function is provided three arguments:
- value: iterated value
- index: destination index (zero-based)
- n: iteration index (zero-based)
Iteration stops when an output array view is full or an iterator finishes;
whichever comes first.
Parameters
----------
iterator: Object
Source iterator.
dest: ArrayLikeObject
Output array-like object.
begin: integer (optional)
Starting index (inclusive). When negative, determined relative to the
last element. Default: 0.
end: integer (optional)
Ending index (non-inclusive). When negative, determined relative to the
last element. Default: dest.length.
mapFcn: Function (optional)
Function to invoke for each iterated value.
thisArg: any (optional)
Execution context.
Returns
-------
out: ArrayLikeObject
Output array.
Examples
--------
> var it = {{alias:@stdlib/random/iter/randu}}({ 'iter': 10 });
> var out = new {{alias:@stdlib/array/float64}}( 20 );
> var arr = {{alias}}( it, out, 5, 15 )
See Also
--------
/*
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import randu = require( '@stdlib/random-iter-randu' );
import iterator2arrayviewRight = require( './index' );
/**
* Multiplies a value by 10.
*
* @param v - iterated value
* @returns new value
*/
function times10( v: number ): number {
return v * 10.0;
}
// TESTS //
// The function returns a collection...
{
const iter = randu( { 'iter': 10 } );
const out = new Float64Array( 10 );
iterator2arrayviewRight( iter, out ); // $ExpectType Collection
iterator2arrayviewRight( iter, out, times10 ); // $ExpectType Collection
iterator2arrayviewRight( iter, out, times10, {} ); // $ExpectType Collection
iterator2arrayviewRight( iter, out, 0, 10, times10 ); // $ExpectType Collection
iterator2arrayviewRight( iter, out, 0, 10, times10, {} ); // $ExpectType Collection
}
// The compiler throws an error if the function is provided a first argument which is not an iterator...
{
iterator2arrayviewRight( 'abc', [] ); // $ExpectError
iterator2arrayviewRight( 123, [] ); // $ExpectError
iterator2arrayviewRight( true, [] ); // $ExpectError
iterator2arrayviewRight( false, [] ); // $ExpectError
iterator2arrayviewRight( [], [] ); // $ExpectError
iterator2arrayviewRight( {}, [] ); // $ExpectError
iterator2arrayviewRight( null, [] ); // $ExpectError
iterator2arrayviewRight( undefined, [] ); // $ExpectError
}
// The compiler throws an error if the function is provided a second argument which is not a collection...
{
const iter = randu( { 'iter': 10 } );
iterator2arrayviewRight( iter, 123 ); // $ExpectError
iterator2arrayviewRight( iter, {} ); // $ExpectError
iterator2arrayviewRight( iter, true ); // $ExpectError
iterator2arrayviewRight( iter, false ); // $ExpectError
iterator2arrayviewRight( iter, null ); // $ExpectError
}
// The compiler throws an error if the function is provided a third argument which is not a number or map function...
{
const iter = randu( { 'iter': 10 } );
iterator2arrayviewRight( iter, [], 'abc' ); // $ExpectError
iterator2arrayviewRight( iter, [], [] ); // $ExpectError
iterator2arrayviewRight( iter, [], {} ); // $ExpectError
iterator2arrayviewRight( iter, [], true ); // $ExpectError
iterator2arrayviewRight( iter, [], false ); // $ExpectError
iterator2arrayviewRight( iter, [], null ); // $ExpectError
}
// The compiler throws an error if the function is provided a `begin` argument and a fourth argument which is not a number or map function...
{
const iter = randu( { 'iter': 10 } );
iterator2arrayviewRight( iter, [], 2, 'abc' ); // $ExpectError
iterator2arrayviewRight( iter, [], 2, [] ); // $ExpectError
iterator2arrayviewRight( iter, [], 2, {} ); // $ExpectError
iterator2arrayviewRight( iter, [], 2, true ); // $ExpectError
iterator2arrayviewRight( iter, [], 2, false ); // $ExpectError
iterator2arrayviewRight( iter, [], 2, null ); // $ExpectError
}
// The compiler throws an error if the function is provided an unsupported number of arguments...
{
const iter = randu( { 'iter': 10 } );
iterator2arrayviewRight(); // $ExpectError
iterator2arrayviewRight( iter ); // $ExpectError
iterator2arrayviewRight( iter, [], 0, 10, times10, {}, 123 ); // $ExpectError
}