diff --git a/.github/.keepalive b/.github/.keepalive new file mode 100644 index 0000000..b8af1ac --- /dev/null +++ b/.github/.keepalive @@ -0,0 +1 @@ +2023-11-01T06:16:54.950Z 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 531e55f..6aa004f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3,7 +3,7 @@ var z=require('@stdlib/assert-is-plain-object/dist'),a=require('@stdlib/assert-h });var j=d(function(Ee,_){ var X=require("debug"),Y=X("random:streams:hypergeometric");_.exports=Y });var f=d(function(Me,O){ -var S=require("readable-stream").Readable,c=require('@stdlib/assert-is-nonnegative-integer/dist'),Z=require('@stdlib/assert-is-error/dist'),$=require('@stdlib/object-assign/dist'),K=require('@stdlib/utils-inherit/dist'),E=require('@stdlib/utils-define-nonenumerable-property/dist'),o=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),v=require('@stdlib/utils-define-read-only-accessor/dist'),ee=require('@stdlib/utils-define-read-write-accessor/dist'),re=require('@stdlib/random-base-hypergeometric/dist').factory,M=require('@stdlib/buffer-from-string/dist'),te=require('@stdlib/utils-next-tick/dist'),l=require('@stdlib/error-tools-fmtprodmsg/dist'),ie=p(),ne=w(),h=j();function ae(){return this._prng.seed}function se(){return this._prng.seedLength}function ue(){return this._prng.stateLength}function oe(){return this._prng.byteLength}function ge(){return this._prng.state}function de(e){this._prng.state=e}function he(){var e,r;if(!this._destroyed)for(e=!0;e;){if(this._i+=1,this._i>this._iter)return h("Finished generating pseudorandom numbers."),this.push(null);r=this._prng(),h("Generated a new pseudorandom number. Value: %d. Iter: %d.",r,this._i),this._objectMode===!1&&(r=r.toString(),this._i===1?r=M(r):r=M(this._sep+r)),e=this.push(r),this._i%this._siter===0&&this.emit("state",this.state)}}function ve(e){var r;if(this._destroyed)return h("Attempted to destroy an already destroyed stream."),this;return r=this,this._destroyed=!0,te(i),this;function i(){e&&(h("Stream was destroyed due to an error. Error: %s.",Z(e)?e.message:JSON.stringify(e)),r.emit("error",e)),h("Closing the stream..."),r.emit("close")}}function n(e,r,i,s){var t,u;if(!(this instanceof n))return arguments.length>3?new n(e,r,i,s):new n(e,r,i);if(!c(e))throw new TypeError(l('0rH2d',e));if(!c(r))throw new TypeError(l('0rH3X',r));if(!c(i))throw new TypeError(l('0rH2m',i));if(i>e)throw new RangeError(format('0rH0s'));if(r>e)throw new RangeError(format('0rH0t'));if(t=$({},ie),arguments.length>3&&(u=ne(t,s),u))throw u;return h("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),S.call(this,t),E(this,"_destroyed",!1),o(this,"_objectMode",t.objectMode),o(this,"_sep",t.sep),o(this,"_iter",t.iter),o(this,"_siter",t.siter),E(this,"_i",0),o(this,"_prng",re(e,r,i,t)),o(this,"PRNG",this._prng.PRNG),this}K(n,S);v(n.prototype,"seed",ae);v(n.prototype,"seedLength",se);ee(n.prototype,"state",ge,de);v(n.prototype,"stateLength",ue);v(n.prototype,"byteLength",oe);o(n.prototype,"_read",he);o(n.prototype,"destroy",ve);O.exports=n +var S=require("readable-stream").Readable,c=require('@stdlib/assert-is-nonnegative-integer/dist'),Z=require('@stdlib/assert-is-error/dist'),$=require('@stdlib/object-assign/dist'),K=require('@stdlib/utils-inherit/dist'),E=require('@stdlib/utils-define-nonenumerable-property/dist'),o=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),v=require('@stdlib/utils-define-read-only-accessor/dist'),ee=require('@stdlib/utils-define-read-write-accessor/dist'),re=require('@stdlib/random-base-hypergeometric/dist').factory,M=require('@stdlib/buffer-from-string/dist'),te=require('@stdlib/utils-next-tick/dist'),l=require('@stdlib/error-tools-fmtprodmsg/dist'),ie=p(),ne=w(),h=j();function ae(){return this._prng.seed}function se(){return this._prng.seedLength}function ue(){return this._prng.stateLength}function oe(){return this._prng.byteLength}function ge(){return this._prng.state}function de(e){this._prng.state=e}function he(){var e,r;if(!this._destroyed)for(e=!0;e;){if(this._i+=1,this._i>this._iter)return h("Finished generating pseudorandom numbers."),this.push(null);r=this._prng(),h("Generated a new pseudorandom number. Value: %d. Iter: %d.",r,this._i),this._objectMode===!1&&(r=r.toString(),this._i===1?r=M(r):r=M(this._sep+r)),e=this.push(r),this._i%this._siter===0&&this.emit("state",this.state)}}function ve(e){var r;if(this._destroyed)return h("Attempted to destroy an already destroyed stream."),this;return r=this,this._destroyed=!0,te(i),this;function i(){e&&(h("Stream was destroyed due to an error. Error: %s.",Z(e)?e.message:JSON.stringify(e)),r.emit("error",e)),h("Closing the stream..."),r.emit("close")}}function n(e,r,i,s){var t,u;if(!(this instanceof n))return arguments.length>3?new n(e,r,i,s):new n(e,r,i);if(!c(e))throw new TypeError(l('0rH2d',e));if(!c(r))throw new TypeError(l('0rH3X',r));if(!c(i))throw new TypeError(l('0rH2m',i));if(i>e)throw new RangeError(V('0rH0s'));if(r>e)throw new RangeError(V('0rH0t'));if(t=$({},ie),arguments.length>3&&(u=ne(t,s),u))throw u;return h("Creating a readable stream configured with the following options: %s.",JSON.stringify(t)),S.call(this,t),E(this,"_destroyed",!1),o(this,"_objectMode",t.objectMode),o(this,"_sep",t.sep),o(this,"_iter",t.iter),o(this,"_siter",t.siter),E(this,"_i",0),o(this,"_prng",re(e,r,i,t)),o(this,"PRNG",this._prng.PRNG),this}K(n,S);v(n.prototype,"seed",ae);v(n.prototype,"seedLength",se);ee(n.prototype,"state",ge,de);v(n.prototype,"stateLength",ue);v(n.prototype,"byteLength",oe);o(n.prototype,"_read",he);o(n.prototype,"destroy",ve);O.exports=n });var R=d(function(Se,T){ var fe=require('@stdlib/assert-is-plain-object/dist'),me=require('@stdlib/object-assign/dist'),ce=require('@stdlib/error-tools-fmtprodmsg/dist'),le=f();function be(e,r,i,s){var t;if(arguments.length>3){if(t=s,!fe(t))throw new TypeError(ce('0rH2V',t));t=me({},s)}else t={};return t.objectMode=!0,new le(e,r,i,t)}T.exports=be });var W=d(function(Oe,x){ diff --git a/package.json b/package.json index 0506b9e..d63504b 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,8 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/array-uint32": "^0.1.0", - "@stdlib/array-uint8": "^0.1.0", + "@stdlib/array-uint32": "^0.1.1", + "@stdlib/array-uint8": "^0.1.1", "@stdlib/assert-has-own-property": "^0.1.1", "@stdlib/assert-is-boolean": "^0.1.1", "@stdlib/assert-is-error": "^0.1.1", diff --git a/test/dist/test.js b/test/dist/test.js index ed4e168..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,23 +21,13 @@ // MODULES // var tape = require( 'tape' ); -var randomStream = 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 randomStream, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'attached to main export is a method to create a stream in object mode', function test( t ) { - t.equal( typeof randomStream.objectMode, 'function', 'has method' ); - t.end(); -}); - -tape( 'attached to main export is a method to create a stream factory', function test( t ) { - t.equal( typeof randomStream.factory, 'function', 'has method' ); + t.strictEqual( main !== void 0, true, 'main export is defined' ); t.end(); });