@stdlib/math-tools-unary 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
@@ -369,7 +369,7 @@ See [LICENSE][stdlib-license].
369
369
 
370
370
  ## Copyright
371
371
 
372
- Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
372
+ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
373
373
 
374
374
  </section>
375
375
 
@@ -382,8 +382,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
382
382
  [npm-image]: http://img.shields.io/npm/v/@stdlib/math-tools-unary.svg
383
383
  [npm-url]: https://npmjs.org/package/@stdlib/math-tools-unary
384
384
 
385
- [test-image]: https://github.com/stdlib-js/math-tools-unary/actions/workflows/test.yml/badge.svg?branch=v0.1.0
386
- [test-url]: https://github.com/stdlib-js/math-tools-unary/actions/workflows/test.yml?query=branch:v0.1.0
385
+ [test-image]: https://github.com/stdlib-js/math-tools-unary/actions/workflows/test.yml/badge.svg?branch=v0.2.0
386
+ [test-url]: https://github.com/stdlib-js/math-tools-unary/actions/workflows/test.yml?query=branch:v0.2.0
387
387
 
388
388
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-tools-unary/main.svg
389
389
  [coverage-url]: https://codecov.io/github/stdlib-js/math-tools-unary?branch=main
@@ -406,8 +406,11 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
406
406
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
407
407
 
408
408
  [deno-url]: https://github.com/stdlib-js/math-tools-unary/tree/deno
409
+ [deno-readme]: https://github.com/stdlib-js/math-tools-unary/blob/deno/README.md
409
410
  [umd-url]: https://github.com/stdlib-js/math-tools-unary/tree/umd
411
+ [umd-readme]: https://github.com/stdlib-js/math-tools-unary/blob/umd/README.md
410
412
  [esm-url]: https://github.com/stdlib-js/math-tools-unary/tree/esm
413
+ [esm-readme]: https://github.com/stdlib-js/math-tools-unary/blob/esm/README.md
411
414
  [branches-url]: https://github.com/stdlib-js/math-tools-unary/blob/main/branches.md
412
415
 
413
416
  [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-tools-unary/main/LICENSE
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
@@ -9,7 +9,7 @@ var nr=require('@stdlib/assert-is-plain-object/dist'),tr=require('@stdlib/assert
9
9
  });var L=v(function(zr,S){
10
10
  var sr=require('@stdlib/assert-is-plain-object/dist'),C=require('@stdlib/assert-has-own-property/dist'),I=require('@stdlib/assert-contains/dist'),pr=require('@stdlib/ndarray-orders/dist'),vr=require('@stdlib/ndarray-dtypes/dist'),c=require('@stdlib/error-tools-fmtprodmsg/dist'),dr=pr(),fr=vr();function cr(r,e){return sr(e)?C(e,"dtype")&&(r.dtype=e.dtype,!I(fr,r.dtype))?new TypeError(c('0gz4X',"dtype",r.dtype)):C(e,"order")&&(r.order=e.order,!I(dr,r.order))?new TypeError(c('0gz4X',"order",r.order)):null:new TypeError(c('0gz2V',e));}S.exports=cr
11
11
  });var Y=v(function(Cr,U){
12
- var mr=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),D=require('@stdlib/assert-is-number/dist').isPrimitive,M=require('@stdlib/assert-is-complex-like/dist'),m=require('@stdlib/assert-is-ndarray-like/dist'),g=require('@stdlib/assert-is-collection/dist'),y=require('@stdlib/ndarray-base-buffer-dtype/dist'),gr=require('@stdlib/ndarray-base-buffer/dist'),N=require('@stdlib/ndarray-base-broadcast-array/dist'),F=require('@stdlib/error-tools-fmtprodmsg/dist'),yr=b(),K=T(),hr=O(),qr=_(),wr=z(),br=L();function Er(r,e){var u,n,t,i;if(i={number:null,complex:null,array:null,ndarray:null},n=qr(i,r),n||(u={policy:hr.output_dtype_policy},arguments.length>1&&(n=wr(u,e),n)))throw n;return t=d,mr(t,"assign",A),t;function d(a){var o,s,l,p,f;if(D(a)){if(i.number)return i.number(a);throw new TypeError(format('0gz0O'))}if(M(a)){if(i.complex)return i.complex(a);throw new TypeError(format('0gz0P'))}if(l={},arguments.length>1&&(p=br(l,arguments[1]),p))throw p;if(m(a)){if(i.ndarray===null)throw new TypeError(format('0gz0Q'));return s=l.dtype||K(a.dtype,u.policy),yr(i.ndarray,a,s,l.order||a.order)}if(g(a)){if(i.array===null)throw new TypeError(format('0gz0R'));return o=y(a)||"generic",s=l.dtype||K(o,u.policy),f=gr(s,a.length),i.array(a.length,o,a,1,s,f,1),f}throw new TypeError(F('0gz4V',a))}function A(a,o){var s,l,p;if(m(a)){if(m(o)){if(s=a.shape,l=o.shape,s.length===l.length){for(p=0;p<s.length;p++)if(s[p]!==l[p]){a=N(a,l);break}}else a=N(a,l);return i.ndarray(a,o),o}throw new TypeError(format('0gz0S'))}if(g(a)){if(g(o)){if(o.length!==a.length)throw new RangeError(format('0gz0T'));return i.array(a.length,y(a)||"generic",a,1,y(o)||"generic",o,1),o}throw new TypeError(format('0gz0U'))}throw D(a)?new TypeError(format('0gz0V')):M(a)?new TypeError(format('0gz0W')):new TypeError(F('0gz4V',a))}}U.exports=Er
12
+ var mr=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),D=require('@stdlib/assert-is-number/dist').isPrimitive,M=require('@stdlib/assert-is-complex-like/dist'),m=require('@stdlib/assert-is-ndarray-like/dist'),g=require('@stdlib/assert-is-collection/dist'),y=require('@stdlib/ndarray-base-buffer-dtype/dist'),gr=require('@stdlib/ndarray-base-buffer/dist'),N=require('@stdlib/ndarray-base-broadcast-array/dist'),F=require('@stdlib/error-tools-fmtprodmsg/dist'),yr=b(),K=T(),hr=O(),qr=_(),wr=z(),br=L();function Er(r,e){var u,n,t,i;if(i={number:null,complex:null,array:null,ndarray:null},n=qr(i,r),n||(u={policy:hr.output_dtype_policy},arguments.length>1&&(n=wr(u,e),n)))throw n;return t=d,mr(t,"assign",A),t;function d(a){var o,s,l,p,f;if(D(a)){if(i.number)return i.number(a);throw new TypeError(F('0gz0O'))}if(M(a)){if(i.complex)return i.complex(a);throw new TypeError(F('0gz0P'))}if(l={},arguments.length>1&&(p=br(l,arguments[1]),p))throw p;if(m(a)){if(i.ndarray===null)throw new TypeError(F('0gz0Q'));return s=l.dtype||K(a.dtype,u.policy),yr(i.ndarray,a,s,l.order||a.order)}if(g(a)){if(i.array===null)throw new TypeError(F('0gz0R'));return o=y(a)||"generic",s=l.dtype||K(o,u.policy),f=gr(s,a.length),i.array(a.length,o,a,1,s,f,1),f}throw new TypeError(F('0gz4V',a))}function A(a,o){var s,l,p;if(m(a)){if(m(o)){if(s=a.shape,l=o.shape,s.length===l.length){for(p=0;p<s.length;p++)if(s[p]!==l[p]){a=N(a,l);break}}else a=N(a,l);return i.ndarray(a,o),o}throw new TypeError(F('0gz0S'))}if(g(a)){if(g(o)){if(o.length!==a.length)throw new RangeError(F('0gz0T'));return i.array(a.length,y(a)||"generic",a,1,y(o)||"generic",o,1),o}throw new TypeError(F('0gz0U'))}throw D(a)?new TypeError(F('0gz0V')):M(a)?new TypeError(F('0gz0W')):new TypeError(F('0gz4V',a))}}U.exports=Er
13
13
  });var Tr=Y();module.exports=Tr;
14
14
  /** @license Apache-2.0 */
15
15
  //# sourceMappingURL=index.js.map
@@ -41,7 +41,7 @@ type ScalarFunction = ( x: number ) => number; // FIXME: add complex number supp
41
41
  * @param strideY - `y` stride length
42
42
  * @returns `y` or `undefined`
43
43
  */
44
- type StridedArrayFunction = ( N: number, x: ArrayLike<number>, strideX: number, y: ArrayLike<number>, strideY: number ) => ArrayLike<number> | void; // tslint:disable-line:max-line-length
44
+ type StridedArrayFunction = ( N: number, x: ArrayLike<number>, strideX: number, y: ArrayLike<number>, strideY: number ) => ArrayLike<number> | void;
45
45
 
46
46
  /**
47
47
  * Function which operates on each element in a strided input array `x` and assigns the results to elements in a strided output array `y` using alternative (i.e., ndarray) indexing semantics.
@@ -55,7 +55,7 @@ type StridedArrayFunction = ( N: number, x: ArrayLike<number>, strideX: number,
55
55
  * @param offsetY - starting index for `y`
56
56
  * @returns `y` or `undefined`
57
57
  */
58
- type StridedArrayFunctionWithOffsets = ( N: number, x: ArrayLike<number>, strideX: number, offsetX: number, y: ArrayLike<number>, strideY: number, offsetY: number ) => ArrayLike<number> | void; // tslint:disable-line:max-line-length
58
+ type StridedArrayFunctionWithOffsets = ( N: number, x: ArrayLike<number>, strideX: number, offsetX: number, y: ArrayLike<number>, strideY: number, offsetY: number ) => ArrayLike<number> | void;
59
59
 
60
60
  /**
61
61
  * Interface describing a resolution table object.
@@ -112,7 +112,7 @@ interface DispatchFunction {
112
112
  * @returns return value
113
113
  *
114
114
  * @example
115
- * var nabs = require( `@stdlib/math/base/special/abs` );
115
+ * var nabs = require( '@stdlib/math-base-special-abs' );
116
116
  *
117
117
  * var table = {
118
118
  * 'scalar': [
@@ -134,10 +134,10 @@ interface DispatchFunction {
134
134
  * @returns return value
135
135
  *
136
136
  * @example
137
- * var dabs = require( `@stdlib/math/strided/special/dabs` );
138
- * var sabs = require( `@stdlib/math/strided/special/sabs` );
139
- * var gabs = require( `@stdlib/math/strided/special/abs` );
140
- * var array = require( `@stdlib/ndarray/array` );
137
+ * var dabs = require( '@stdlib/math-strided-special-dabs' );
138
+ * var sabs = require( '@stdlib/math-strided-special-sabs' );
139
+ * var gabs = require( '@stdlib/math-strided-special-abs' );
140
+ * var array = require( '@stdlib/ndarray-array' );
141
141
  *
142
142
  * var table = {
143
143
  * 'ndarray': [
@@ -165,10 +165,10 @@ interface DispatchFunction {
165
165
  * @returns return value
166
166
  *
167
167
  * @example
168
- * var dabs = require( `@stdlib/math/strided/special/dabs` );
169
- * var sabs = require( `@stdlib/math/strided/special/sabs` );
170
- * var gabs = require( `@stdlib/math/strided/special/abs` );
171
- * var Float64Array = require( `@stdlib/array/float64` );
168
+ * var dabs = require( '@stdlib/math-strided-special-dabs' );
169
+ * var sabs = require( '@stdlib/math-strided-special-sabs' );
170
+ * var gabs = require( '@stdlib/math-strided-special-abs' );
171
+ * var Float64Array = require( '@stdlib/array-float64' );
172
172
  *
173
173
  * var table = {
174
174
  * 'array': [
@@ -197,11 +197,11 @@ interface DispatchFunction {
197
197
  * @returns dispatch function
198
198
  *
199
199
  * @example
200
- * var nabs = require( `@stdlib/math/base/special/abs` );
201
- * var dabs = require( `@stdlib/math/strided/special/dabs` );
202
- * var sabs = require( `@stdlib/math/strided/special/sabs` );
203
- * var gabs = require( `@stdlib/math/strided/special/abs` );
204
- * var Float64Array = require( `@stdlib/array/float64` );
200
+ * var nabs = require( '@stdlib/math-base-special-abs' );
201
+ * var dabs = require( '@stdlib/math-strided-special-dabs' );
202
+ * var sabs = require( '@stdlib/math-strided-special-sabs' );
203
+ * var gabs = require( '@stdlib/math-strided-special-abs' );
204
+ * var Float64Array = require( '@stdlib/array-float64' );
205
205
  *
206
206
  * var table = {
207
207
  * 'scalar': [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/math-tools-unary",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Multiple dispatch for unary mathematical functions.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,46 +37,47 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/array-base-copy-indexed": "^0.1.0",
41
- "@stdlib/assert-contains": "^0.1.0",
42
- "@stdlib/assert-has-own-property": "^0.1.0",
43
- "@stdlib/assert-is-collection": "^0.1.0",
44
- "@stdlib/assert-is-complex-like": "^0.1.0",
45
- "@stdlib/assert-is-function": "^0.1.0",
46
- "@stdlib/assert-is-ndarray-like": "^0.1.0",
47
- "@stdlib/assert-is-null": "^0.1.0",
48
- "@stdlib/assert-is-number": "^0.1.0",
49
- "@stdlib/assert-is-plain-object": "^0.1.0",
50
- "@stdlib/ndarray-base-broadcast-array": "^0.1.0",
51
- "@stdlib/ndarray-base-buffer": "^0.1.0",
52
- "@stdlib/ndarray-base-buffer-dtype": "^0.1.0",
53
- "@stdlib/ndarray-base-numel": "^0.1.0",
54
- "@stdlib/ndarray-base-shape2strides": "^0.1.0",
55
- "@stdlib/ndarray-ctor": "^0.1.0",
56
- "@stdlib/ndarray-dtypes": "^0.1.0",
57
- "@stdlib/ndarray-orders": "^0.1.0",
58
- "@stdlib/string-format": "^0.1.0",
59
- "@stdlib/types": "^0.1.0",
60
- "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0",
61
- "@stdlib/utils-keys": "^0.1.0",
62
- "@stdlib/error-tools-fmtprodmsg": "^0.1.0"
40
+ "@stdlib/array-base-copy-indexed": "^0.2.0",
41
+ "@stdlib/assert-contains": "^0.2.0",
42
+ "@stdlib/assert-has-own-property": "^0.2.0",
43
+ "@stdlib/assert-is-collection": "^0.2.0",
44
+ "@stdlib/assert-is-complex-like": "^0.2.0",
45
+ "@stdlib/assert-is-function": "^0.2.0",
46
+ "@stdlib/assert-is-ndarray-like": "^0.2.0",
47
+ "@stdlib/assert-is-null": "^0.2.0",
48
+ "@stdlib/assert-is-number": "^0.2.0",
49
+ "@stdlib/assert-is-plain-object": "^0.2.0",
50
+ "@stdlib/ndarray-base-broadcast-array": "^0.2.0",
51
+ "@stdlib/ndarray-base-buffer": "^0.2.0",
52
+ "@stdlib/ndarray-base-buffer-dtype": "^0.2.0",
53
+ "@stdlib/ndarray-base-numel": "^0.2.0",
54
+ "@stdlib/ndarray-base-shape2strides": "^0.2.0",
55
+ "@stdlib/ndarray-ctor": "^0.2.0",
56
+ "@stdlib/ndarray-dtypes": "^0.2.0",
57
+ "@stdlib/ndarray-orders": "^0.2.0",
58
+ "@stdlib/string-format": "^0.2.0",
59
+ "@stdlib/types": "^0.3.1",
60
+ "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0",
61
+ "@stdlib/utils-keys": "^0.2.0",
62
+ "@stdlib/error-tools-fmtprodmsg": "^0.2.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@stdlib/array-float32": "^0.1.0",
66
- "@stdlib/array-float64": "^0.1.0",
67
- "@stdlib/bench": "^0.1.0",
68
- "@stdlib/math-base-assert-is-nan": "^0.1.0",
69
- "@stdlib/math-base-special-abs": "^0.1.0",
70
- "@stdlib/math-base-special-pow": "^0.1.0",
71
- "@stdlib/math-strided-special-abs": "^0.1.0",
72
- "@stdlib/ndarray-array": "^0.0.9",
65
+ "@stdlib/array-float32": "^0.2.0",
66
+ "@stdlib/array-float64": "^0.2.0",
67
+ "@stdlib/math-base-assert-is-nan": "^0.2.0",
68
+ "@stdlib/math-base-special-abs": "^0.2.0",
69
+ "@stdlib/math-base-special-pow": "^0.2.0",
70
+ "@stdlib/math-strided-special-abs": "^0.2.0",
71
+ "@stdlib/ndarray-array": "^0.1.0",
73
72
  "@stdlib/ndarray-base-unary": "^0.1.0",
74
- "@stdlib/ndarray-dispatch": "^0.1.0",
75
- "@stdlib/ndarray-ind2sub": "^0.1.0",
76
- "@stdlib/random-base-uniform": "^0.0.6",
73
+ "@stdlib/ndarray-dispatch": "^0.2.0",
74
+ "@stdlib/ndarray-ind2sub": "^0.1.1",
75
+ "@stdlib/random-base-uniform": "^0.1.0",
77
76
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
78
77
  "istanbul": "^0.4.1",
79
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
78
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
79
+ "@stdlib/bench-harness": "^0.2.0",
80
+ "@stdlib/bench": "^0.3.1"
80
81
  },
81
82
  "engines": {
82
83
  "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