diff --git a/.github/.keepalive b/.github/.keepalive new file mode 100644 index 0000000..ac09e08 --- /dev/null +++ b/.github/.keepalive @@ -0,0 +1 @@ +2023-11-01T05:52:53.006Z diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b17435b..0037bdb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -182,7 +182,11 @@ jobs: fi # Trim leading and trailing whitespace: dep=$(echo "$dep" | xargs) - version="^$(npm view $dep version)" + version="$(npm view $dep version)" + if [[ -z "$version" ]]; then + continue + fi + version="^$version" jq -r --arg dep "$dep" --arg version "$version" '.dependencies[$dep] = $version' package.json > package.json.tmp mv package.json.tmp package.json done @@ -192,7 +196,11 @@ jobs: fi # Trim leading and trailing whitespace: dep=$(echo "$dep" | xargs) - version="^$(npm view $dep version)" + version="$(npm view $dep version)" + if [[ -z "$version" ]]; then + continue + fi + version="^$version" jq -r --arg dep "$dep" --arg version "$version" '.devDependencies[$dep] = $version' package.json > package.json.tmp mv package.json.tmp package.json done diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 93c4bde..0dae4fe 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -37,3 +37,4 @@ Stephannie Jiménez Gacha Yernar Yergaziyev orimiles5 <97595296+orimiles5@users.noreply.github.com> rei2hu +Robert Gislason diff --git a/dist/index.js b/dist/index.js index fd0acbb..886edec 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,17 +1,17 @@ "use strict";var o=function(e,i){return function(){return i||e((i={exports:{}}).exports,i),i.exports}};var p=o(function(Ve,y){ var Y=require('@stdlib/assert-is-integer/dist').isPrimitive,B=require('@stdlib/ndarray-base-ind/dist'),X=require('@stdlib/ndarray-base-ctor/dist'),G=require('@stdlib/error-tools-fmtprodmsg/dist'),b=X.prototype.iget;function H(e){if(this._ndims>0){if(!Y(e))throw new TypeError(G('0jp5O',e));return e=B(e,this._length-1,this._mode),b.call(this,e)}return b.call(this)}y.exports=H });var _=o(function(xe,E){ -var J=require('@stdlib/assert-is-integer/dist').isPrimitive,K=require('@stdlib/ndarray-base-ind/dist'),Q=require('@stdlib/ndarray-base-ctor/dist'),U=require('@stdlib/error-tools-fmtprodmsg/dist'),q=Q.prototype.iset;function W(e,i){if(this._flags.READONLY)throw new Error(format('0jp0e'));if(this._ndims>0){if(!J(e))throw new TypeError(U('0jp5O',e));e=K(e,this._length-1,this._mode),q.call(this,e,i)}else q.call(this,e);return this}E.exports=W +var J=require('@stdlib/assert-is-integer/dist').isPrimitive,K=require('@stdlib/ndarray-base-ind/dist'),Q=require('@stdlib/ndarray-base-ctor/dist'),U=require('@stdlib/error-tools-fmtprodmsg/dist'),q=Q.prototype.iset;function W(e,i){if(this._flags.READONLY)throw new Error(n('0jp0e'));if(this._ndims>0){if(!J(e))throw new TypeError(U('0jp5O',e));e=K(e,this._length-1,this._mode),q.call(this,e,i)}else q.call(this,e);return this}E.exports=W });var O=o(function(Ne,T){ var Z=require('@stdlib/assert-is-integer/dist').isPrimitive,$=require('@stdlib/ndarray-base-ind/dist'),I=require('@stdlib/error-tools-fmtprodmsg/dist');function ee(){var e,i,t,r;if(arguments.length!==this._ndims)throw new RangeError(I('0jp5M',this._ndims,arguments.length));for(e=this._offset,t=this._submode.length,r=0;r0))throw new TypeError(n('0jp5S',t));if(s=t.length,s>z)throw new RangeError(n('0jp5T',z,s));if(!de(r))throw new TypeError(n('0jp5U',r));if(s>0){if(r.length!==s)throw new RangeError(n('0jp5V',s,r.length))}else{if(r.length!==1)throw new RangeError(format('0jp0f'));if(r[0]!==0)throw new RangeError(n('0jpDt',r[0]))}if(!ge(m))throw new TypeError(n('0jp5X',m));if(!le(d))throw new TypeError(n('0jp5Y',d));if(s>0&&!ve(i.length,t,r,m)&&fe(t)>0)throw new Error(format('0jpCz'));if(u={},u.mode=_e,u.readonly=Ie,arguments.length>6&&(h=Ee(u,f),h))throw h;return this._mode=u.mode,u.submode===void 0&&(u.submode=[this._mode]),this._submode=u.submode,c=k(t,s),w=k(r,s||1),L.call(this,e,i,c,w,m,d),this._flags.READONLY=u.readonly,this}we(a,L);l(a,"name","ndarray");l(a.prototype,"get",pe);l(a.prototype,"iget",be);l(a.prototype,"set",qe);l(a.prototype,"iset",ye);S.exports=a +var l=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),j=require('@stdlib/assert-is-collection/dist'),me=require('@stdlib/assert-is-nonnegative-integer-array/dist').primitives,ge=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,de=require('@stdlib/assert-is-integer-array/dist').primitives,M=require('@stdlib/assert-is-function/dist'),le=require('@stdlib/ndarray-base-assert-is-order/dist'),he=require('@stdlib/ndarray-base-assert-is-data-type/dist'),ve=require('@stdlib/ndarray-base-assert-is-buffer-length-compatible/dist'),fe=require('@stdlib/ndarray-base-numel/dist'),L=require('@stdlib/ndarray-base-ctor/dist'),ce=require('@stdlib/ndarray-defaults/dist'),we=require('@stdlib/utils-inherit/dist'),n=require('@stdlib/error-tools-fmtprodmsg/dist'),be=p(),ye=_(),pe=O(),qe=N(),k=A(),Ee=P(),z=32767,_e=ce.get("index_mode"),Ie=!1;function a(e,i,t,r,m,d,f){var s,u,h,c,w;if(!(this instanceof a))return arguments.length<7?new a(e,i,t,r,m,d):new a(e,i,t,r,m,d,f);if(!he(e))throw new TypeError(n('0jp5P',e));if(j(i)){if(i.get&&i.set&&(!M(i.get)||!M(i.set)))throw new TypeError(n('0jp5R',i))}else throw new TypeError(n('0jp5Q',i));if(!me(t)&&(!j(t)||t.length>0))throw new TypeError(n('0jp5S',t));if(s=t.length,s>z)throw new RangeError(n('0jp5T',z,s));if(!de(r))throw new TypeError(n('0jp5U',r));if(s>0){if(r.length!==s)throw new RangeError(n('0jp5V',s,r.length))}else{if(r.length!==1)throw new RangeError(n('0jp0f'));if(r[0]!==0)throw new RangeError(n('0jpDt',r[0]))}if(!ge(m))throw new TypeError(n('0jp5X',m));if(!le(d))throw new TypeError(n('0jp5Y',d));if(s>0&&!ve(i.length,t,r,m)&&fe(t)>0)throw new Error(n('0jpCz'));if(u={},u.mode=_e,u.readonly=Ie,arguments.length>6&&(h=Ee(u,f),h))throw h;return this._mode=u.mode,u.submode===void 0&&(u.submode=[this._mode]),this._submode=u.submode,c=k(t,s),w=k(r,s||1),L.call(this,e,i,c,w,m,d),this._flags.READONLY=u.readonly,this}we(a,L);l(a,"name","ndarray");l(a.prototype,"get",pe);l(a.prototype,"iget",be);l(a.prototype,"set",qe);l(a.prototype,"iset",ye);S.exports=a });var Te=C();module.exports=Te; /** @license Apache-2.0 */ //# sourceMappingURL=index.js.map diff --git a/package.json b/package.json index 9d3fbe5..68929fa 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ "@stdlib/assert-is-nonnegative-integer": "^0.1.0", "@stdlib/assert-is-nonnegative-integer-array": "^0.1.0", "@stdlib/assert-is-plain-object": "^0.1.1", - "@stdlib/complex-float32": "^0.1.0", - "@stdlib/complex-float64": "^0.1.0", + "@stdlib/complex-float32": "^0.1.1", + "@stdlib/complex-float64": "^0.1.1", "@stdlib/ndarray-base-assert-is-buffer-length-compatible": "^0.1.0", "@stdlib/ndarray-base-assert-is-data-type": "^0.1.0", "@stdlib/ndarray-base-assert-is-index-mode": "^0.1.1", @@ -62,7 +62,7 @@ "@stdlib/ndarray-base-iteration-order": "^0.1.1", "@stdlib/ndarray-base-minmax-view-buffer-index": "^0.1.1", "@stdlib/ndarray-base-numel": "^0.1.1", - "@stdlib/ndarray-base-strides2order": "^0.1.0", + "@stdlib/ndarray-base-strides2order": "^0.1.1", "@stdlib/ndarray-defaults": "^0.1.1", "@stdlib/ndarray-dtypes": "^0.1.0", "@stdlib/ndarray-index-modes": "^0.1.1", @@ -76,14 +76,14 @@ "devDependencies": { "@stdlib/array-complex128": "^0.1.0", "@stdlib/array-complex64": "^0.1.0", - "@stdlib/array-float32": "^0.1.0", - "@stdlib/array-float64": "^0.1.0", + "@stdlib/array-float32": "^0.1.1", + "@stdlib/array-float64": "^0.1.1", "@stdlib/assert-has-property": "^0.1.1", "@stdlib/assert-instance-of": "^0.1.1", "@stdlib/assert-is-positive-integer": "^0.1.0", "@stdlib/bench": "^0.1.0", - "@stdlib/complex-imagf": "^0.1.0", - "@stdlib/complex-realf": "^0.1.0", + "@stdlib/complex-imagf": "^0.1.1", + "@stdlib/complex-realf": "^0.1.1", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1", "tap-min": "git+https://github.com/Planeshifter/tap-min.git" diff --git a/test/dist/test.js b/test/dist/test.js index 369c746..a8a9c60 100644 --- a/test/dist/test.js +++ b/test/dist/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2018 The Stdlib Authors. +* Copyright (c) 2023 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. @@ -21,191 +21,13 @@ // MODULES // var tape = require( 'tape' ); -var instanceOf = require( '@stdlib/assert-instance-of' ); -var Complex64Array = require( '@stdlib/array-complex64' ); -var ndarray = require( './../../dist' ); +var main = require( './../../dist' ); // TESTS // -tape( 'main export is a function', function test( t ) { +tape( 'main export is defined', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof ndarray, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function is an ndarray constructor', function test( t ) { - var strides; - var buffer; - var offset; - var dtype; - var order; - var shape; - var arr; - - dtype = 'generic'; - buffer = [ 1.0, 2.0, 3.0, 4.0 ]; - shape = [ 2, 2 ]; - order = 'row-major'; - strides = [ 2, 1 ]; - offset = 0; - - arr = new ndarray( dtype, buffer, shape, strides, offset, order ); - - t.strictEqual( instanceOf( arr, ndarray ), true, 'returns an instance' ); - t.end(); -}); - -tape( 'the function is an ndarray constructor (complex dtype)', function test( t ) { - var strides; - var buffer; - var offset; - var dtype; - var order; - var shape; - var arr; - - dtype = 'complex64'; - buffer = new Complex64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] ); - shape = [ 2, 2 ]; - order = 'row-major'; - strides = [ 2, 1 ]; - offset = 0; - - arr = new ndarray( dtype, buffer, shape, strides, offset, order ); - - t.strictEqual( instanceOf( arr, ndarray ), true, 'returns an instance' ); - t.end(); -}); - -tape( 'the function is an ndarray constructor (0d)', function test( t ) { - var strides; - var buffer; - var offset; - var dtype; - var order; - var shape; - var arr; - - dtype = 'generic'; - buffer = [ 1.0 ]; - shape = []; - order = 'row-major'; - strides = [ 0 ]; - offset = 0; - - arr = new ndarray( dtype, buffer, shape, strides, offset, order ); - - t.strictEqual( instanceOf( arr, ndarray ), true, 'returns an instance' ); - t.end(); -}); - -tape( 'the function is an ndarray constructor (0d; complex dtype)', function test( t ) { - var strides; - var buffer; - var offset; - var dtype; - var order; - var shape; - var arr; - - dtype = 'complex64'; - buffer = new Complex64Array( [ 1.0, 1.0 ] ); - shape = []; - order = 'row-major'; - strides = [ 0 ]; - offset = 0; - - arr = new ndarray( dtype, buffer, shape, strides, offset, order ); - - t.strictEqual( instanceOf( arr, ndarray ), true, 'returns an instance' ); - t.end(); -}); - -tape( 'the function is an ndarray constructor (options)', function test( t ) { - var strides; - var buffer; - var offset; - var dtype; - var order; - var shape; - var arr; - - dtype = 'generic'; - buffer = [ 1.0, 2.0, 3.0, 4.0 ]; - shape = [ 2, 2 ]; - order = 'row-major'; - strides = [ 2, 1 ]; - offset = 0; - - arr = new ndarray( dtype, buffer, shape, strides, offset, order, {} ); - - t.strictEqual( instanceOf( arr, ndarray ), true, 'returns an instance' ); - t.end(); -}); - -tape( 'the function is an ndarray constructor (0d; options)', function test( t ) { - var strides; - var buffer; - var offset; - var dtype; - var order; - var shape; - var arr; - - dtype = 'generic'; - buffer = [ 1.0 ]; - shape = []; - order = 'row-major'; - strides = [ 0 ]; - offset = 0; - - arr = new ndarray( dtype, buffer, shape, strides, offset, order, {} ); - - t.strictEqual( instanceOf( arr, ndarray ), true, 'returns an instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword', function test( t ) { - var strides; - var buffer; - var offset; - var dtype; - var order; - var shape; - var arr; - - dtype = 'generic'; - buffer = [ 1.0, 2.0, 3.0, 4.0 ]; - shape = [ 2, 2 ]; - order = 'row-major'; - strides = [ 2, 1 ]; - offset = 0; - - arr = ndarray( dtype, buffer, shape, strides, offset, order ); - - t.strictEqual( instanceOf( arr, ndarray ), true, 'returns an instance' ); - t.end(); -}); - -tape( 'the constructor does not require the `new` keyword (options)', function test( t ) { - var strides; - var buffer; - var offset; - var dtype; - var order; - var shape; - var arr; - - dtype = 'generic'; - buffer = [ 1.0, 2.0, 3.0, 4.0 ]; - shape = [ 2, 2 ]; - order = 'row-major'; - strides = [ 2, 1 ]; - offset = 0; - - arr = ndarray( dtype, buffer, shape, strides, offset, order, {} ); - - t.strictEqual( instanceOf( arr, ndarray ), true, 'returns an instance' ); + t.strictEqual( main !== void 0, true, 'main export is defined' ); t.end(); });