From 3c485e046dc080940eccee7a0ae86c69245d394a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 19 Oct 2024 09:09:47 +0000 Subject: [PATCH] Auto-generated commit --- .gitattributes | 29 +++- .github/workflows/productionize.yml | 23 ++- .github/workflows/publish.yml | 11 +- .github/workflows/test.yml | 1 - .github/workflows/test_bundles.yml | 3 - .github/workflows/test_coverage.yml | 1 - .github/workflows/test_install.yml | 1 - .gitignore | 2 + .npmrc | 4 +- CHANGELOG.md | 228 +++++++++++++++++++++++++++- CONTRIBUTORS | 26 +++- dist/index.js | 14 +- dist/index.js.map | 6 +- lib/factory.js | 3 +- package.json | 36 ++--- 15 files changed, 326 insertions(+), 62 deletions(-) diff --git a/.gitattributes b/.gitattributes index 10a16e6..1c88e69 100644 --- a/.gitattributes +++ b/.gitattributes @@ -40,10 +40,27 @@ *.mov binary # Override what is considered "vendored" by GitHub's linguist: -/deps/** linguist-vendored=false -/lib/node_modules/** linguist-vendored=false linguist-generated=false -test/fixtures/** linguist-vendored=false -tools/** linguist-vendored=false +/lib/node_modules/** -linguist-vendored -linguist-generated -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false +# Configure directories which should *not* be included in GitHub language statistics: +/deps/** linguist-vendored +/dist/** linguist-generated +/workshops/** linguist-vendored + +benchmark/** linguist-vendored +docs/* linguist-documentation +etc/** linguist-vendored +examples/** linguist-documentation +scripts/** linguist-vendored +test/** linguist-vendored +tools/** linguist-vendored + +# Configure files which should *not* be included in GitHub language statistics: +Makefile linguist-vendored +*.mk linguist-vendored +*.jl linguist-vendored +*.py linguist-vendored +*.R linguist-vendored + +# Configure files which should be included in GitHub language statistics: +docs/types/*.d.ts -linguist-documentation diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index ec90164..f4575e9 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -94,8 +94,8 @@ jobs: node -e "var pkg = require( './package.json' ); pkg.dependencies[ '@stdlib/error-tools-fmtprodmsg' ] = '^$PKG_VERSION'; require( 'fs' ).writeFileSync( 'package.json', JSON.stringify( pkg, null, 2 ) );" fi - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -191,8 +191,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -344,7 +344,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -367,8 +366,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -518,7 +517,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -541,8 +539,8 @@ jobs: # Pin action to full length commit SHA uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -698,7 +696,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -738,8 +735,8 @@ jobs: echo "bump=true" >> $GITHUB_OUTPUT fi - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' if: steps.check-if-bump.outputs.bump run: | git config --local user.email "noreply@stdlib.io" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3eec50e..2888b88 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -72,8 +72,8 @@ jobs: node-version: 20 timeout-minutes: 5 - # Configure git: - - name: 'Configure git' + # Configure Git: + - name: 'Configure Git' run: | git config --local user.email "noreply@stdlib.io" git config --local user.name "stdlib-bot" @@ -94,6 +94,10 @@ jobs: # Replace branch in README.md link definitions for badges with the new version: find . -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/branch([=:])[^ ]+/branch\1v${NEW_VERSION}/g" + # Rewrite CHANGELOG.md to replace "Unreleased" with the new version: + sed -Ei "s/Unreleased/${NEW_VERSION}/g" CHANGELOG.md + sed -Ei "s/unreleased/v${NEW_VERSION}/g" CHANGELOG.md + # Create a new commit and tag: git add package.json README.md git commit -m "Release v${NEW_VERSION}" @@ -202,7 +206,7 @@ jobs: # Publish package to npm: - name: 'Publish package to npm' # Pin action to full length commit SHA - uses: JS-DevTools/npm-publish@4b07b26a2f6e0a51846e1870223e545bae91c552 # v3.0.1 + uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # v3.1.1 with: token: ${{ secrets.NPM_TOKEN }} access: public @@ -218,7 +222,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2906621..7a86a9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,6 +95,5 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/test_bundles.yml b/.github/workflows/test_bundles.yml index 6d77abd..5b5879a 100644 --- a/.github/workflows/test_bundles.yml +++ b/.github/workflows/test_bundles.yml @@ -94,7 +94,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -139,7 +138,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() @@ -184,6 +182,5 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index f4eda1e..2bcf0cd 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -119,7 +119,6 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 8fcd9c2..e6677dd 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -81,6 +81,5 @@ jobs: uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 with: status: ${{ job.status }} - steps: ${{ toJson(steps) }} channel: '#npm-ci' if: failure() diff --git a/.gitignore b/.gitignore index 49b206b..4fdc97c 100644 --- a/.gitignore +++ b/.gitignore @@ -101,6 +101,8 @@ docs/**/node_modules/ pids *.pid *.seed +yarn.lock +package-lock.json # Typescript # ############## diff --git a/.npmrc b/.npmrc index 5af9067..58dbd10 100644 --- a/.npmrc +++ b/.npmrc @@ -27,5 +27,5 @@ shrinkwrap = false # Disable automatically "saving" dependencies on install: save = false -# Generate provenance metadata: -provenance = true +# Do not generate provenance metadata: +provenance = false diff --git a/CHANGELOG.md b/CHANGELOG.md index b0c557c..99490c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,4 +2,230 @@ > Package changelog. -See [GitHub Releases](https://github.com/stdlib-js/random-shuffle/releases) for the changelog. \ No newline at end of file +
+ +## Unreleased (2024-10-19) + +
+ +### Bug Fixes + +- [`93560b9`](https://github.com/stdlib-js/stdlib/commit/93560b988c750b47e68cf5a789cc5e9d74b8e2d8) - ensure correct seed validation [(#3007)](https://github.com/stdlib-js/stdlib/pull/3007) + +
+ + + +
+ +### Closed Issues + +This release closes the following issue: + +[#2952](https://github.com/stdlib-js/stdlib/issues/2952) + +
+ + + +
+ +### Commits + +
+ +- [`93560b9`](https://github.com/stdlib-js/stdlib/commit/93560b988c750b47e68cf5a789cc5e9d74b8e2d8) - **fix:** ensure correct seed validation [(#3007)](https://github.com/stdlib-js/stdlib/pull/3007) _(by RISHAV)_ + +
+ +
+ + + +
+ +### Contributors + +A total of 1 person contributed to this release. Thank you to this contributor: + +- RISHAV + +
+ + + +
+ + + +
+ +## 0.2.1 (2024-02-25) + +No changes reported for this release. + +
+ + + +
+ +## 0.2.0 (2024-02-15) + +
+ +### Commits + +
+ +- [`453dd85`](https://github.com/stdlib-js/stdlib/commit/453dd85b5dd186d2b4d458256fe84906e1503fe2) - **build:** remove tslint directives _(by Philipp Burckhardt)_ + +
+ +
+ + + +
+ +### Contributors + +A total of 1 person contributed to this release. Thank you to this contributor: + +- Philipp Burckhardt + +
+ + + +
+ + + +
+ +## 0.1.0 (2023-09-24) + +
+ +### Features + +- [`efe050d`](https://github.com/stdlib-js/stdlib/commit/efe050dbf3d17bd6929da255fa079c0324afc213) - update minimum TypeScript version + +
+ + + +
+ +### BREAKING CHANGES + +- [`efe050d`](https://github.com/stdlib-js/stdlib/commit/efe050dbf3d17bd6929da255fa079c0324afc213): update minimum TypeScript version to 4.1 + + - To migrate, users should upgrade their TypeScript version to at least version 4.1. + +
+ + + +
+ +### Commits + +
+ +- [`efe050d`](https://github.com/stdlib-js/stdlib/commit/efe050dbf3d17bd6929da255fa079c0324afc213) - **feat:** update minimum TypeScript version _(by Philipp Burckhardt)_ +- [`55866ea`](https://github.com/stdlib-js/stdlib/commit/55866ea8ef1282528b839fd9ce9c43c6a80056f8) - **test:** use strictEqual checks _(by Philipp Burckhardt)_ + +
+ +
+ + + +
+ +### Contributors + +A total of 1 person contributed to this release. Thank you to this contributor: + +- Philipp Burckhardt + +
+ + + +
+ + + +
+ +## 0.0.7 (2022-02-16) + +No changes reported for this release. + +
+ + + +
+ +## 0.0.6 (2021-08-23) + +No changes reported for this release. + +
+ + + +
+ +## 0.0.5 (2021-07-10) + +No changes reported for this release. + +
+ + + +
+ +## 0.0.4 (2021-07-07) + +No changes reported for this release. + +
+ + + +
+ +## 0.0.3 (2021-06-27) + +No changes reported for this release. + +
+ + + +
+ +## 0.0.2 (2021-06-16) + +No changes reported for this release. + +
+ + + +
+ +## 0.0.1 (2021-06-15) + +No changes reported for this release. + +
+ + + diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4500383..9b6e69d 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2,9 +2,11 @@ # # Contributors listed in alphabetical order. +Aayush Khanna Adarsh Palaskar Aditya Sapra AgPriyanshu18 <113460573+AgPriyanshu18@users.noreply.github.com> +Aleksandr <112382387+alextes90@users.noreply.github.com> Ali Salesi Aman Bhansali Amit Jimiwal @@ -18,24 +20,32 @@ Chinmay Joshi <86140365+JawHawk@users.noreply.github.com> Christopher Dambamuromo Dan Rose Daniel Killenberger +Daniel Yu <40680511+Daniel777y@users.noreply.github.com> +Debashis Maharana Dominik Moritz Dorrin Sotoudeh EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com> Frank Kovacs Golden Kumar <103646877+AuenKr@users.noreply.github.com> Gunj Joshi +Gururaj Gurram <143020143+gururaj1512@users.noreply.github.com> +HarshaNP <96897754+GittyHarsha@users.noreply.github.com> Harshita Kalani +Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.com> Jaimin Godhani <112328542+Jai0401@users.noreply.github.com> James Gelok Jaysukh Makvana +Jenish Thapa <141203631+jenish-thapa@users.noreply.github.com> Jithin KS Joel Mathew Koshy Joey Reed Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com> Joris Labie Justin Dennison +Kaif Mohd Karthik Prakash <116057817+skoriop@users.noreply.github.com> Khaldon +Kohantika Nath <145763549+kohantikanath@users.noreply.github.com> Krishnendu Das <86651039+itskdhere@users.noreply.github.com> Lovelin <100030865+lovelindhoni@users.noreply.github.com> Manik Sharma @@ -43,11 +53,13 @@ Marcus Fantham Matt Cochrane Mihir Pandit <129577900+MSP20086@users.noreply.github.com> Milan Raj +Mohammad Kaif <98884589+Kaif987@users.noreply.github.com> Momtchil Momtchev Muhammad Haris Naresh Jagadeesan NightKnight Nithin Katta <88046362+nithinkatta@users.noreply.github.com> +Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com> Ognjen Jevremović Oneday12323 <107678750+Oneday12323@users.noreply.github.com> Philipp Burckhardt @@ -60,27 +72,39 @@ Pushpendra Chandravanshi Raunak Kumar Gupta Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com> Ricky Reusser +Ridam Garg <67867319+RidamGarg@users.noreply.github.com> Robert Gislason Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com> Rutam <138517416+performant23@users.noreply.github.com> Ryan Seal Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com> +SarthakPaandey <145528240+SarthakPaandey@users.noreply.github.com> Seyyed Parsa Neshaei Shashank Shekhar Singh Shivam <11shivam00@gmail.com> Shraddheya Shendre +Shubh Mehta <93862397+Shubh942@users.noreply.github.com> Shubham Mishra -Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com> +Sivam Das <100067002+Sivam2313@users.noreply.github.com> +Snehil Shah +Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com> Spandan Barve Stephannie Jiménez Gacha Suraj kumar <125961509+kumarsuraj212003@users.noreply.github.com> Tirtadwipa Manunggal Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com> +Tufailahmed Bargir <142114244+Tufailahmed-Bargir@users.noreply.github.com> Utkarsh Utkarsh Raj +UtkershBasnet <119008923+UtkershBasnet@users.noreply.github.com> +Vaibhav Patel <98279986+noobCoderVP@users.noreply.github.com> Varad Gupta +Xiaochuan Ye Yernar Yergaziyev naveen nishant-s7 <97207366+nishant-s7@users.noreply.github.com> +olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com> orimiles5 <97595296+orimiles5@users.noreply.github.com> +rainn <88160429+AmCodesLame@users.noreply.github.com> rei2hu +yaswanth <116426380+yaswanthkosuru@users.noreply.github.com> diff --git a/dist/index.js b/dist/index.js index c620859..86693a2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,9 +1,9 @@ -"use strict";var v=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var w=v(function(W,A){A.exports={copy:"shallow"}});var b=v(function(X,O){ -var C=require('@stdlib/assert-has-own-property/dist'),L=require('@stdlib/assert-is-string/dist').isPrimitive,V=require('@stdlib/assert-is-plain-object/dist'),z=require('@stdlib/utils-index-of/dist'),d=require('@stdlib/error-tools-fmtprodmsg/dist'),g=["deep","shallow","none"];function F(e,r){if(!V(r))return new TypeError(d('0qf2V',r));if(C(r,"copy")){if(e.copy=r.copy,!L(e.copy))return new TypeError(d('0qf2W',"copy",e.copy));if(z(g,e.copy)===-1)return new TypeError(d('0qf4S',"copy",g.join('", "'),e.copy));}return null}O.exports=F -});var q=v(function(Z,E){ -var P=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),G=require('@stdlib/assert-is-array-like/dist'),I=require('@stdlib/assert-is-typed-array-like/dist'),Y=require('@stdlib/assert-is-string/dist').isPrimitive,T=require('@stdlib/utils-copy/dist'),_=require('@stdlib/math-base-special-floor/dist'),j=require('@stdlib/random-base-mt19937/dist').factory,B=require('@stdlib/error-tools-fmtprodmsg/dist'),D=w(),x=b();function H(e){var r,a,l;if(r=T(D),arguments.length&&(l=x(r,e),l))throw l;return e&&e.seed?a=j({seed:e.seed}):a=j(),P(f,"seed",a.seed),P(f,"PRNG",a),a=a.normalized,f;function f(i,S){var p,u,s,n,y,t,m,h,o,c;if(!(G(i)||I(i)))throw new TypeError(B('0qf38',i));if(arguments.length>1&&(n={},y=x(n,S),y))throw y;for(s=n&&n.copy?n.copy:r.copy,p=Y(i),p&&(i=i.split(""),s="none"),u=0,s==="shallow"?u+=1:s==="deep"&&(u+=2),h=i.length,t=T(i,u),o=h-1;o>0;o--)c=_(a()*(o+1)),m=t[o],t[o]=t[c],t[c]=m;return p&&(t=i.join("")),t}}E.exports=H -});var N=v(function($,k){ -var J=q(),K=J();k.exports=K -});var M=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),R=N(),Q=q();M(R,"factory",Q);module.exports=R; +"use strict";var v=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var w=v(function(X,A){A.exports={copy:"shallow"}});var P=v(function(Z,g){ +var C=require('@stdlib/assert-has-own-property/dist'),L=require('@stdlib/assert-is-string/dist').isPrimitive,V=require('@stdlib/assert-is-plain-object/dist'),z=require('@stdlib/utils-index-of/dist'),d=require('@stdlib/error-tools-fmtprodmsg/dist'),O=["deep","shallow","none"];function F(e,r){if(!V(r))return new TypeError(d('0qf2V',r));if(C(r,"copy")){if(e.copy=r.copy,!L(e.copy))return new TypeError(d('0qf2W',"copy",e.copy));if(z(O,e.copy)===-1)return new TypeError(d('0qf4S',"copy",O.join('", "'),e.copy));}return null}g.exports=F +});var q=v(function($,E){ +var b=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),G=require('@stdlib/assert-is-array-like/dist'),I=require('@stdlib/assert-is-typed-array-like/dist'),Y=require('@stdlib/assert-is-string/dist').isPrimitive,T=require('@stdlib/utils-copy/dist'),_=require('@stdlib/math-base-special-floor/dist'),j=require('@stdlib/random-base-mt19937/dist').factory,B=require('@stdlib/error-tools-fmtprodmsg/dist'),D=require('@stdlib/assert-has-own-property/dist'),H=w(),x=P();function J(e){var r,a,l;if(r=T(H),arguments.length&&(l=x(r,e),l))throw l;return e&&D(e,"seed")?a=j({seed:e.seed}):a=j(),b(f,"seed",a.seed),b(f,"PRNG",a),a=a.normalized,f;function f(i,S){var p,u,s,n,y,t,m,h,o,c;if(!(G(i)||I(i)))throw new TypeError(B('0qf38',i));if(arguments.length>1&&(n={},y=x(n,S),y))throw y;for(s=n&&n.copy?n.copy:r.copy,p=Y(i),p&&(i=i.split(""),s="none"),u=0,s==="shallow"?u+=1:s==="deep"&&(u+=2),h=i.length,t=T(i,u),o=h-1;o>0;o--)c=_(a()*(o+1)),m=t[o],t[o]=t[c],t[c]=m;return p&&(t=i.join("")),t}}E.exports=J +});var N=v(function(rr,k){ +var K=q(),M=K();k.exports=M +});var Q=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),R=N(),U=q();Q(R,"factory",U);module.exports=R; /** @license Apache-2.0 */ //# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map index 07b07b6..4488eb4 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../lib/defaults.json", "../lib/validate.js", "../lib/factory.js", "../lib/main.js", "../lib/index.js"], - "sourcesContent": ["{\n\t\"copy\": \"shallow\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar indexOf = require( '@stdlib/utils-index-of' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar COPY_OPTIONS = [ 'deep', 'shallow', 'none' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {string} [options.copy] - string denoting whether to return a copy (`deep`, `shallow` or `none`)\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': 'shallow'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isString( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( indexOf( COPY_OPTIONS, opts.copy ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'copy', COPY_OPTIONS.join( '\", \"' ), opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert-is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar deepCopy = require( '@stdlib/utils-copy' );\nvar floor = require( '@stdlib/math-base-special-floor' );\nvar randu = require( '@stdlib/random-base-mt19937' ).factory;\nvar format = require( '@stdlib/string-format' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to create a random permutation of elements from an array-like object.\n*\n* @param {Options} [config] - function options\n* @param {PositiveInteger} [config.seed] - integer-valued seed\n* @param {string} [config.copy=\"shallow\"] - default copy option (`deep`, `shallow` or `none`)\n* @throws {TypeError} options argument must be an object\n* @returns {Function} shuffle function\n*\n* @example\n* var shuffle = factory({\n* 'seed': 249\n* });\n* var data = [ 3, 8, 4, 8 ];\n* var out = shuffle( data );\n* // e.g., returns [ 4, 3, 8, 8 ]\n*/\nfunction factory( config ) {\n\tvar conf;\n\tvar rand;\n\tvar err;\n\n\tconf = deepCopy( defaults );\n\tif ( arguments.length ) {\n\t\terr = validate( conf, config );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( config && config.seed ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tsetReadOnly( shuffle, 'seed', rand.seed );\n\tsetReadOnly( shuffle, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn shuffle;\n\n\t/**\n\t* Returns a random permutation of elements in `arr`.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} arr - array-like object to shuffle\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.copy] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} the shuffled array-like object\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data );\n\t* // e.g., returns [ 3, 1, 2 ]\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data, {\n\t* 'copy': 'none'\n\t* });\n\t* var bool = ( data === out );\n\t* // returns true\n\t*/\n\tfunction shuffle( arr, options ) {\n\t\tvar strflg;\n\t\tvar level;\n\t\tvar copy;\n\t\tvar opts;\n\t\tvar err;\n\t\tvar out;\n\t\tvar tmp;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\n\t\tif ( !( isArrayLike( arr ) || isTypedArrayLike( arr ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', arr ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = {};\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tcopy = ( opts && opts.copy ) ? opts.copy : conf.copy;\n\n\t\tstrflg = isString( arr );\n\t\tif ( strflg ) {\n\t\t\tarr = arr.split( '' );\n\t\t\tcopy = 'none';\n\t\t}\n\n\t\tlevel = 0;\n\t\tif ( copy === 'shallow' ) {\n\t\t\tlevel += 1;\n\t\t} else if ( copy === 'deep' ) {\n\t\t\tlevel += 2;\n\t\t}\n\t\tN = arr.length;\n\t\tout = deepCopy( arr, level );\n\n\t\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\t\tfor ( i = N - 1; i > 0; i-- ) {\n\t\t\t// Generate an integer index on the interval [0,i]:\n\t\t\tj = floor( rand() * (i+1.0) );\n\n\t\t\t// Swap elements:\n\t\t\ttmp = out[ i ];\n\t\t\tout[ i ] = out[ j ];\n\t\t\tout[ j ] = tmp;\n\t\t}\n\n\t\tif ( strflg ) {\n\t\t\tout = arr.join( '' );\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random permutation of elements in `arr`.\n*\n* @name shuffle\n* @type {Function}\n* @param {ArrayLike} arr - array-like object to shuffle\n* @param {Options} [options] - function options\n* @param {string} [options.copy=\"shallow\"] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n* @throws {TypeError} options must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} the shuffled array-like object\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data, {\n* 'copy': 'none'\n* });\n* var bool = ( data === out );\n* // returns true\n*/\nvar shuffle = factory();\n\n\n// EXPORTS //\n\nmodule.exports = shuffle;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a random permutation of elements from an array-like object.\n*\n* @module @stdlib/random-shuffle\n*\n* @example\n* var shuffle = require( '@stdlib/random-shuffle' );\n*\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* out = shuffle( data, {\n* 'copy': 'none'\n* });\n*\n* var bool = ( data === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "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", - "names": ["require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "hasOwnProp", "isString", "isObject", "indexOf", "format", "COPY_OPTIONS", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "deepCopy", "floor", "randu", "format", "defaults", "validate", "factory", "config", "conf", "rand", "err", "shuffle", "arr", "options", "strflg", "level", "copy", "opts", "out", "tmp", "N", "i", "j", "require_main", "__commonJSMin", "exports", "module", "factory", "shuffle", "setReadOnly", "main", "factory"] + "sourcesContent": ["{\n\t\"copy\": \"shallow\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar indexOf = require( '@stdlib/utils-index-of' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar COPY_OPTIONS = [ 'deep', 'shallow', 'none' ];\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination for validated options\n* @param {Options} options - function options\n* @param {string} [options.copy] - string denoting whether to return a copy (`deep`, `shallow` or `none`)\n* @returns {(null|Error)} null or an error\n*\n* @example\n* var opts = {};\n* var options = {\n* 'copy': 'shallow'\n* };\n* var err = validate( opts, options );\n* if ( err ) {\n* throw err;\n* }\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'copy' ) ) {\n\t\topts.copy = options.copy;\n\t\tif ( !isString( opts.copy ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'copy', opts.copy ) );\n\t\t}\n\t\tif ( indexOf( COPY_OPTIONS, opts.copy ) === -1 ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be one of the following: \"%s\". Option: `%s`.', 'copy', COPY_OPTIONS.join( '\", \"' ), opts.copy ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar isArrayLike = require( '@stdlib/assert-is-array-like' );\nvar isTypedArrayLike = require( '@stdlib/assert-is-typed-array-like' );\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar deepCopy = require( '@stdlib/utils-copy' );\nvar floor = require( '@stdlib/math-base-special-floor' );\nvar randu = require( '@stdlib/random-base-mt19937' ).factory;\nvar format = require( '@stdlib/string-format' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar defaults = require( './defaults.json' );\nvar validate = require( './validate.js' );\n\n\n// MAIN //\n\n/**\n* Returns a function to create a random permutation of elements from an array-like object.\n*\n* @param {Options} [config] - function options\n* @param {PositiveInteger} [config.seed] - integer-valued seed\n* @param {string} [config.copy=\"shallow\"] - default copy option (`deep`, `shallow` or `none`)\n* @throws {TypeError} options argument must be an object\n* @returns {Function} shuffle function\n*\n* @example\n* var shuffle = factory({\n* 'seed': 249\n* });\n* var data = [ 3, 8, 4, 8 ];\n* var out = shuffle( data );\n* // e.g., returns [ 4, 3, 8, 8 ]\n*/\nfunction factory( config ) {\n\tvar conf;\n\tvar rand;\n\tvar err;\n\n\tconf = deepCopy( defaults );\n\tif ( arguments.length ) {\n\t\terr = validate( conf, config );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( config && hasOwnProp( config, 'seed' ) ) {\n\t\trand = randu({\n\t\t\t'seed': config.seed\n\t\t});\n\t} else {\n\t\trand = randu();\n\t}\n\tsetReadOnly( shuffle, 'seed', rand.seed );\n\tsetReadOnly( shuffle, 'PRNG', rand );\n\n\trand = rand.normalized;\n\n\treturn shuffle;\n\n\t/**\n\t* Returns a random permutation of elements in `arr`.\n\t*\n\t* @private\n\t* @param {(ArrayLike|TypedArrayLike)} arr - array-like object to shuffle\n\t* @param {Options} [options] - function options\n\t* @param {string} [options.copy] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n\t* @throws {TypeError} first argument must be array-like\n\t* @throws {TypeError} options must be an object\n\t* @throws {TypeError} must provide valid options\n\t* @returns {ArrayLike} the shuffled array-like object\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data );\n\t* // e.g., returns [ 3, 1, 2 ]\n\t*\n\t* @example\n\t* var data = [ 1, 2, 3 ];\n\t* var out = shuffle( data, {\n\t* 'copy': 'none'\n\t* });\n\t* var bool = ( data === out );\n\t* // returns true\n\t*/\n\tfunction shuffle( arr, options ) {\n\t\tvar strflg;\n\t\tvar level;\n\t\tvar copy;\n\t\tvar opts;\n\t\tvar err;\n\t\tvar out;\n\t\tvar tmp;\n\t\tvar N;\n\t\tvar i;\n\t\tvar j;\n\n\t\tif ( !( isArrayLike( arr ) || isTypedArrayLike( arr ) ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be array-like. Value: `%s`.', arr ) );\n\t\t}\n\t\tif ( arguments.length > 1 ) {\n\t\t\topts = {};\n\t\t\terr = validate( opts, options );\n\t\t\tif ( err ) {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\tcopy = ( opts && opts.copy ) ? opts.copy : conf.copy;\n\n\t\tstrflg = isString( arr );\n\t\tif ( strflg ) {\n\t\t\tarr = arr.split( '' );\n\t\t\tcopy = 'none';\n\t\t}\n\n\t\tlevel = 0;\n\t\tif ( copy === 'shallow' ) {\n\t\t\tlevel += 1;\n\t\t} else if ( copy === 'deep' ) {\n\t\t\tlevel += 2;\n\t\t}\n\t\tN = arr.length;\n\t\tout = deepCopy( arr, level );\n\n\t\t// Note: we skip the first element, as no further swaps are possible given that all other indices are excluded from swapping...\n\t\tfor ( i = N - 1; i > 0; i-- ) {\n\t\t\t// Generate an integer index on the interval [0,i]:\n\t\t\tj = floor( rand() * (i+1.0) );\n\n\t\t\t// Swap elements:\n\t\t\ttmp = out[ i ];\n\t\t\tout[ i ] = out[ j ];\n\t\t\tout[ j ] = tmp;\n\t\t}\n\n\t\tif ( strflg ) {\n\t\t\tout = arr.join( '' );\n\t\t}\n\t\treturn out;\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = factory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\n/**\n* Returns a random permutation of elements in `arr`.\n*\n* @name shuffle\n* @type {Function}\n* @param {ArrayLike} arr - array-like object to shuffle\n* @param {Options} [options] - function options\n* @param {string} [options.copy=\"shallow\"] - string indicating whether to return a copy (`deep`,`shallow` or `none`)\n* @throws {TypeError} options must be an object\n* @throws {TypeError} must provide valid options\n* @returns {ArrayLike} the shuffled array-like object\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* @example\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data, {\n* 'copy': 'none'\n* });\n* var bool = ( data === out );\n* // returns true\n*/\nvar shuffle = factory();\n\n\n// EXPORTS //\n\nmodule.exports = shuffle;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Return a random permutation of elements from an array-like object.\n*\n* @module @stdlib/random-shuffle\n*\n* @example\n* var shuffle = require( '@stdlib/random-shuffle' );\n*\n* var data = [ 1, 2, 3 ];\n* var out = shuffle( data );\n* // e.g., returns [ 3, 1, 2 ]\n*\n* out = shuffle( data, {\n* 'copy': 'none'\n* });\n*\n* var bool = ( data === out );\n* // returns true\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "mappings": "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", + "names": ["require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "hasOwnProp", "isString", "isObject", "indexOf", "format", "COPY_OPTIONS", "validate", "opts", "options", "require_factory", "__commonJSMin", "exports", "module", "setReadOnly", "isArrayLike", "isTypedArrayLike", "isString", "deepCopy", "floor", "randu", "format", "hasOwnProp", "defaults", "validate", "factory", "config", "conf", "rand", "err", "shuffle", "arr", "options", "strflg", "level", "copy", "opts", "out", "tmp", "N", "i", "j", "require_main", "__commonJSMin", "exports", "module", "factory", "shuffle", "setReadOnly", "main", "factory"] } diff --git a/lib/factory.js b/lib/factory.js index 0b3298b..1fef90b 100644 --- a/lib/factory.js +++ b/lib/factory.js @@ -28,6 +28,7 @@ var deepCopy = require( '@stdlib/utils-copy' ); var floor = require( '@stdlib/math-base-special-floor' ); var randu = require( '@stdlib/random-base-mt19937' ).factory; var format = require( '@stdlib/string-format' ); +var hasOwnProp = require( '@stdlib/assert-has-own-property' ); var defaults = require( './defaults.json' ); var validate = require( './validate.js' ); @@ -63,7 +64,7 @@ function factory( config ) { throw err; } } - if ( config && config.seed ) { + if ( config && hasOwnProp( config, 'seed' ) ) { rand = randu({ 'seed': config.seed }); diff --git a/package.json b/package.json index fcc448f..5777036 100644 --- a/package.json +++ b/package.json @@ -37,31 +37,31 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/assert-has-own-property": "^0.2.1", - "@stdlib/assert-is-array-like": "^0.2.1", - "@stdlib/assert-is-plain-object": "^0.2.1", - "@stdlib/assert-is-string": "^0.2.1", - "@stdlib/assert-is-typed-array-like": "^0.2.1", - "@stdlib/math-base-special-floor": "^0.2.2", + "@stdlib/assert-has-own-property": "^0.2.2", + "@stdlib/assert-is-array-like": "^0.2.2", + "@stdlib/assert-is-plain-object": "^0.2.2", + "@stdlib/assert-is-string": "^0.2.2", + "@stdlib/assert-is-typed-array-like": "^0.2.2", + "@stdlib/math-base-special-floor": "^0.2.3", "@stdlib/random-base-mt19937": "^0.2.1", - "@stdlib/string-format": "^0.2.1", - "@stdlib/types": "^0.3.2", - "@stdlib/utils-copy": "^0.2.1", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1", - "@stdlib/utils-index-of": "^0.2.1", - "@stdlib/error-tools-fmtprodmsg": "^0.2.1" + "@stdlib/string-format": "^0.2.2", + "@stdlib/types": "^0.4.1", + "@stdlib/utils-copy": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/utils-index-of": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { - "@stdlib/array-int32": "^0.2.1", - "@stdlib/assert-is-array": "^0.2.1", - "@stdlib/assert-is-uint32array": "^0.2.1", - "@stdlib/number-ctor": "^0.2.1", + "@stdlib/array-int32": "^0.2.2", + "@stdlib/assert-is-array": "^0.2.2", + "@stdlib/assert-is-uint32array": "^0.2.2", + "@stdlib/number-ctor": "^0.2.2", "@stdlib/random-base-randu": "^0.2.1", - "@stdlib/utils-constructor-name": "^0.2.1", + "@stdlib/utils-constructor-name": "^0.2.2", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1", "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.1" + "@stdlib/bench-harness": "^0.2.2" }, "engines": { "node": ">=0.10.0",