@stdlib/utils-map 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +27 -9
- package/SECURITY.md +5 -0
- package/dist/index.js +1 -1
- package/docs/types/index.d.ts +20 -20
- package/package.json +17 -45
- package/CITATION.cff +0 -30
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -306,6 +306,13 @@ console.log( y.data );
|
|
|
306
306
|
|
|
307
307
|
<section class="related">
|
|
308
308
|
|
|
309
|
+
* * *
|
|
310
|
+
|
|
311
|
+
## See Also
|
|
312
|
+
|
|
313
|
+
- <span class="package-name">[`@stdlib/utils-map-right`][@stdlib/utils/map-right]</span><span class="delimiter">: </span><span class="description">apply a function to each element in an array and assign the result to an element in an output array, iterating from right to left.</span>
|
|
314
|
+
- <span class="package-name">[`@stdlib/utils-reduce`][@stdlib/utils/reduce]</span><span class="delimiter">: </span><span class="description">apply a function against an accumulator and each element in an array and return the accumulated result.</span>
|
|
315
|
+
|
|
309
316
|
</section>
|
|
310
317
|
|
|
311
318
|
<!-- /.related -->
|
|
@@ -336,7 +343,7 @@ See [LICENSE][stdlib-license].
|
|
|
336
343
|
|
|
337
344
|
## Copyright
|
|
338
345
|
|
|
339
|
-
Copyright © 2016-
|
|
346
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
340
347
|
|
|
341
348
|
</section>
|
|
342
349
|
|
|
@@ -349,8 +356,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
349
356
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/utils-map.svg
|
|
350
357
|
[npm-url]: https://npmjs.org/package/@stdlib/utils-map
|
|
351
358
|
|
|
352
|
-
[test-image]: https://github.com/stdlib-js/utils-map/actions/workflows/test.yml/badge.svg?branch=v0.1
|
|
353
|
-
[test-url]: https://github.com/stdlib-js/utils-map/actions/workflows/test.yml?query=branch:v0.1
|
|
359
|
+
[test-image]: https://github.com/stdlib-js/utils-map/actions/workflows/test.yml/badge.svg?branch=v0.2.1
|
|
360
|
+
[test-url]: https://github.com/stdlib-js/utils-map/actions/workflows/test.yml?query=branch:v0.2.1
|
|
354
361
|
|
|
355
362
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-map/main.svg
|
|
356
363
|
[coverage-url]: https://codecov.io/github/stdlib-js/utils-map?branch=main
|
|
@@ -373,26 +380,37 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
373
380
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
374
381
|
|
|
375
382
|
[deno-url]: https://github.com/stdlib-js/utils-map/tree/deno
|
|
383
|
+
[deno-readme]: https://github.com/stdlib-js/utils-map/blob/deno/README.md
|
|
376
384
|
[umd-url]: https://github.com/stdlib-js/utils-map/tree/umd
|
|
385
|
+
[umd-readme]: https://github.com/stdlib-js/utils-map/blob/umd/README.md
|
|
377
386
|
[esm-url]: https://github.com/stdlib-js/utils-map/tree/esm
|
|
387
|
+
[esm-readme]: https://github.com/stdlib-js/utils-map/blob/esm/README.md
|
|
378
388
|
[branches-url]: https://github.com/stdlib-js/utils-map/blob/main/branches.md
|
|
379
389
|
|
|
380
390
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/utils-map/main/LICENSE
|
|
381
391
|
|
|
382
|
-
[@stdlib/ndarray/ctor]: https://www.npmjs.com/package/@stdlib/
|
|
392
|
+
[@stdlib/ndarray/ctor]: https://www.npmjs.com/package/@stdlib/ndarray-ctor
|
|
383
393
|
|
|
384
|
-
[@stdlib/ndarray/base/unary]: https://www.npmjs.com/package/@stdlib/
|
|
394
|
+
[@stdlib/ndarray/base/unary]: https://www.npmjs.com/package/@stdlib/ndarray-base-unary
|
|
385
395
|
|
|
386
|
-
[@stdlib/ndarray/base/broadcast-shapes]: https://www.npmjs.com/package/@stdlib/
|
|
396
|
+
[@stdlib/ndarray/base/broadcast-shapes]: https://www.npmjs.com/package/@stdlib/ndarray-base-broadcast-shapes
|
|
387
397
|
|
|
388
|
-
[@stdlib/ndarray/base/assert/is-contiguous]: https://www.npmjs.com/package/@stdlib/
|
|
398
|
+
[@stdlib/ndarray/base/assert/is-contiguous]: https://www.npmjs.com/package/@stdlib/ndarray-base-assert-is-contiguous
|
|
389
399
|
|
|
390
|
-
[@stdlib/array/complex64]: https://www.npmjs.com/package/@stdlib/
|
|
400
|
+
[@stdlib/array/complex64]: https://www.npmjs.com/package/@stdlib/array-complex64
|
|
391
401
|
|
|
392
|
-
[@stdlib/array/complex128]: https://www.npmjs.com/package/@stdlib/
|
|
402
|
+
[@stdlib/array/complex128]: https://www.npmjs.com/package/@stdlib/array-complex128
|
|
393
403
|
|
|
394
404
|
[mdn-typedarray-map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/map
|
|
395
405
|
|
|
406
|
+
<!-- <related-links> -->
|
|
407
|
+
|
|
408
|
+
[@stdlib/utils/map-right]: https://www.npmjs.com/package/@stdlib/utils-map-right
|
|
409
|
+
|
|
410
|
+
[@stdlib/utils/reduce]: https://www.npmjs.com/package/@stdlib/utils-reduce
|
|
411
|
+
|
|
412
|
+
<!-- </related-links> -->
|
|
413
|
+
|
|
396
414
|
</section>
|
|
397
415
|
|
|
398
416
|
<!-- /.links -->
|
package/SECURITY.md
ADDED
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function K(r,e,i,a){var t,n,v,o,s;for(t=r.data,n=e.data,v=r.accessors[0],o=e.acc
|
|
|
5
5
|
});var C=d(function(vr,z){
|
|
6
6
|
var N=require('@stdlib/assert-is-array-like-object/dist'),P=require('@stdlib/assert-is-ndarray-like/dist'),Q=require('@stdlib/assert-is-function/dist'),U=require('@stdlib/array-base-zeros/dist'),L=require('@stdlib/ndarray-base-ndarraylike2object/dist'),I=require('@stdlib/array-base-arraylike2object/dist'),W=require('@stdlib/ndarray-zeros/dist'),R=require('@stdlib/error-tools-fmtprodmsg/dist'),X=b(),Y=q();function Z(r,e,i){var a;if(!Q(e))throw new TypeError(R('1VT2H',e));if(P(r))return r=L(r),a=W(r.shape,{dtype:"generic",order:r.order}),X(r,L(a),e,i),a;if(N(r))return a=U(r.length),Y(I(r),I(a),e,i),a;throw new TypeError(R('1VTBH',r))}z.exports=Z
|
|
7
7
|
});var G=d(function(or,B){
|
|
8
|
-
var D=require('@stdlib/assert-is-array-like-object/dist'),g=require('@stdlib/assert-is-ndarray-like/dist'),_=require('@stdlib/assert-is-function/dist'),M=require('@stdlib/ndarray-base-ndarraylike2object/dist'),S=require('@stdlib/array-base-arraylike2object/dist'),$=require('@stdlib/ndarray-base-maybe-broadcast-array/dist'),A=require('@stdlib/ndarray-base-assert-is-read-only/dist'),l=require('@stdlib/error-tools-fmtprodmsg/dist'),rr=b(),er=q();function ar(r,e,i,a){var t,n;if(!_(i))throw new TypeError(l('1VT3N',i));if(g(r)){if(!g(e))throw new TypeError(l('1VTBF',e));if(A(e))throw new Error(
|
|
8
|
+
var D=require('@stdlib/assert-is-array-like-object/dist'),g=require('@stdlib/assert-is-ndarray-like/dist'),_=require('@stdlib/assert-is-function/dist'),M=require('@stdlib/ndarray-base-ndarraylike2object/dist'),S=require('@stdlib/array-base-arraylike2object/dist'),$=require('@stdlib/ndarray-base-maybe-broadcast-array/dist'),A=require('@stdlib/ndarray-base-assert-is-read-only/dist'),l=require('@stdlib/error-tools-fmtprodmsg/dist'),rr=b(),er=q();function ar(r,e,i,a){var t,n;if(!_(i))throw new TypeError(l('1VT3N',i));if(g(r)){if(!g(e))throw new TypeError(l('1VTBF',e));if(A(e))throw new Error(l('1VT1g'));return e=M(e),n=e.shape,t=M($(r,n)),t.ref=r,r=t,rr(r,e,i,a),e.ref}if(D(r)){if(!D(e)||g(e))throw new TypeError(l('1VTBG',e));if(r.length!==e.length)throw new RangeError(l('1VT1h'));return er(S(r),S(e),i,a),e}throw new TypeError(l('1VTBH',r))}B.exports=ar
|
|
9
9
|
});var ir=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),H=C(),tr=G();ir(H,"assign",tr);module.exports=H;
|
|
10
10
|
/** @license Apache-2.0 */
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/docs/types/index.d.ts
CHANGED
|
@@ -110,9 +110,9 @@ interface Routine {
|
|
|
110
110
|
* @returns output array
|
|
111
111
|
*
|
|
112
112
|
* @example
|
|
113
|
-
* var naryFunction = require(
|
|
114
|
-
* var abs = require(
|
|
115
|
-
* var array = require(
|
|
113
|
+
* var naryFunction = require( '@stdlib/utils-nary-function' );
|
|
114
|
+
* var abs = require( '@stdlib/math-base-special-abs' );
|
|
115
|
+
* var array = require( '@stdlib/ndarray-array' );
|
|
116
116
|
*
|
|
117
117
|
* var opts = {
|
|
118
118
|
* 'dtype': 'generic'
|
|
@@ -144,8 +144,8 @@ interface Routine {
|
|
|
144
144
|
* @returns output array
|
|
145
145
|
*
|
|
146
146
|
* @example
|
|
147
|
-
* var naryFunction = require(
|
|
148
|
-
* var abs = require(
|
|
147
|
+
* var naryFunction = require( '@stdlib/utils-nary-function' );
|
|
148
|
+
* var abs = require( '@stdlib/math-base-special-abs' );
|
|
149
149
|
*
|
|
150
150
|
* var arr = [ -1, -2, -3, -4, -5, -6 ];
|
|
151
151
|
*
|
|
@@ -172,9 +172,9 @@ interface Routine {
|
|
|
172
172
|
* @returns output array
|
|
173
173
|
*
|
|
174
174
|
* @example
|
|
175
|
-
* var naryFunction = require(
|
|
176
|
-
* var abs = require(
|
|
177
|
-
* var array = require(
|
|
175
|
+
* var naryFunction = require( '@stdlib/utils-nary-function' );
|
|
176
|
+
* var abs = require( '@stdlib/math-base-special-abs' );
|
|
177
|
+
* var array = require( '@stdlib/ndarray-array' );
|
|
178
178
|
*
|
|
179
179
|
* var opts = {
|
|
180
180
|
* 'dtype': 'generic',
|
|
@@ -208,8 +208,8 @@ interface Routine {
|
|
|
208
208
|
* @returns output array
|
|
209
209
|
*
|
|
210
210
|
* @example
|
|
211
|
-
* var naryFunction = require(
|
|
212
|
-
* var abs = require(
|
|
211
|
+
* var naryFunction = require( '@stdlib/utils-nary-function' );
|
|
212
|
+
* var abs = require( '@stdlib/math-base-special-abs' );
|
|
213
213
|
*
|
|
214
214
|
* var arr = [ -1, -2, -3, -4, -5, -6 ];
|
|
215
215
|
* var out = [ 0, 0, 0, 0, 0, 0 ];
|
|
@@ -239,8 +239,8 @@ interface Routine {
|
|
|
239
239
|
* @returns output array
|
|
240
240
|
*
|
|
241
241
|
* @example
|
|
242
|
-
* var naryFunction = require(
|
|
243
|
-
* var abs = require(
|
|
242
|
+
* var naryFunction = require( '@stdlib/utils-nary-function' );
|
|
243
|
+
* var abs = require( '@stdlib/math-base-special-abs' );
|
|
244
244
|
*
|
|
245
245
|
* var arr = [ -1, -2, -3, -4, -5, -6 ];
|
|
246
246
|
*
|
|
@@ -248,9 +248,9 @@ interface Routine {
|
|
|
248
248
|
* // returns [ 1, 2, 3, 4, 5, 6 ]
|
|
249
249
|
*
|
|
250
250
|
* @example
|
|
251
|
-
* var naryFunction = require(
|
|
252
|
-
* var abs = require(
|
|
253
|
-
* var array = require(
|
|
251
|
+
* var naryFunction = require( '@stdlib/utils-nary-function' );
|
|
252
|
+
* var abs = require( '@stdlib/math-base-special-abs' );
|
|
253
|
+
* var array = require( '@stdlib/ndarray-array' );
|
|
254
254
|
*
|
|
255
255
|
* var opts = {
|
|
256
256
|
* 'dtype': 'generic'
|
|
@@ -264,8 +264,8 @@ interface Routine {
|
|
|
264
264
|
* // returns [ 1, 2, 3, 4, 5, 6 ]
|
|
265
265
|
*
|
|
266
266
|
* @example
|
|
267
|
-
* var naryFunction = require(
|
|
268
|
-
* var abs = require(
|
|
267
|
+
* var naryFunction = require( '@stdlib/utils-nary-function' );
|
|
268
|
+
* var abs = require( '@stdlib/math-base-special-abs' );
|
|
269
269
|
*
|
|
270
270
|
* var arr = [ -1, -2, -3, -4, -5, -6 ];
|
|
271
271
|
* var out = [ 0, 0, 0, 0, 0, 0 ];
|
|
@@ -276,9 +276,9 @@ interface Routine {
|
|
|
276
276
|
* // => [ 1, 2, 3, 4, 5, 6 ]
|
|
277
277
|
*
|
|
278
278
|
* @example
|
|
279
|
-
* var naryFunction = require(
|
|
280
|
-
* var abs = require(
|
|
281
|
-
* var array = require(
|
|
279
|
+
* var naryFunction = require( '@stdlib/utils-nary-function' );
|
|
280
|
+
* var abs = require( '@stdlib/math-base-special-abs' );
|
|
281
|
+
* var array = require( '@stdlib/ndarray-array' );
|
|
282
282
|
*
|
|
283
283
|
* var opts = {
|
|
284
284
|
* 'dtype': 'generic',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/utils-map",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Apply a function to each element in an array and assign the result to an element in an output array.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -15,19 +15,12 @@
|
|
|
15
15
|
],
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"directories": {
|
|
18
|
-
"benchmark": "./benchmark",
|
|
19
18
|
"doc": "./docs",
|
|
20
|
-
"example": "./examples",
|
|
21
19
|
"lib": "./lib",
|
|
22
|
-
"
|
|
20
|
+
"dist": "./dist"
|
|
23
21
|
},
|
|
24
22
|
"types": "./docs/types",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "make test",
|
|
27
|
-
"test-cov": "make test-cov",
|
|
28
|
-
"examples": "make examples",
|
|
29
|
-
"benchmark": "make benchmark"
|
|
30
|
-
},
|
|
23
|
+
"scripts": {},
|
|
31
24
|
"homepage": "https://stdlib.io",
|
|
32
25
|
"repository": {
|
|
33
26
|
"type": "git",
|
|
@@ -37,42 +30,21 @@
|
|
|
37
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
31
|
},
|
|
39
32
|
"dependencies": {
|
|
40
|
-
"@stdlib/array-base-arraylike2object": "^0.1
|
|
41
|
-
"@stdlib/array-base-zeros": "^0.1
|
|
42
|
-
"@stdlib/assert-is-array-like-object": "^0.1
|
|
43
|
-
"@stdlib/assert-is-function": "^0.1
|
|
44
|
-
"@stdlib/assert-is-ndarray-like": "^0.1
|
|
45
|
-
"@stdlib/ndarray-base-assert-is-read-only": "^0.1
|
|
46
|
-
"@stdlib/ndarray-base-maybe-broadcast-array": "^0.1
|
|
47
|
-
"@stdlib/ndarray-base-ndarraylike2object": "^0.1
|
|
48
|
-
"@stdlib/ndarray-base-vind2bind": "^0.1
|
|
49
|
-
"@stdlib/ndarray-zeros": "^0.1
|
|
50
|
-
"@stdlib/string-format": "^0.1
|
|
51
|
-
"@stdlib/
|
|
52
|
-
"@stdlib/
|
|
53
|
-
"@stdlib/error-tools-fmtprodmsg": "^0.1.0"
|
|
54
|
-
},
|
|
55
|
-
"devDependencies": {
|
|
56
|
-
"@stdlib/array-base-filled": "^0.1.0",
|
|
57
|
-
"@stdlib/array-complex64": "^0.1.0",
|
|
58
|
-
"@stdlib/array-filled-by": "^0.0.2",
|
|
59
|
-
"@stdlib/array-float64": "^0.1.0",
|
|
60
|
-
"@stdlib/assert-is-array": "^0.1.0",
|
|
61
|
-
"@stdlib/bench": "^0.1.0",
|
|
62
|
-
"@stdlib/complex-float32": "^0.1.0",
|
|
63
|
-
"@stdlib/complex-imagf": "^0.1.0",
|
|
64
|
-
"@stdlib/complex-realf": "^0.1.0",
|
|
65
|
-
"@stdlib/math-base-special-abs": "^0.1.0",
|
|
66
|
-
"@stdlib/math-base-special-abs2": "^0.1.0",
|
|
67
|
-
"@stdlib/math-base-special-pow": "^0.1.0",
|
|
68
|
-
"@stdlib/ndarray-array": "^0.0.9",
|
|
69
|
-
"@stdlib/ndarray-ctor": "^0.1.0",
|
|
70
|
-
"@stdlib/random-base-discrete-uniform": "^0.0.6",
|
|
71
|
-
"@stdlib/utils-nary-function": "^0.1.0",
|
|
72
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
73
|
-
"istanbul": "^0.4.1",
|
|
74
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
|
|
33
|
+
"@stdlib/array-base-arraylike2object": "^0.2.1",
|
|
34
|
+
"@stdlib/array-base-zeros": "^0.2.1",
|
|
35
|
+
"@stdlib/assert-is-array-like-object": "^0.2.1",
|
|
36
|
+
"@stdlib/assert-is-function": "^0.2.1",
|
|
37
|
+
"@stdlib/assert-is-ndarray-like": "^0.2.1",
|
|
38
|
+
"@stdlib/ndarray-base-assert-is-read-only": "^0.2.1",
|
|
39
|
+
"@stdlib/ndarray-base-maybe-broadcast-array": "^0.2.1",
|
|
40
|
+
"@stdlib/ndarray-base-ndarraylike2object": "^0.2.1",
|
|
41
|
+
"@stdlib/ndarray-base-vind2bind": "^0.2.1",
|
|
42
|
+
"@stdlib/ndarray-zeros": "^0.2.1",
|
|
43
|
+
"@stdlib/string-format": "^0.2.1",
|
|
44
|
+
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1",
|
|
45
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.2.1"
|
|
75
46
|
},
|
|
47
|
+
"devDependencies": {},
|
|
76
48
|
"engines": {
|
|
77
49
|
"node": ">=0.10.0",
|
|
78
50
|
"npm": ">2.7.0"
|
package/CITATION.cff
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: stdlib
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this software, please cite it using the
|
|
5
|
-
metadata from this file.
|
|
6
|
-
|
|
7
|
-
type: software
|
|
8
|
-
|
|
9
|
-
authors:
|
|
10
|
-
- name: The Stdlib Authors
|
|
11
|
-
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
-
|
|
13
|
-
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
-
url: https://stdlib.io
|
|
15
|
-
|
|
16
|
-
abstract: |
|
|
17
|
-
Standard library for JavaScript and Node.js.
|
|
18
|
-
|
|
19
|
-
keywords:
|
|
20
|
-
- JavaScript
|
|
21
|
-
- Node.js
|
|
22
|
-
- TypeScript
|
|
23
|
-
- standard library
|
|
24
|
-
- scientific computing
|
|
25
|
-
- numerical computing
|
|
26
|
-
- statistical computing
|
|
27
|
-
|
|
28
|
-
license: Apache-2.0 AND BSL-1.0
|
|
29
|
-
|
|
30
|
-
date-released: 2016
|