@stdlib/utils-map 0.1.0 → 0.2.0

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 CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2023 The Stdlib Authors.
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 &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
346
+ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
340
347
 
341
348
  </section>
342
349
 
@@ -349,8 +356,8 @@ Copyright &copy; 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.0
353
- [test-url]: https://github.com/stdlib-js/utils-map/actions/workflows/test.yml?query=branch:v0.1.0
359
+ [test-image]: https://github.com/stdlib-js/utils-map/actions/workflows/test.yml/badge.svg?branch=v0.2.0
360
+ [test-url]: https://github.com/stdlib-js/utils-map/actions/workflows/test.yml?query=branch:v0.2.0
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 &copy; 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/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/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/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/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/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/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
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
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(format('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(format('1VT1h'));return er(S(r),S(e),i,a),e}throw new TypeError(l('1VTBH',r))}B.exports=ar
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
@@ -110,9 +110,9 @@ interface Routine {
110
110
  * @returns output array
111
111
  *
112
112
  * @example
113
- * var naryFunction = require( `@stdlib/utils/nary-function` );
114
- * var abs = require( `@stdlib/math/base/special/abs` );
115
- * var array = require( `@stdlib/ndarray/array` );
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( `@stdlib/utils/nary-function` );
148
- * var abs = require( `@stdlib/math/base/special/abs` );
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( `@stdlib/utils/nary-function` );
176
- * var abs = require( `@stdlib/math/base/special/abs` );
177
- * var array = require( `@stdlib/ndarray/array` );
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( `@stdlib/utils/nary-function` );
212
- * var abs = require( `@stdlib/math/base/special/abs` );
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( `@stdlib/utils/nary-function` );
243
- * var abs = require( `@stdlib/math/base/special/abs` );
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( `@stdlib/utils/nary-function` );
252
- * var abs = require( `@stdlib/math/base/special/abs` );
253
- * var array = require( `@stdlib/ndarray/array` );
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( `@stdlib/utils/nary-function` );
268
- * var abs = require( `@stdlib/math/base/special/abs` );
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( `@stdlib/utils/nary-function` );
280
- * var abs = require( `@stdlib/math/base/special/abs` );
281
- * var array = require( `@stdlib/ndarray/array` );
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.0",
3
+ "version": "0.2.0",
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": {
@@ -37,41 +37,42 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/array-base-arraylike2object": "^0.1.0",
41
- "@stdlib/array-base-zeros": "^0.1.0",
42
- "@stdlib/assert-is-array-like-object": "^0.1.0",
43
- "@stdlib/assert-is-function": "^0.1.0",
44
- "@stdlib/assert-is-ndarray-like": "^0.1.0",
45
- "@stdlib/ndarray-base-assert-is-read-only": "^0.1.0",
46
- "@stdlib/ndarray-base-maybe-broadcast-array": "^0.1.0",
47
- "@stdlib/ndarray-base-ndarraylike2object": "^0.1.0",
48
- "@stdlib/ndarray-base-vind2bind": "^0.1.0",
49
- "@stdlib/ndarray-zeros": "^0.1.0",
50
- "@stdlib/string-format": "^0.1.0",
51
- "@stdlib/types": "^0.1.0",
52
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0",
53
- "@stdlib/error-tools-fmtprodmsg": "^0.1.0"
40
+ "@stdlib/array-base-arraylike2object": "^0.2.0",
41
+ "@stdlib/array-base-zeros": "^0.2.0",
42
+ "@stdlib/assert-is-array-like-object": "^0.2.0",
43
+ "@stdlib/assert-is-function": "^0.2.0",
44
+ "@stdlib/assert-is-ndarray-like": "^0.2.0",
45
+ "@stdlib/ndarray-base-assert-is-read-only": "^0.2.0",
46
+ "@stdlib/ndarray-base-maybe-broadcast-array": "^0.2.0",
47
+ "@stdlib/ndarray-base-ndarraylike2object": "^0.2.0",
48
+ "@stdlib/ndarray-base-vind2bind": "^0.2.0",
49
+ "@stdlib/ndarray-zeros": "^0.2.0",
50
+ "@stdlib/string-format": "^0.2.0",
51
+ "@stdlib/types": "^0.3.1",
52
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0",
53
+ "@stdlib/error-tools-fmtprodmsg": "^0.2.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@stdlib/array-base-filled": "^0.1.0",
56
+ "@stdlib/array-base-filled": "^0.2.0",
57
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",
58
+ "@stdlib/array-filled-by": "^0.1.0",
59
+ "@stdlib/array-float64": "^0.2.0",
60
+ "@stdlib/assert-is-array": "^0.2.0",
61
+ "@stdlib/complex-float32": "^0.2.0",
62
+ "@stdlib/complex-imagf": "^0.2.0",
63
+ "@stdlib/complex-realf": "^0.2.0",
64
+ "@stdlib/math-base-special-abs": "^0.2.0",
65
+ "@stdlib/math-base-special-abs2": "^0.2.0",
66
+ "@stdlib/math-base-special-pow": "^0.2.0",
67
+ "@stdlib/ndarray-array": "^0.1.0",
69
68
  "@stdlib/ndarray-ctor": "^0.1.0",
70
- "@stdlib/random-base-discrete-uniform": "^0.0.6",
71
- "@stdlib/utils-nary-function": "^0.1.0",
69
+ "@stdlib/random-base-discrete-uniform": "^0.1.0",
70
+ "@stdlib/utils-nary-function": "^0.2.0",
72
71
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
73
72
  "istanbul": "^0.4.1",
74
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
73
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
74
+ "@stdlib/bench-harness": "^0.2.0",
75
+ "@stdlib/bench": "^0.3.1"
75
76
  },
76
77
  "engines": {
77
78
  "node": ">=0.10.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