From c653a3740f00001cb4e3e1ef79b0a93cc2091a69 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Aug 2023 05:44:50 +0000 Subject: [PATCH 001/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ecc3e9c..0e7934a 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "github:stdlib-js/array-base-fillednd#main", - "@stdlib/types": "^0.0.14" + "@stdlib/types": "^0.0.14", + "@stdlib/error-tools-fmtprodmsg": "^0.0.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.0.7", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From a3c0da8b6274f2947839a6979c6fc81a28956a2b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Aug 2023 05:46:08 +0000 Subject: [PATCH 002/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 62 - .github/workflows/cancel.yml | 56 - .github/workflows/close_pull_requests.yml | 44 - .github/workflows/examples.yml | 62 - .github/workflows/npm_downloads.yml | 108 - .github/workflows/productionize.yml | 783 --- .github/workflows/publish.yml | 242 - .github/workflows/test.yml | 97 - .github/workflows/test_bundles.yml | 180 - .github/workflows/test_coverage.yml | 123 - .github/workflows/test_install.yml | 83 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6199 insertions(+), 4410 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0fd4d6c..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 06a9a75..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index a00dbe5..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,56 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - uses: styfle/cancel-workflow-action@0.11.0 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index d8811e2..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,44 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 7902a7d..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout the repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index a41e9a0..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,108 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - uses: actions/upload-artifact@v3 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - uses: distributhor/workflow-webhook@v3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 91f2b93..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,783 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - uses: actions/checkout@v3 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/checkout@v3 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -137,7 +130,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index bfc6bf8..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled two-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index b36c48c..40e3703 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/object'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..4abc922 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..a4acfdb --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled two-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;uFAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 6d2e15a..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 0e7934a..923bb56 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.0.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "github:stdlib-js/array-base-fillednd#main", - "@stdlib/types": "^0.0.14", - "@stdlib/error-tools-fmtprodmsg": "^0.0.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.0.7", - "@stdlib/bench": "^0.0.12", - "@stdlib/math-base-special-cbrt": "^0.0.7", - "@stdlib/math-base-special-floor": "^0.0.8", - "@stdlib/math-base-special-pow": "^0.0.7", - "@stdlib/math-base-special-sqrt": "^0.0.8", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..25f63fa --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 4ee2bdc5add0adf0f3fbd2e18602441b91afc91a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Aug 2023 06:37:25 +0000 Subject: [PATCH 003/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ecc3e9c..0e7934a 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "github:stdlib-js/array-base-fillednd#main", - "@stdlib/types": "^0.0.14" + "@stdlib/types": "^0.0.14", + "@stdlib/error-tools-fmtprodmsg": "^0.0.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.0.7", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 6a74856b88b4a831faec052c977ebe4309bcc89b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Aug 2023 06:37:55 +0000 Subject: [PATCH 004/105] Remove files --- index.d.ts | 260 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6442 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 40e3703..0000000 --- a/index.d.ts +++ /dev/null @@ -1,260 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/object'; - -// FIXME: shapes should be collections of a defined length - -/** -* One-dimensional array. -*/ -type Array1D = Collection; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; // tslint:disable-line:no-single-element-tuple-type - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Collection ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 4abc922..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index a4acfdb..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled two-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;uFAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 25f63fa..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 5c0f9a46486cb37ea7b46eaa399db7fe62d81189 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Aug 2023 06:38:56 +0000 Subject: [PATCH 005/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 62 - .github/workflows/cancel.yml | 56 - .github/workflows/close_pull_requests.yml | 44 - .github/workflows/examples.yml | 62 - .github/workflows/npm_downloads.yml | 108 - .github/workflows/productionize.yml | 783 --- .github/workflows/publish.yml | 242 - .github/workflows/test.yml | 97 - .github/workflows/test_bundles.yml | 180 - .github/workflows/test_coverage.yml | 123 - .github/workflows/test_install.yml | 83 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6199 insertions(+), 4410 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0fd4d6c..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 06a9a75..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index a00dbe5..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,56 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - uses: styfle/cancel-workflow-action@0.11.0 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index d8811e2..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,44 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 7902a7d..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout the repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index a41e9a0..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,108 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - uses: actions/upload-artifact@v3 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - uses: distributhor/workflow-webhook@v3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 91f2b93..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,783 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - uses: actions/checkout@v3 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/checkout@v3 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -137,7 +130,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index b36c48c..40e3703 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/object'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..4abc922 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..156592e --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;uFAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 0e7934a..923bb56 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.0.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "github:stdlib-js/array-base-fillednd#main", - "@stdlib/types": "^0.0.14", - "@stdlib/error-tools-fmtprodmsg": "^0.0.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.0.7", - "@stdlib/bench": "^0.0.12", - "@stdlib/math-base-special-cbrt": "^0.0.7", - "@stdlib/math-base-special-floor": "^0.0.8", - "@stdlib/math-base-special-pow": "^0.0.7", - "@stdlib/math-base-special-sqrt": "^0.0.8", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..692e022 --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From fd525f5fca1ecba9361be5f6b8054c52f8e7293a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 17 Aug 2023 02:27:41 +0000 Subject: [PATCH 006/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ecc3e9c..0e7934a 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "github:stdlib-js/array-base-fillednd#main", - "@stdlib/types": "^0.0.14" + "@stdlib/types": "^0.0.14", + "@stdlib/error-tools-fmtprodmsg": "^0.0.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.0.7", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 7e000d10b7ab10f2291bfa0669e03e5ddcc82f17 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 17 Aug 2023 02:40:19 +0000 Subject: [PATCH 007/105] Remove files --- index.d.ts | 260 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6442 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 40e3703..0000000 --- a/index.d.ts +++ /dev/null @@ -1,260 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/object'; - -// FIXME: shapes should be collections of a defined length - -/** -* One-dimensional array. -*/ -type Array1D = Collection; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; // tslint:disable-line:no-single-element-tuple-type - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Collection ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 4abc922..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 156592e..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;uFAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 692e022..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From b19ad3b5c583bafa6b24b503c7541cdb3eecfccc Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 17 Aug 2023 02:41:03 +0000 Subject: [PATCH 008/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 62 - .github/workflows/cancel.yml | 56 - .github/workflows/close_pull_requests.yml | 44 - .github/workflows/examples.yml | 62 - .github/workflows/npm_downloads.yml | 108 - .github/workflows/productionize.yml | 783 --- .github/workflows/publish.yml | 242 - .github/workflows/test.yml | 97 - .github/workflows/test_bundles.yml | 180 - .github/workflows/test_coverage.yml | 123 - .github/workflows/test_install.yml | 83 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6199 insertions(+), 4410 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0fd4d6c..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 06a9a75..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index a00dbe5..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,56 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - uses: styfle/cancel-workflow-action@0.11.0 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index d8811e2..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,44 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 7902a7d..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout the repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index a41e9a0..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,108 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - uses: actions/upload-artifact@v3 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - uses: distributhor/workflow-webhook@v3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 91f2b93..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,783 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - uses: actions/checkout@v3 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/checkout@v3 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -137,7 +130,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 2cd4a92..e57cf46 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..4abc922 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..156592e --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;uFAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 0e7934a..923bb56 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.0.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "github:stdlib-js/array-base-fillednd#main", - "@stdlib/types": "^0.0.14", - "@stdlib/error-tools-fmtprodmsg": "^0.0.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.0.7", - "@stdlib/bench": "^0.0.12", - "@stdlib/math-base-special-cbrt": "^0.0.7", - "@stdlib/math-base-special-floor": "^0.0.8", - "@stdlib/math-base-special-pow": "^0.0.7", - "@stdlib/math-base-special-sqrt": "^0.0.8", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..c77a567 --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From ec87191125010c92aa4396ea0e87bd0c22aaff0a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 24 Aug 2023 22:01:34 +0000 Subject: [PATCH 009/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ecc3e9c..0e7934a 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "github:stdlib-js/array-base-fillednd#main", - "@stdlib/types": "^0.0.14" + "@stdlib/types": "^0.0.14", + "@stdlib/error-tools-fmtprodmsg": "^0.0.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.0.7", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 6b6f6cdf7540ab5350cc44ec2b845c966b73d0ff Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 24 Aug 2023 22:02:36 +0000 Subject: [PATCH 010/105] Remove files --- index.d.ts | 260 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6442 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index e57cf46..0000000 --- a/index.d.ts +++ /dev/null @@ -1,260 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; - -// FIXME: shapes should be collections of a defined length - -/** -* One-dimensional array. -*/ -type Array1D = Collection; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; // tslint:disable-line:no-single-element-tuple-type - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Collection ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 4abc922..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 156592e..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;uFAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index c77a567..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From e765b975a85c2088a4a0270404dd573051f4baee Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 24 Aug 2023 22:03:22 +0000 Subject: [PATCH 011/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 62 - .github/workflows/cancel.yml | 56 - .github/workflows/close_pull_requests.yml | 44 - .github/workflows/examples.yml | 62 - .github/workflows/npm_downloads.yml | 108 - .github/workflows/productionize.yml | 783 --- .github/workflows/publish.yml | 242 - .github/workflows/test.yml | 97 - .github/workflows/test_bundles.yml | 180 - .github/workflows/test_coverage.yml | 123 - .github/workflows/test_install.yml | 83 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6199 insertions(+), 4410 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0fd4d6c..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 06a9a75..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index a00dbe5..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,56 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - uses: styfle/cancel-workflow-action@0.11.0 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index d8811e2..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,44 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 7902a7d..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout the repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index a41e9a0..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,108 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - uses: actions/upload-artifact@v3 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - uses: distributhor/workflow-webhook@v3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 91f2b93..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,783 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - uses: actions/checkout@v3 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/checkout@v3 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -137,7 +130,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1aeaf1a..a6ff0a1 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..4abc922 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..156592e --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;uFAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 0e7934a..923bb56 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.0.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "github:stdlib-js/array-base-fillednd#main", - "@stdlib/types": "^0.0.14", - "@stdlib/error-tools-fmtprodmsg": "^0.0.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.0.7", - "@stdlib/bench": "^0.0.12", - "@stdlib/math-base-special-cbrt": "^0.0.7", - "@stdlib/math-base-special-floor": "^0.0.8", - "@stdlib/math-base-special-pow": "^0.0.7", - "@stdlib/math-base-special-sqrt": "^0.0.8", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..0ca717f --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 063594644e0a1c7f81581c38f0f35792cbda49cd Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 25 Aug 2023 00:30:46 +0000 Subject: [PATCH 012/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1a855f8..38eda3f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.0.1", - "@stdlib/types": "^0.0.14" + "@stdlib/types": "^0.0.14", + "@stdlib/error-tools-fmtprodmsg": "^0.0.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.0.7", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From c27142dc51446fe006dd9d5a8bc97cae8a6c0c66 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 25 Aug 2023 00:31:35 +0000 Subject: [PATCH 013/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index a6ff0a1..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; // tslint:disable-line:no-single-element-tuple-type - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; // tslint:disable-line:no-unnecessary-generics - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 4abc922..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 156592e..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;uFAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 0ca717f..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 9f773717850d5a867a7aa46c32f351a4a052b805 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 25 Aug 2023 00:32:17 +0000 Subject: [PATCH 014/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 62 - .github/workflows/cancel.yml | 56 - .github/workflows/close_pull_requests.yml | 44 - .github/workflows/examples.yml | 62 - .github/workflows/npm_downloads.yml | 108 - .github/workflows/productionize.yml | 783 --- .github/workflows/publish.yml | 242 - .github/workflows/test.yml | 97 - .github/workflows/test_bundles.yml | 180 - .github/workflows/test_coverage.yml | 123 - .github/workflows/test_install.yml | 83 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6199 insertions(+), 4410 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0fd4d6c..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 06a9a75..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index a00dbe5..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,56 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - uses: styfle/cancel-workflow-action@0.11.0 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index d8811e2..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,44 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 7902a7d..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout the repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index a41e9a0..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,108 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - uses: actions/upload-artifact@v3 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - uses: distributhor/workflow-webhook@v3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 91f2b93..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,783 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - uses: actions/checkout@v3 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/checkout@v3 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1aeaf1a..a6ff0a1 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..b6598d4 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.0.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 38eda3f..592f4a6 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.0.1", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.0.1", - "@stdlib/types": "^0.0.14", - "@stdlib/error-tools-fmtprodmsg": "^0.0.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.0.7", - "@stdlib/bench": "^0.0.12", - "@stdlib/math-base-special-cbrt": "^0.0.7", - "@stdlib/math-base-special-floor": "^0.0.8", - "@stdlib/math-base-special-pow": "^0.0.7", - "@stdlib/math-base-special-sqrt": "^0.0.8", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..90112c9 --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 00c6c8b27ba3ba6b42ec34b91c3b4d13130cd3ae Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 25 Aug 2023 00:32:43 +0000 Subject: [PATCH 015/105] Update README.md for ESM bundle v0.0.1 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4611051..e5195bf 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ limitations under the License. ## Usage ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@esm/index.mjs'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.0.1-esm/index.mjs'; ``` #### zerosnd( shape ) @@ -90,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); - - - - From 68b0d36785c5a7c2c048cf772e5b0ed98902744d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 24 Sep 2023 15:47:50 +0000 Subject: [PATCH 019/105] Auto-generated commit --- .editorconfig | 186 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 62 - .github/workflows/cancel.yml | 56 - .github/workflows/close_pull_requests.yml | 44 - .github/workflows/examples.yml | 62 - .github/workflows/npm_downloads.yml | 108 - .github/workflows/productionize.yml | 783 --- .github/workflows/publish.yml | 242 - .github/workflows/test.yml | 97 - .github/workflows/test_bundles.yml | 180 - .github/workflows/test_coverage.yml | 123 - .github/workflows/test_install.yml | 83 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 43 files changed, 6199 insertions(+), 4445 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 13e9c39..0000000 --- a/.editorconfig +++ /dev/null @@ -1,186 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 06a9a75..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index a00dbe5..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,56 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - uses: styfle/cancel-workflow-action@0.11.0 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index d8811e2..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,44 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 7902a7d..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,62 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout the repository' - uses: actions/checkout@v3 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index a41e9a0..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,108 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - uses: actions/upload-artifact@v3 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - uses: distributhor/workflow-webhook@v3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 91f2b93..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,783 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - uses: actions/checkout@v3 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/checkout@v3 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - uses: actions/checkout@v3 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - uses: actions/setup-node@v3 - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1aeaf1a..a6ff0a1 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..b6598d4 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.0.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index b050c80..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.1.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.0" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.0", - "@stdlib/bench": "^0.1.0", - "@stdlib/math-base-special-cbrt": "^0.1.0", - "@stdlib/math-base-special-floor": "^0.1.0", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^0.1.0", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..7896f0c --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 9a9c3754ae4563fc01eb443ab1980e6372f3fee6 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 24 Sep 2023 15:54:20 +0000 Subject: [PATCH 020/105] Update README.md for ESM bundle v0.1.0 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92a0c77..07d049f 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ limitations under the License. ## Usage ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@esm/index.mjs'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.1.0-esm/index.mjs'; ``` #### zerosnd( shape ) @@ -90,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); - - - - From 1045b30ea3811656edd5fe383df2c41ddee95f06 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 3 Oct 2023 01:09:47 +0000 Subject: [PATCH 024/105] Auto-generated commit --- .editorconfig | 186 - .eslintrc.js | 1 - .gitattributes | 49 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 247 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 128 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 616 -- test/test.js | 616 -- 45 files changed, 6199 insertions(+), 5120 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 13e9c39..0000000 --- a/.editorconfig +++ /dev/null @@ -1,186 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 131a88d..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-10-01T05:12:04.713Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index ab56cca..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 3acd3a9..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA corresponding to v0.11.0 - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index c1c45e7..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index b0ef5a6..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA corresponding to v3.0.3: - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 265afda..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1aeaf1a..a6ff0a1 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..3effb80 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index b050c80..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.1.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.0" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.0", - "@stdlib/bench": "^0.1.0", - "@stdlib/math-base-special-cbrt": "^0.1.0", - "@stdlib/math-base-special-floor": "^0.1.0", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^0.1.0", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..3ccbfcc --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index 7e9ca22..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From fb133a708e3ca22bcc8e0c7a895ed94a06adcb04 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 5 Oct 2023 19:28:18 +0000 Subject: [PATCH 025/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 10b9716..cc17341 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.1.0" + "@stdlib/types": "^0.1.0", + "@stdlib/error-tools-fmtprodmsg": "^0.1.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From b1ce549de210464d59dd9543740b9792d6c4fea1 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 7 Oct 2023 02:16:12 +0000 Subject: [PATCH 026/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index a6ff0a1..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; // tslint:disable-line:no-single-element-tuple-type - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; // tslint:disable-line:no-unnecessary-generics - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 3effb80..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 3ccbfcc..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From d61bd3f6b2831a3f68c6d5a13a0a46df5eed6a0a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 7 Oct 2023 02:16:59 +0000 Subject: [PATCH 027/105] Auto-generated commit --- .editorconfig | 186 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 247 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 128 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 616 -- test/test.js | 616 -- 44 files changed, 6199 insertions(+), 5119 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 13e9c39..0000000 --- a/.editorconfig +++ /dev/null @@ -1,186 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index ab56cca..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 3acd3a9..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA corresponding to v0.11.0 - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index c1c45e7..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index b0ef5a6..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA corresponding to v3.0.3: - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 265afda..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1aeaf1a..a6ff0a1 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..3effb80 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index cc17341..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.1.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.1", - "@stdlib/bench": "^0.1.0", - "@stdlib/math-base-special-cbrt": "^0.1.0", - "@stdlib/math-base-special-floor": "^0.1.0", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^0.1.0", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..5923616 --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index 7e9ca22..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 614b6413af87136e416576c3d4758f38e2de4d51 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 1 Nov 2023 17:00:05 +0000 Subject: [PATCH 028/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f55ac51..a49aff7 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.1.0" + "@stdlib/types": "^0.1.0", + "@stdlib/error-tools-fmtprodmsg": "^0.1.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 41e659657576b009eaba6347830c119396b5250a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 3 Nov 2023 01:26:57 +0000 Subject: [PATCH 029/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index a6ff0a1..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; // tslint:disable-line:no-single-element-tuple-type - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; // tslint:disable-line:no-unnecessary-generics - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 3effb80..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 5923616..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From eb43804ee5bc05c1f8e64e9ca0a52ae9cf19b590 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 3 Nov 2023 01:27:50 +0000 Subject: [PATCH 030/105] Auto-generated commit --- .editorconfig | 186 - .eslintrc.js | 1 - .gitattributes | 49 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 255 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 128 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 45 files changed, 6199 insertions(+), 4545 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 13e9c39..0000000 --- a/.editorconfig +++ /dev/null @@ -1,186 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 3772607..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-11-01T05:29:06.252Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index ab56cca..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 3acd3a9..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA corresponding to v0.11.0 - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index c1c45e7..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index b0ef5a6..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA corresponding to v3.0.3: - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 265afda..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1aeaf1a..a6ff0a1 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..3effb80 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index a49aff7..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.1.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.1", - "@stdlib/bench": "^0.1.0", - "@stdlib/math-base-special-cbrt": "^0.1.1", - "@stdlib/math-base-special-floor": "^0.1.1", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^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" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..9fd9826 --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From d062b2634bac6762df9c99064a44cc5b5dacb0d7 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 15:10:23 +0000 Subject: [PATCH 031/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ca371db..b8d2c6d 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0" + "@stdlib/types": "^0.2.0", + "@stdlib/error-tools-fmtprodmsg": "^0.1.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From f66000a553915a30b3a6390d5ccefb9f0e3fd4fa Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 15:12:21 +0000 Subject: [PATCH 032/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index a6ff0a1..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; // tslint:disable-line:no-single-element-tuple-type - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; // tslint:disable-line:no-unnecessary-generics - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 3effb80..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 9fd9826..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 6d14216fa88a32a21b78383a476b32669c3c72ca Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 15:12:57 +0000 Subject: [PATCH 033/105] Auto-generated commit --- .editorconfig | 186 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 255 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 128 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 44 files changed, 6199 insertions(+), 4544 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 13e9c39..0000000 --- a/.editorconfig +++ /dev/null @@ -1,186 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index ab56cca..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 3acd3a9..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA corresponding to v0.11.0 - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index c1c45e7..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index b0ef5a6..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA corresponding to v3.0.3: - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 265afda..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 991c6ea..3a90987 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..3effb80 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index b8d2c6d..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.1", - "@stdlib/bench": "^0.2.0", - "@stdlib/math-base-special-cbrt": "^0.1.1", - "@stdlib/math-base-special-floor": "^0.1.1", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^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" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..2217f3f --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From b03b1c2116a04a05c76778e67417f829003e2bf7 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 21:24:56 +0000 Subject: [PATCH 034/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ca371db..b8d2c6d 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0" + "@stdlib/types": "^0.2.0", + "@stdlib/error-tools-fmtprodmsg": "^0.1.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 878f60e672376b12008ea152a837de05868d9c58 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 21:33:01 +0000 Subject: [PATCH 035/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 3a90987..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; // tslint:disable-line:no-single-element-tuple-type - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 3effb80..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 2217f3f..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 6bb0d2e67d79453fb43e7ffef14f68ce071585e6 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 21:33:31 +0000 Subject: [PATCH 036/105] Auto-generated commit --- .editorconfig | 186 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 255 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 128 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 44 files changed, 6199 insertions(+), 4544 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 13e9c39..0000000 --- a/.editorconfig +++ /dev/null @@ -1,186 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tslint.json` files: -[tslint.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index ab56cca..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 3acd3a9..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA corresponding to v0.11.0 - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index c1c45e7..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index b0ef5a6..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA corresponding to v3.0.3: - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 265afda..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..3effb80 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index b8d2c6d..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.1", - "@stdlib/bench": "^0.2.0", - "@stdlib/math-base-special-cbrt": "^0.1.1", - "@stdlib/math-base-special-floor": "^0.1.1", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^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" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..72a4753 --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 5414989d56bc14043111d511367444307cbb613c Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Dec 2023 13:10:25 +0000 Subject: [PATCH 037/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ffd4827..827f5b5 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0" + "@stdlib/types": "^0.2.0", + "@stdlib/error-tools-fmtprodmsg": "^0.1.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From faeb58d184dbe0755f9ba4988c447c7c49278004 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 2 Dec 2023 11:10:58 +0000 Subject: [PATCH 038/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 3effb80..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 72a4753..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 314c3f55348a3c031f564d1dde03878b2f5b4eaa Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 2 Dec 2023 11:11:48 +0000 Subject: [PATCH 039/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 255 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 128 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 227 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 45 files changed, 6199 insertions(+), 4540 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 69a2fdb..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-12-01T05:33:40.164Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index ab56cca..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 3acd3a9..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA corresponding to v0.11.0 - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index c1c45e7..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index b0ef5a6..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA corresponding to v3.0.3: - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 265afda..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA corresponding to v4.1.0 - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 16 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index ebbeb56..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 1acb202..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f1b626e..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index ecdb3c1..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..3effb80 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 827f5b5..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.1", - "@stdlib/bench": "^0.2.1", - "@stdlib/math-base-special-cbrt": "^0.1.1", - "@stdlib/math-base-special-floor": "^0.1.1", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^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" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..1ed627d --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 20b742a10daab38a43b9f331997c5bbed4028c18 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Jan 2024 07:51:28 +0000 Subject: [PATCH 040/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 800826b..d6952b4 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0" + "@stdlib/types": "^0.2.0", + "@stdlib/error-tools-fmtprodmsg": "^0.1.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 8f606910b6b9311d99beb6ebee35b21b7e2a66e4 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Jan 2024 14:29:26 +0000 Subject: [PATCH 041/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 3effb80..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2023 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 1ed627d..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From c60e7b4d5a2fdcdfa7143c720b85cc0d0388ec77 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Jan 2024 14:29:49 +0000 Subject: [PATCH 042/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 255 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 128 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 228 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 33 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 53 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 46 files changed, 6199 insertions(+), 4546 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 4d360c8..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-01-01T05:03:09.374Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 30656c4..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 3acd3a9..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA corresponding to v0.11.0 - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index c92f5c4..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 4645e94..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index e1e3539..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -148,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index fb1b688..0000000 --- a/branches.md +++ /dev/null @@ -1,53 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers. -- **deno**: [Deno][deno-url] branch for use in Deno. -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments. - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..4871d26 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index d6952b4..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.1", - "@stdlib/math-base-special-cbrt": "^0.1.1", - "@stdlib/math-base-special-floor": "^0.1.1", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^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", - "@stdlib/bench-harness": "^0.1.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..8c479d0 --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From fa98da8517092605b0efb8e45c17ba27a4067374 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Feb 2024 08:21:01 +0000 Subject: [PATCH 043/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 800826b..d6952b4 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0" + "@stdlib/types": "^0.2.0", + "@stdlib/error-tools-fmtprodmsg": "^0.1.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From af7e1984e41630f559af891d34ca4a346261c5b3 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Feb 2024 13:42:52 +0000 Subject: [PATCH 044/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 4871d26..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 8c479d0..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 84d591ee4f280054b40d6d9543b65f918f608fa4 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Feb 2024 13:43:18 +0000 Subject: [PATCH 045/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 255 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 128 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 228 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 35 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 46 files changed, 6199 insertions(+), 4551 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index f06be1b..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-02-01T05:51:21.761Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 30656c4..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index 3acd3a9..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA corresponding to v0.11.0 - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index c92f5c4..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 4645e94..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index e1e3539..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA corresponding to v3.8.1 - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -150,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..4871d26 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index d6952b4..8271621 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.1.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.1.0", - "@stdlib/types": "^0.2.0", - "@stdlib/error-tools-fmtprodmsg": "^0.1.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.1.1", - "@stdlib/math-base-special-cbrt": "^0.1.1", - "@stdlib/math-base-special-floor": "^0.1.1", - "@stdlib/math-base-special-pow": "^0.1.0", - "@stdlib/math-base-special-sqrt": "^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", - "@stdlib/bench-harness": "^0.1.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..373398f --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 8cd3fda9927ece5d6931079e74b6301df52c283d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 14 Feb 2024 23:50:01 +0000 Subject: [PATCH 046/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a80552d..f3e19eb 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.0", - "@stdlib/types": "^0.3.1" + "@stdlib/types": "^0.3.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.0" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.0", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 45a2ec4b212dafe2ec9a5f0d7177c04a515b4844 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 15 Feb 2024 02:26:52 +0000 Subject: [PATCH 047/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 6177 ------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 4871d26..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 373398f..0000000 --- a/stats.html +++ /dev/null @@ -1,6177 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 1d8aa442d7a857279e6aefb82f0b0bd1393e98b2 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 15 Feb 2024 02:27:08 +0000 Subject: [PATCH 048/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 --- .github/workflows/publish.yml | 255 - .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 132 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 228 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 35 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 45 files changed, 6199 insertions(+), 4554 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1dccb94..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA corresponding to v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 9106b5d..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -150,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..4871d26 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.1.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index f3e19eb..dc25aa4 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.0", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.0", - "@stdlib/types": "^0.3.1", - "@stdlib/error-tools-fmtprodmsg": "^0.2.0" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.0", - "@stdlib/math-base-special-cbrt": "^0.2.0", - "@stdlib/math-base-special-floor": "^0.2.0", - "@stdlib/math-base-special-pow": "^0.2.0", - "@stdlib/math-base-special-sqrt": "^0.2.0", - "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.0" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..e646ac2 --- /dev/null +++ b/stats.html @@ -0,0 +1,6177 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 35d36715968955fb8e5876fdb979df8d4394bfde Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 15 Feb 2024 04:10:59 +0000 Subject: [PATCH 049/105] Update README.md for ESM bundle v0.2.0 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f462898..ec53b12 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ limitations under the License. ## Usage ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@esm/index.mjs'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.0-esm/index.mjs'; ``` #### zerosnd( shape ) @@ -90,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); - - - - From 89d5848fc449b2171e90497417c726b586438e3b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 25 Feb 2024 07:13:07 +0000 Subject: [PATCH 053/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 ---- .github/workflows/publish.yml | 249 -- .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 132 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 228 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 35 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4864 insertions(+), 4548 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 9106b5d..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -150,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..42e8525 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.0-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 6050ed5..72dafd7 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.1", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.1", - "@stdlib/math-base-special-cbrt": "^0.2.1", - "@stdlib/math-base-special-floor": "^0.2.1", - "@stdlib/math-base-special-pow": "^0.2.0", - "@stdlib/math-base-special-sqrt": "^0.2.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", - "@stdlib/bench-harness": "^0.2.1" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..72cc92e --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 21344e23cd3f2c0ad7e69b00d3f40e578ee10201 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 25 Feb 2024 07:43:57 +0000 Subject: [PATCH 054/105] Update README.md for ESM bundle v0.2.1 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index decc7d6..2bce661 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ limitations under the License. ## Usage ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@esm/index.mjs'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.1-esm/index.mjs'; ``` #### zerosnd( shape ) @@ -90,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); - - - - From eed2d3aea8c4186a81c38b971622916d8eac7181 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Mar 2024 13:19:59 +0000 Subject: [PATCH 058/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 ---- .github/workflows/publish.yml | 249 -- .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 132 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 229 - .npmrc | 28 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 35 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4864 insertions(+), 4550 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 0e6d846..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-03-01T05:33:37.331Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index 9106b5d..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA corresponding to v2.0.0 - uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -150,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..36aac51 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 52e33c3..72dafd7 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.1", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.1", - "@stdlib/math-base-special-cbrt": "^0.2.1", - "@stdlib/math-base-special-floor": "^0.2.1", - "@stdlib/math-base-special-pow": "^0.2.1", - "@stdlib/math-base-special-sqrt": "^0.2.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", - "@stdlib/bench-harness": "^0.2.1" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..18b2e9e --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 5b04e773c05453487d5b390568c635b7c2491dcf Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Apr 2024 07:00:55 +0000 Subject: [PATCH 059/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d9ef4e8..ae17bd7 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2" + "@stdlib/types": "^0.3.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 361d0b671225f19b9f442eab25af14cb8c21ec1c Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Apr 2024 12:13:56 +0000 Subject: [PATCH 060/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 36aac51..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 18b2e9e..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 95fde1ba32d3e23e62f862a53dcace198427c961 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Apr 2024 12:14:13 +0000 Subject: [PATCH 061/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 ---- .github/workflows/publish.yml | 249 -- .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 132 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 35 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4864 insertions(+), 4553 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index adfddff..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-04-01T04:52:46.340Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index ec90164..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -150,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..36aac51 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index ae17bd7..72dafd7 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.1", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.1", - "@stdlib/math-base-special-cbrt": "^0.2.1", - "@stdlib/math-base-special-floor": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.2.1", - "@stdlib/math-base-special-sqrt": "^0.2.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", - "@stdlib/bench-harness": "^0.2.1" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..18b2e9e --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 1dfef8821e418086ab38d80e052506ce6857895b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 12 Apr 2024 03:17:29 +0000 Subject: [PATCH 062/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d9ef4e8..ae17bd7 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2" + "@stdlib/types": "^0.3.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 23474ec053aa9ccd12c6ec5565c3356779d1a632 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 12 Apr 2024 08:39:09 +0000 Subject: [PATCH 063/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 36aac51..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 18b2e9e..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From b3783e544b1502f1ebca1f87f6d0a871db979701 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 12 Apr 2024 08:39:27 +0000 Subject: [PATCH 064/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 49 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 797 ---- .github/workflows/publish.yml | 249 -- .github/workflows/test.yml | 100 - .github/workflows/test_bundles.yml | 189 - .github/workflows/test_coverage.yml | 134 - .github/workflows/test_install.yml | 86 - .gitignore | 188 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 35 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4864 insertions(+), 4554 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 10a16e6..0000000 --- a/.gitattributes +++ /dev/null @@ -1,49 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.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 - -# Override what is considered "documentation" by GitHub's linguist: -examples/** linguist-documentation=false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index ec90164..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,797 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -150,7 +141,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..36aac51 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index ae17bd7..72dafd7 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.1", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.1", - "@stdlib/math-base-special-cbrt": "^0.2.1", - "@stdlib/math-base-special-floor": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.2.1", - "@stdlib/math-base-special-sqrt": "^0.2.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", - "@stdlib/bench-harness": "^0.2.1" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..18b2e9e --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 8b9ba186c12dff71d4cba2d8f25ee8995bc0a160 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 18 May 2024 03:02:13 +0000 Subject: [PATCH 065/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d9ef4e8..ae17bd7 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2" + "@stdlib/types": "^0.3.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.1" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.1", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From a5a37a7bed990aeda9b85db7018e39a07f162c20 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 18 May 2024 03:03:20 +0000 Subject: [PATCH 066/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 36aac51..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 18b2e9e..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 62ecb5acd49ddf06a9e9d90be644ac401a93603b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 18 May 2024 03:03:36 +0000 Subject: [PATCH 067/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 ---- .github/workflows/publish.yml | 248 -- .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .gitignore | 188 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 5 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4870 insertions(+), 4567 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f92a6c5..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure git: - - name: 'Configure git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..36aac51 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index ae17bd7..72dafd7 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.1", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.1" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.1", - "@stdlib/math-base-special-cbrt": "^0.2.1", - "@stdlib/math-base-special-floor": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.2.1", - "@stdlib/math-base-special-sqrt": "^0.2.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", - "@stdlib/bench-harness": "^0.2.1" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..18b2e9e --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 23611d468c1a4d72e8aaf7f20b571c40cb0501c2 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 29 Jul 2024 02:18:22 +0000 Subject: [PATCH 068/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0e93767..e31c4cf 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2" + "@stdlib/types": "^0.3.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 16e36d8b112b6fff556f8793e3034fff0ce0e2f9 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 29 Jul 2024 02:19:17 +0000 Subject: [PATCH 069/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 36aac51..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 18b2e9e..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From fdc5ad233c2eaa41981421e60359156973ab2529 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 29 Jul 2024 02:19:31 +0000 Subject: [PATCH 070/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 ---- .github/workflows/publish.yml | 252 -- .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 138 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4870 insertions(+), 4706 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..36aac51 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.1-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index e31c4cf..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.1", - "@stdlib/types": "^0.3.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..18b2e9e --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From b8e19fac77930b4a43919e617442255cd7908861 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 29 Jul 2024 02:21:18 +0000 Subject: [PATCH 071/105] Update README.md for ESM bundle v0.2.2 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c59353d..94b767f 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ limitations under the License. ## Usage ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@esm/index.mjs'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.2-esm/index.mjs'; ``` #### zerosnd( shape ) @@ -90,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); - - - - From d55bc27b0bf1cba514c8af87d65cbf4ebdbaf1cd Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Aug 2024 12:39:17 +0000 Subject: [PATCH 075/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 ---- .github/workflows/publish.yml | 252 -- .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 88 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4870 insertions(+), 4657 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index 3a822b5..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-08-01T05:43:27.413Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..554eb8c --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 07bd810..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.3.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 625a5364323d388d2cf46f608fcdd179f875ffd0 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Sep 2024 08:12:09 +0000 Subject: [PATCH 076/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index af8bece..540ec57 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.1" + "@stdlib/types": "^0.4.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 5140a06fabd77b05a8987d8b447fa665b82fd2c8 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Sep 2024 12:31:34 +0000 Subject: [PATCH 077/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 554eb8c..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 27d93ebffe6ffca7a92f6da2b7038f79fe5d0e43 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Sep 2024 12:31:58 +0000 Subject: [PATCH 078/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 ---- .github/workflows/publish.yml | 252 -- .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 138 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4870 insertions(+), 4707 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index 4424579..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-09-01T06:09:23.231Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 1519d73..776812a 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Collection } from '@stdlib/types/array'; import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..554eb8c --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 540ec57..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.1", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 06bf5e933f5c639a79e12efcefc41f2704e8f8af Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 28 Sep 2024 21:16:34 +0000 Subject: [PATCH 079/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index af8bece..540ec57 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.1" + "@stdlib/types": "^0.4.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From f1998b65ebc5db4f7ff251f08a84e773fcecb44d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 28 Sep 2024 21:20:07 +0000 Subject: [PATCH 080/105] Remove files --- index.d.ts | 259 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 776812a..0000000 --- a/index.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Collection } from '@stdlib/types/array'; -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 554eb8c..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From cac083124868426856be5dd65680779cb93c5b47 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 28 Sep 2024 21:20:31 +0000 Subject: [PATCH 081/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 ---- .github/workflows/publish.yml | 252 -- .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4870 insertions(+), 4740 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..554eb8c --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 540ec57..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.1", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 1920138aa2e375def729b1140f324466253af3aa Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 1 Oct 2024 08:25:36 +0000 Subject: [PATCH 082/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index af8bece..540ec57 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.1" + "@stdlib/types": "^0.4.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 1e9cc5e00f9338f915f8b75330766c1c5d98a998 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 1 Oct 2024 13:03:28 +0000 Subject: [PATCH 083/105] Remove files --- index.d.ts | 258 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index f487d37..0000000 --- a/index.d.ts +++ /dev/null @@ -1,258 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 554eb8c..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 63a8b6c90e0b041577af94fb72f439bb5727b1ff Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 1 Oct 2024 13:03:42 +0000 Subject: [PATCH 084/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 ---- .github/workflows/publish.yml | 252 -- .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4870 insertions(+), 4741 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index 6a2f7fd..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-10-01T06:21:44.125Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..554eb8c --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 540ec57..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.1", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 98ec84cba2c3f2d69961297448254141679b9928 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Nov 2024 08:15:38 +0000 Subject: [PATCH 085/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index af8bece..540ec57 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.1" + "@stdlib/types": "^0.4.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 6d923cc922a36658de644f0b3b9bf9438e976a53 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Nov 2024 12:12:54 +0000 Subject: [PATCH 086/105] Remove files --- index.d.ts | 258 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index f487d37..0000000 --- a/index.d.ts +++ /dev/null @@ -1,258 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 554eb8c..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 6d21e2d8ad449579484eb0875108649b4f395d55 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Nov 2024 12:13:10 +0000 Subject: [PATCH 087/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 ---- .github/workflows/publish.yml | 252 -- .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4870 insertions(+), 4741 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index df672c4..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-11-01T06:24:47.074Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..554eb8c --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index 540ec57..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.1", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From e5078e911a257c887be78b23a6b72149c0e1003f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Dec 2024 08:31:13 +0000 Subject: [PATCH 088/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b39ae9a..c16df3e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3" + "@stdlib/types": "^0.4.3", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 8a0e645679b34919ee120a2668a5f970a8aff439 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Dec 2024 12:37:56 +0000 Subject: [PATCH 089/105] Remove files --- index.d.ts | 258 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index f487d37..0000000 --- a/index.d.ts +++ /dev/null @@ -1,258 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 554eb8c..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 61b879be38f5b79a7ebc96a4dc1d095fefa3f5dd Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Dec 2024 12:38:17 +0000 Subject: [PATCH 090/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 --- .github/workflows/publish.yml | 252 - .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .github/workflows/test_published_package.yml | 105 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4870 insertions(+), 4846 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .github/workflows/test_published_package.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index ea62134..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-12-01T06:34:16.276Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..554eb8c --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index c16df3e..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 8776751be40b0159d976c7b6b62d742976ffc312 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Dec 2024 02:11:17 +0000 Subject: [PATCH 091/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b39ae9a..c16df3e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3" + "@stdlib/types": "^0.4.3", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 003f1ccb02e4de7ff007d0a310a33af2d699cd06 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Dec 2024 02:29:28 +0000 Subject: [PATCH 092/105] Remove files --- index.d.ts | 258 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index f487d37..0000000 --- a/index.d.ts +++ /dev/null @@ -1,258 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 554eb8c..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 0fab1e06a78c74d606527e706808df1d33c92028 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Dec 2024 02:29:58 +0000 Subject: [PATCH 093/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 --- .github/workflows/publish.yml | 252 - .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .github/workflows/test_published_package.yml | 105 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4870 insertions(+), 4846 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .github/workflows/test_published_package.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index 326446b..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-12-09T02:05:04.511Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..554eb8c --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index c16df3e..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From ebce92b0c870dc6145ff2170389b184a37f0b62e Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 30 Dec 2024 03:22:14 +0000 Subject: [PATCH 094/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b39ae9a..c16df3e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3" + "@stdlib/types": "^0.4.3", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From aa8689c1eacc01a246c5de54cb915dfa178d87df Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 30 Dec 2024 04:35:39 +0000 Subject: [PATCH 095/105] Remove files --- index.d.ts | 258 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index f487d37..0000000 --- a/index.d.ts +++ /dev/null @@ -1,258 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 554eb8c..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 49dd94b15a090568699d90701b2ab815bc2bcf6b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 30 Dec 2024 04:35:54 +0000 Subject: [PATCH 096/105] Auto-generated commit --- .editorconfig | 181 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 --- .github/workflows/publish.yml | 252 - .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .github/workflows/test_published_package.yml | 105 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4870 insertions(+), 4846 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .github/workflows/test_published_package.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 0779e8a..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index 5eb3dc9..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2024-12-30T02:53:15.958Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..554eb8c --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index c16df3e..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From b9ef94fd9dd959bdedee4472154912cea27fca26 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 20 Jan 2025 01:47:43 +0000 Subject: [PATCH 097/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b39ae9a..c16df3e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3" + "@stdlib/types": "^0.4.3", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From ab3bcba5c6208247ded6b91763bf786e686ff2df Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 20 Jan 2025 02:03:45 +0000 Subject: [PATCH 098/105] Remove files --- index.d.ts | 258 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index f487d37..0000000 --- a/index.d.ts +++ /dev/null @@ -1,258 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 554eb8c..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From d0410af7428d96aba6626349c2041b981cad43ee Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 20 Jan 2025 02:03:57 +0000 Subject: [PATCH 099/105] Auto-generated commit --- .editorconfig | 180 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 --- .github/workflows/publish.yml | 252 - .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .github/workflows/test_published_package.yml | 105 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4870 insertions(+), 4845 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .github/workflows/test_published_package.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index dab5d2a..0000000 --- a/.editorconfig +++ /dev/null @@ -1,180 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index eb0a67a..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2025-01-20T01:42:39.407Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index e4ed56c..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..d87b9f3 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index c16df3e..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 0443b2e9b282d3f53a5ad25eea39e24a893c9d36 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 7 Apr 2025 00:43:51 +0000 Subject: [PATCH 100/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b39ae9a..c16df3e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3" + "@stdlib/types": "^0.4.3", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 261caf02ac170a94ff1c5ace3771f08921a324d2 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 7 Apr 2025 00:52:20 +0000 Subject: [PATCH 101/105] Remove files --- index.d.ts | 258 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index f487d37..0000000 --- a/index.d.ts +++ /dev/null @@ -1,258 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index d87b9f3..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 0ae79de8b7185a79564ede0f7c88cc59a04a9eae Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 7 Apr 2025 00:52:39 +0000 Subject: [PATCH 102/105] Auto-generated commit --- .editorconfig | 180 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 --- .github/workflows/publish.yml | 252 - .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .github/workflows/test_published_package.yml | 105 - .gitignore | 194 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4870 insertions(+), 4849 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .github/workflows/test_published_package.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index dab5d2a..0000000 --- a/.editorconfig +++ /dev/null @@ -1,180 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index 656b98e..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2025-04-07T00:43:05.746Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index b5c8ef8..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..d87b9f3 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index c16df3e..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); From 21d8e44d674bf86286ab774e187f193aa5d52b7e Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Apr 2025 00:50:07 +0000 Subject: [PATCH 103/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b39ae9a..c16df3e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3" + "@stdlib/types": "^0.4.3", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.2.2", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 227df1c394db26330d4696283eaa0c2856b5dc54 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Apr 2025 00:59:23 +0000 Subject: [PATCH 104/105] Remove files --- index.d.ts | 258 --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 index.d.ts delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index f487d37..0000000 --- a/index.d.ts +++ /dev/null @@ -1,258 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// TypeScript Version: 4.1 - -/// - -import { Shape } from '@stdlib/types/ndarray'; - -/** -* One-dimensional array. -*/ -type Array1D = Array; - -/** -* One-dimensional array shape. -*/ -type Shape1D = [ number ]; - -/** -* Two-dimensional array. -*/ -type Array2D = Array>; - -/** -* Two-dimensional array shape. -*/ -type Shape2D = [ number, number ]; - -/** -* Three-dimensional array. -*/ -type Array3D = Array>; - -/** -* Three-dimensional array shape. -*/ -type Shape3D = [ number, number, number ]; - -/** -* Four-dimensional array. -*/ -type Array4D = Array>; - -/** -* Four-dimensional array shape. -*/ -type Shape4D = [ number, number, number, number ]; - -/** -* Five-dimensional array. -*/ -type Array5D = Array>; - -/** -* Five-dimensional array shape. -*/ -type Shape5D = [ number, number, number, number, number ]; - -/** -* Six-dimensional array. -*/ -type Array6D = Array>; - -/** -* Six-dimensional array shape. -*/ -type Shape6D = [ number, number, number, number, number, number ]; - -/** -* Seven-dimensional array. -*/ -type Array7D = Array>; - -/** -* Seven-dimensional array shape. -*/ -type Shape7D = [ number, number, number, number, number, number, number ]; - -/** -* Eight-dimensional array. -*/ -type Array8D = Array>; - -/** -* Eight-dimensional array shape. -*/ -type Shape8D = [ number, number, number, number, number, number, number, number ]; - -/** -* Nine-dimensional array. -*/ -type Array9D = Array>; - -/** -* Nine-dimensional array shape. -*/ -type Shape9D = [ number, number, number, number, number, number, number, number, number ]; - -/** -* Ten-dimensional array. -*/ -type Array10D = Array>; // WARNING: arbitrarily limited to 10 dimensions, which should be fine for most practical purposes - -/** -* Ten-dimensional array shape. -*/ -type Shape10D = [ number, number, number, number, number, number, number, number, number, number ]; - -/** -* Returns a zero-filled one-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -*/ -declare function zerosnd( shape: Shape1D ): Array1D; -/** -* Returns a zero-filled two-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -declare function zerosnd( shape: Shape2D ): Array2D; -/** -* Returns a zero-filled three-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 3 ] ); -* // returns [ [ [ 0.0, 0.0, 0.0 ] ] ] -*/ -declare function zerosnd( shape: Shape3D ): Array3D; - -/** -* Returns a zero-filled four-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 3 ] ); -* // returns [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] -*/ -declare function zerosnd( shape: Shape4D ): Array4D; - -/** -* Returns a zero-filled five-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape5D ): Array5D; - -/** -* Returns a zero-filled six-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape6D ): Array6D; - -/** -* Returns a zero-filled seven-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape7D ): Array7D; - -/** -* Returns a zero-filled eight-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape8D ): Array8D; - -/** -* Returns a zero-filled nine-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape9D ): Array9D; - -/** -* Returns a zero-filled ten-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape10D ): Array10D; - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param shape - array shape -* @returns output array -* -* @example -* var out = zerosnd( [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 ] ); -* // returns [ [ [ [ [ [ [ [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] ] ] ] ] ] ] -*/ -declare function zerosnd( shape: Shape ): Array; - - -// EXPORTS // - -export = zerosnd; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index d87b9f3..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index 2f58faf..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 99281cd..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 55055554bfdfb0391f4d1f6d456aa86b53314ea0 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Apr 2025 00:59:38 +0000 Subject: [PATCH 105/105] Auto-generated commit --- .editorconfig | 180 - .eslintrc.js | 1 - .gitattributes | 66 - .github/.keepalive | 1 - .github/PULL_REQUEST_TEMPLATE.md | 7 - .github/workflows/benchmark.yml | 64 - .github/workflows/cancel.yml | 57 - .github/workflows/close_pull_requests.yml | 54 - .github/workflows/examples.yml | 64 - .github/workflows/npm_downloads.yml | 112 - .github/workflows/productionize.yml | 794 --- .github/workflows/publish.yml | 252 - .github/workflows/test.yml | 99 - .github/workflows/test_bundles.yml | 186 - .github/workflows/test_coverage.yml | 133 - .github/workflows/test_install.yml | 85 - .github/workflows/test_published_package.yml | 105 - .gitignore | 194 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 172 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 47 +- SECURITY.md | 5 - benchmark/benchmark.size.2d.js | 96 - benchmark/benchmark.size.3d.js | 96 - benchmark/benchmark.size.4d.js | 95 - benchmark/benchmark.size.5d.js | 95 - branches.md | 56 - dist/index.d.ts | 3 - dist/index.js | 5 - dist/index.js.map | 7 - docs/repl.txt | 22 - docs/types/test.ts | 48 - examples/index.js | 41 - docs/types/index.d.ts => index.d.ts | 2 +- index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 40 - lib/main.js | 49 - package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4870 insertions(+), 4849 deletions(-) delete mode 100644 .editorconfig delete mode 100644 .eslintrc.js delete mode 100644 .gitattributes delete mode 100644 .github/.keepalive delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/workflows/benchmark.yml delete mode 100644 .github/workflows/cancel.yml delete mode 100644 .github/workflows/close_pull_requests.yml delete mode 100644 .github/workflows/examples.yml delete mode 100644 .github/workflows/npm_downloads.yml delete mode 100644 .github/workflows/productionize.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_bundles.yml delete mode 100644 .github/workflows/test_coverage.yml delete mode 100644 .github/workflows/test_install.yml delete mode 100644 .github/workflows/test_published_package.yml delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 .npmrc delete mode 100644 CHANGELOG.md delete mode 100644 CITATION.cff delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Makefile delete mode 100644 SECURITY.md delete mode 100644 benchmark/benchmark.size.2d.js delete mode 100644 benchmark/benchmark.size.3d.js delete mode 100644 benchmark/benchmark.size.4d.js delete mode 100644 benchmark/benchmark.size.5d.js delete mode 100644 branches.md delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 docs/repl.txt delete mode 100644 docs/types/test.ts delete mode 100644 examples/index.js rename docs/types/index.d.ts => index.d.ts (98%) create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index dab5d2a..0000000 --- a/.editorconfig +++ /dev/null @@ -1,180 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# 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/.keepalive b/.github/.keepalive deleted file mode 100644 index dfcab3f..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2025-04-14T00:47:31.592Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index b5c8ef8..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,7 +0,0 @@ - - -We are excited about your pull request, but unfortunately we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. - -If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. You may also consult the [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) for help on developing stdlib. - -We look forward to receiving your contribution! :smiley: \ No newline at end of file diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index e4f10fe..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: benchmark - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run benchmarks: - benchmark: - - # Define a display name: - name: 'Run benchmarks' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run benchmarks: - - name: 'Run benchmarks' - run: | - npm run benchmark diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml deleted file mode 100644 index b5291db..0000000 --- a/.github/workflows/cancel.yml +++ /dev/null @@ -1,57 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: cancel - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to cancel existing workflow runs: - cancel: - - # Define a display name: - name: 'Cancel workflow runs' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Time limit: - timeout-minutes: 3 - - # Define the sequence of job steps... - steps: - - # Cancel existing workflow runs: - - name: 'Cancel existing workflow runs' - # Pin action to full length commit SHA - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # v0.12.1 - with: - workflow_id: >- - benchmark.yml, - examples.yml, - test.yml, - test_coverage.yml, - test_install.yml, - publish.yml - access_token: ${{ github.token }} diff --git a/.github/workflows/close_pull_requests.yml b/.github/workflows/close_pull_requests.yml deleted file mode 100644 index ed2f8cc..0000000 --- a/.github/workflows/close_pull_requests.yml +++ /dev/null @@ -1,54 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: close_pull_requests - -# Workflow triggers: -on: - pull_request_target: - types: [opened] - -# Workflow jobs: -jobs: - - # Define job to close all pull requests: - run: - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Close pull request - - name: 'Close pull request' - # Pin action to full length commit SHA corresponding to v3.1.2 - uses: superbrothers/close-pull-request@9c18513d320d7b2c7185fb93396d0c664d5d8448 - with: - comment: | - Thank you for submitting a pull request. :raised_hands: - - We greatly appreciate your willingness to submit a contribution. However, we are not accepting pull requests against this repository, as all development happens on the [main project repository](https://github.com/stdlib-js/stdlib). - - We kindly request that you submit this pull request against the [respective directory](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd) of the main repository where we’ll review and provide feedback. If this is your first stdlib contribution, be sure to read the [contributing guide](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) which provides guidelines and instructions for submitting contributions. - - Thank you again, and we look forward to receiving your contribution! :smiley: - - Best, - The stdlib team \ No newline at end of file diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml deleted file mode 100644 index 2984901..0000000 --- a/.github/workflows/examples.yml +++ /dev/null @@ -1,64 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2021 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: examples - -# Workflow triggers: -on: - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job to run the package examples... - examples: - - # Define display name: - name: 'Run examples' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - - # Checkout repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Run examples: - - name: 'Run examples' - run: | - npm run examples diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml deleted file mode 100644 index 1d90f1d..0000000 --- a/.github/workflows/npm_downloads.yml +++ /dev/null @@ -1,112 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: npm_downloads - -# Workflow triggers: -on: - # Run this workflow weekly: - schedule: - # cron: ' ' - - cron: '26 14 * * 5' - - # Allow the workflow to be manually run: - workflow_dispatch: - -# Workflow jobs: -jobs: - - # Define a job for retrieving npm download counts... - npm_downloads: - - # Define display name: - name: 'Retrieve npm download counts' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - timeout-minutes: 10 - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Resolve package name: - - name: 'Resolve package name' - id: package_name - run: | - name=`node -e 'console.log(require("./package.json").name)' | tr -d '\n'` - echo "package_name=$name" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Fetch download data: - - name: 'Fetch data' - id: download_data - run: | - url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}" - echo "$url" - data=$(curl "$url") - mkdir ./tmp - echo "$data" > ./tmp/npm_downloads.json - echo "data=$data" >> $GITHUB_OUTPUT - timeout-minutes: 5 - - # Print summary of download data: - - name: 'Print summary' - run: | - echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY - echo "|------|------------|" >> $GITHUB_STEP_SUMMARY - cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY - - # Upload the download data: - - name: 'Upload data' - # Pin action to full length commit SHA - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 - with: - # Define a name for the uploaded artifact (ensuring a unique name for each job): - name: npm_downloads - - # Specify the path to the file to upload: - path: ./tmp/npm_downloads.json - - # Specify the number of days to retain the artifact (default is 90 days): - retention-days: 90 - timeout-minutes: 10 - if: success() - - # Send data to events server: - - name: 'Post data' - # Pin action to full length commit SHA - uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629 # v3.0.3 - env: - webhook_url: ${{ secrets.STDLIB_NPM_DOWNLOADS_URL }} - webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }} - data: '{ "downloads": ${{ steps.download_data.outputs.data }} }' - timeout-minutes: 5 - if: success() diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml deleted file mode 100644 index f4575e9..0000000 --- a/.github/workflows/productionize.yml +++ /dev/null @@ -1,794 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2022 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Workflow name: -name: productionize - -# Workflow triggers: -on: - # Run workflow when a new commit is pushed to the main branch: - push: - branches: - - main - - # Allow the workflow to be manually run: - workflow_dispatch: - inputs: - require-passing-tests: - description: 'Require passing tests for creating bundles' - type: boolean - default: true - - # Run workflow upon completion of `publish` workflow run: - workflow_run: - workflows: ["publish"] - types: [completed] - - -# Concurrency group to prevent multiple concurrent executions: -concurrency: - group: productionize - cancel-in-progress: true - -# Workflow jobs: -jobs: - - # Define a job to create a production build... - productionize: - - # Define display name: - name: 'Productionize' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Define the sequence of job steps... - steps: - # Checkout main branch of repository: - - name: 'Checkout main branch' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - ref: main - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Create production branch: - - name: 'Create production branch' - run: | - git checkout -b production - - # Transform error messages: - - name: 'Transform error messages' - id: transform-error-messages - uses: stdlib-js/transform-errors-action@main - - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - - name: 'Update dependencies in package.json' - run: | - PKG_VERSION=$(npm view @stdlib/error-tools-fmtprodmsg version) - if grep -q '"@stdlib/string-format"' package.json; then - sed -i "s/\"@stdlib\/string-format\": \"^.*\"/\"@stdlib\/error-tools-fmtprodmsg\": \"^$PKG_VERSION\"/g" package.json - else - 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' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Transform error messages" - - # Push changes: - - name: 'Push changes' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" production --force - - # Define a job for running tests of the productionized code... - test: - - # Define a display name: - name: 'Run Tests' - - # Define the type of virtual host machine: - runs-on: 'ubuntu-latest' - - # Indicate that this job depends on the prior job finishing: - needs: productionize - - # Run this job regardless of the outcome of the prior job: - if: always() - - # Define the sequence of job steps... - steps: - - # Checkout the repository: - - name: 'Checkout repository' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - with: - # Use the `production` branch: - ref: production - - # Install Node.js: - - name: 'Install Node.js' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Build native add-on if present: - - name: 'Build native add-on (if present)' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - run: | - if [ -f "binding.gyp" ]; then - npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild - fi - - # Run tests: - - name: 'Run tests' - if: ${{ github.event.inputs.require-passing-tests == 'true' }} - id: tests - run: | - npm test || npm test || npm test - - # Define job to create a bundle for use in Deno... - deno: - - # Define display name: - name: 'Create Deno bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `deno` branch exists: - - name: 'Check if remote `deno` branch exists' - id: deno-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin deno - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `deno` exists, delete everything in branch and merge `production` into it - - name: 'If `deno` exists, delete everything in branch and merge `production` into it' - if: steps.deno-branch-exists.outputs.remote-exists - run: | - git checkout -b deno origin/deno - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `deno` does not exist, create `deno` branch: - - name: 'If `deno` does not exist, create `deno` branch' - if: ${{ steps.deno-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b deno - - # Copy files to deno directory: - - name: 'Copy files to deno directory' - run: | - mkdir -p deno - cp README.md LICENSE CONTRIBUTORS NOTICE ./deno - - # Copy TypeScript definitions to deno directory: - if [ -d index.d.ts ]; then - cp index.d.ts ./deno/index.d.ts - fi - if [ -e ./docs/types/index.d.ts ]; then - cp ./docs/types/index.d.ts ./deno/mod.d.ts - fi - - # Install Node.js: - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: Install production and development dependencies - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Bundle package for use in Deno: - - name: 'Bundle package for Deno' - id: deno-bundle - uses: stdlib-js/bundle-action@main - with: - target: 'deno' - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - # Replace links to other packages with links to the deno branch: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/deno/"; - - # Replace reference to `@stdlib/types` with CDN link: - find ./deno -type f -name '*.ts' -print0 | xargs -0 -r sed -Ei "s/\/\/\/ /\/\/\/ /g" - - # Change wording of project description to avoid reference to JavaScript and Node.js: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "s/a standard library for JavaScript and Node.js, /a standard library /g" - - # Rewrite all `require()`s to use jsDelivr links: - find ./deno -type f -name '*.md' -print0 | xargs -0 sed -Ei "/require\( '@stdlib\// { - s/(var|let|const)\s+([a-z0-9_]+)\s+=\s*require\( '([^']+)' \);/import \2 from \'\3\';/i - s/@stdlib/https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js/ - s/';/@deno\/mod.js';/ - }" - - # Rewrite first `import` to show importing of named exports if available: - exports=$(cat lib/index.js | \ - grep -E 'setReadOnly\(.*,.*,.*\)' | \ - sed -E 's/setReadOnly\((.*),(.*),(.*)\);/\2/' | \ - sed -E "s/'//g" | \ - sort) - if [ -n "$exports" ]; then - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\nimport\s+([a-zA-Z0-9_]+)\s+from\s*'([^']+)';\n\`\`\`/\`\`\`javascript\nimport \1 from '\2';\n\`\`\`\n\nYou can also import the following named exports from the package:\n\n\`\`\`javascript\nimport { $(echo $exports | sed -E 's/ /, /g') } from '\2';\n\`\`\`/" - fi - - # Remove `installation`, `cli`, and `c` sections: - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./deno -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Create package.json file for deno branch: - jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "type": "module", "main": "./mod.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./deno/package.json - - # Delete everything in current directory aside from deno folder: - - name: 'Delete everything in current directory aside from deno folder' - run: | - find . -type 'f' | grep -v -e "deno" -e ".git/" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e "deno" -e ".git" | xargs -r rm -rf - - # Move deno directory to root: - - name: 'Move deno directory to root' - run: | - mv ./deno/* . - rmdir ./deno - - # Commit changes: - - name: 'Commit changes' - run: | - git add -A - git commit -m "Auto-generated commit" - - # Push changes to `deno` branch: - - name: 'Push changes to `deno` branch' - run: | - SLUG=${{ github.repository }} - echo "Pushing changes to $SLUG..." - git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" deno - - # Send status to Slack channel if job fails: - - name: 'Send status to Slack channel in case of failure' - # Pin action to full length commit SHA - uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2 - with: - status: ${{ job.status }} - channel: '#npm-ci' - if: failure() - - # Define job to create a UMD bundle... - umd: - - # Define display name: - name: 'Create UMD bundle' - - # Define the type of virtual host machine on which to run the job: - runs-on: ubuntu-latest - - # Indicate that this job depends on the test job finishing: - needs: test - - # Define the sequence of job steps... - steps: - # Checkout the repository: - - name: 'Checkout repository' - # Pin action to full length commit SHA - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Configure Git: - - name: 'Configure Git' - run: | - git config --local user.email "noreply@stdlib.io" - git config --local user.name "stdlib-bot" - - # Check if remote `umd` branch exists: - - name: 'Check if remote `umd` branch exists' - id: umd-branch-exists - continue-on-error: true - run: | - git fetch --all - git ls-remote --exit-code --heads origin umd - if [ $? -eq 0 ]; then - echo "remote-exists=true" >> $GITHUB_OUTPUT - else - echo "remote-exists=false" >> $GITHUB_OUTPUT - fi - - # If `umd` exists, delete everything in branch and merge `production` into it - - name: 'If `umd` exists, delete everything in branch and merge `production` into it' - if: steps.umd-branch-exists.outputs.remote-exists - run: | - git checkout -b umd origin/umd - - find . -type 'f' | grep -v -e ".git/" -e "package.json" -e "README.md" -e "LICENSE" -e "CONTRIBUTORS" -e "NOTICE" | xargs -r rm - find . -mindepth 1 -type 'd' | grep -v -e ".git" | xargs -r rm -rf - - git add -A - git commit -m "Remove files" --allow-empty - - git config merge.theirs.name 'simulate `-s theirs`' - git config merge.theirs.driver 'cat %B > %A' - GIT_CONFIG_PARAMETERS="'merge.default=theirs'" git merge origin/production --allow-unrelated-histories - - # Copy files from `production` branch if necessary: - git checkout origin/production -- . - if [ -n "$(git status --porcelain)" ]; then - git add -A - git commit -m "Auto-generated commit" - fi - - # If `umd` does not exist, create `umd` branch: - - name: 'If `umd` does not exist, create `umd` branch' - if: ${{ steps.umd-branch-exists.outputs.remote-exists == false }} - run: | - git checkout production - git checkout -b umd - - # Copy files to umd directory: - - name: 'Copy files to umd directory' - run: | - mkdir -p umd - cp README.md LICENSE CONTRIBUTORS NOTICE ./umd - - # Install Node.js - - name: 'Install Node.js' - # Pin action to full length commit SHA - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 - with: - node-version: 20 - timeout-minutes: 5 - - # Install dependencies: - - name: 'Install production and development dependencies' - id: install - run: | - npm install || npm install || npm install - timeout-minutes: 15 - - # Extract alias: - - name: 'Extract alias' - id: extract-alias - run: | - alias=$(grep -E 'require\(' README.md | head -n 1 | sed -E 's/^var ([a-zA-Z0-9_]+) = .+/\1/') - echo "alias=${alias}" >> $GITHUB_OUTPUT - - # Create Universal Module Definition (UMD) Node.js bundle: - - name: 'Create Universal Module Definition (UMD) Node.js bundle' - id: umd-bundle-node - uses: stdlib-js/bundle-action@main - with: - target: 'umd-node' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Create Universal Module Definition (UMD) browser bundle: - - name: 'Create Universal Module Definition (UMD) browser bundle' - id: umd-bundle-browser - uses: stdlib-js/bundle-action@main - with: - target: 'umd-browser' - alias: ${{ steps.extract-alias.outputs.alias }} - - # Rewrite file contents: - - name: 'Rewrite file contents' - run: | - - # Replace links to other packages with links to the umd branch: - find ./umd -type f -name '*.md' -print0 | xargs -0 sed -Ei "/\/tree\/main/b; /^\[@stdlib[^:]+: https:\/\/github.com\/stdlib-js\// s/(.*)/\\1\/tree\/umd/"; - - # Remove `installation`, `cli`, and `c` sections: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/
[^<]+<\/section>//g;" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.cli \-\->//g" - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?
[\s\S]+<\!\-\- \/.c \-\->//g" - - # Rewrite first `require()` to show consumption of the UMD bundle in Observable and via a `script` tag: - find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/\`\`\`javascript\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);\n\`\`\`/To use in Observable,\n\n\`\`\`javascript\n\2 = require\( 'https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/browser.js' \)\n\`\`\`\n\nTo vendor stdlib functionality and avoid installing dependency trees for Node.js, you can use the UMD server build:\n\n\`\`\`javascript\nvar \2 = require\( 'path\/to\/vendor\/umd\/\3\/index.js' \)\n\`\`\`\n\nTo include the bundle in a webpage,\n\n\`\`\`html\n + + ```
@@ -161,7 +152,7 @@ out = zerosnd( [ 1, 1, 1, 3 ] ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -226,17 +217,17 @@ Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors]. -[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros +[@stdlib/array/base/zeros]: https://github.com/stdlib-js/array-base-zeros/tree/esm -[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd +[@stdlib/array/base/onesnd]: https://github.com/stdlib-js/array-base-onesnd/tree/esm -[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d +[@stdlib/array/base/zeros2d]: https://github.com/stdlib-js/array-base-zeros2d/tree/esm -[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d +[@stdlib/array/base/zeros3d]: https://github.com/stdlib-js/array-base-zeros3d/tree/esm -[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d +[@stdlib/array/base/zeros4d]: https://github.com/stdlib-js/array-base-zeros4d/tree/esm -[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d +[@stdlib/array/base/zeros5d]: https://github.com/stdlib-js/array-base-zeros5d/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.size.2d.js b/benchmark/benchmark.size.2d.js deleted file mode 100644 index c02cf25..0000000 --- a/benchmark/benchmark.size.2d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var sqrt = require( '@stdlib/math-base-special-sqrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( sqrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::2d,equidimensional:size='+(N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.3d.js b/benchmark/benchmark.size.3d.js deleted file mode 100644 index 88ab297..0000000 --- a/benchmark/benchmark.size.3d.js +++ /dev/null @@ -1,96 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var cbrt = require( '@stdlib/math-base-special-cbrt' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( cbrt( pow( 10, i ) ) ); - - f = createBenchmark( N ); - bench( pkg+'::3d,equidimensional:size='+(N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.4d.js b/benchmark/benchmark.size.4d.js deleted file mode 100644 index f288709..0000000 --- a/benchmark/benchmark.size.4d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/4.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::4d,equidimensional:size='+(N*N*N*N), f ); - } -} - -main(); diff --git a/benchmark/benchmark.size.5d.js b/benchmark/benchmark.size.5d.js deleted file mode 100644 index f2aec73..0000000 --- a/benchmark/benchmark.size.5d.js +++ /dev/null @@ -1,95 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var floor = require( '@stdlib/math-base-special-floor' ); -var isArrayArray = require( '@stdlib/assert-is-array-array' ); -var pkg = require( './../package.json' ).name; -var zerosnd = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} N - array lengths -* @returns {Function} benchmark function -*/ -function createBenchmark( N ) { - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = zerosnd( [ N, N, N, N, N ] ); - if ( typeof out !== 'object' ) { - b.fail( 'should return an array of arrays' ); - } - } - b.toc(); - if ( !isArrayArray( out ) ) { - b.fail( 'should return an array of arrays' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var min; - var max; - var N; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - N = floor( pow( pow( 10, i ), 1.0/5.0 ) ); - - f = createBenchmark( N ); - bench( pkg+'::5d,equidimensional:size='+(N*N*N*N*N), f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 16a6ad2..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd" -%% click B href "https://github.com/stdlib-js/array-base-zerosnd/tree/main" -%% click C href "https://github.com/stdlib-js/array-base-zerosnd/tree/production" -%% click D href "https://github.com/stdlib-js/array-base-zerosnd/tree/esm" -%% click E href "https://github.com/stdlib-js/array-base-zerosnd/tree/deno" -%% click F href "https://github.com/stdlib-js/array-base-zerosnd/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/zerosnd -[production-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/production -[deno-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-base-zerosnd/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-base-zerosnd/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 624624e..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -import zerosnd from '../docs/types/index'; -export = zerosnd; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index d05b1f2..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var i=s(function(c,t){ -var n=require('@stdlib/array-base-fillednd/dist');function u(e){return n(0,e)}t.exports=u -});var o=i();module.exports=o; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f5163bc..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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 fillednd = require( '@stdlib/array-base-fillednd' );\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nmodule.exports = zerosnd;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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* Create a zero-filled n-dimensional nested array.\n*\n* @module @stdlib/array-base-zerosnd\n*\n* @example\n* var zerosnd = require( '@stdlib/array-base-zerosnd' );\n*\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,QAAS,6BAA8B,EAmBtD,SAASC,EAASC,EAAQ,CACzB,OAAOF,EAAU,EAAKE,CAAM,CAC7B,CAKAH,EAAO,QAAUE,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "fillednd", "zerosnd", "shape", "main"] -} diff --git a/docs/repl.txt b/docs/repl.txt deleted file mode 100644 index f580d1f..0000000 --- a/docs/repl.txt +++ /dev/null @@ -1,22 +0,0 @@ - -{{alias}}( shape ) - Returns a zero-filled n-dimensional nested array. - - Parameters - ---------- - shape: Array - Array shape. - - Returns - ------- - out: Array - Output array. - - Examples - -------- - > var out = {{alias}}( [ 1, 3 ] ) - [ [ 0.0, 0.0, 0.0 ] ] - - See Also - -------- - diff --git a/docs/types/test.ts b/docs/types/test.ts deleted file mode 100644 index 5e604f6..0000000 --- a/docs/types/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import zerosnd = require( './index' ); - - -// TESTS // - -// The function returns a nested array... -{ - zerosnd( [ 3 ] ); // $ExpectType Array1D - zerosnd( [ 1, 3 ] ); // $ExpectType Array2D - zerosnd( [ 1, 1, 3 ] ); // $ExpectType Array3D - zerosnd( [ 1, 1, 1, 3 ] ); // $ExpectType Array4D - zerosnd( [ 1, 1, 1, 1, 3 ] ); // $ExpectType Array5D -} - -// The compiler throws an error if the function is provided a first argument which is not an array of numbers... -{ - zerosnd( 'abc' ); // $ExpectError - zerosnd( true ); // $ExpectError - zerosnd( false ); // $ExpectError - zerosnd( null ); // $ExpectError - zerosnd( [ '1' ] ); // $ExpectError - zerosnd( {} ); // $ExpectError - zerosnd( ( x: number ): number => x ); // $ExpectError -} - -// The compiler throws an error if the function is provided an unsupported number of arguments... -{ - zerosnd(); // $ExpectError - zerosnd( [ 1, 3 ], 2 ); // $ExpectError -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 0dc47e1..0000000 --- a/examples/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var zerosnd = require( './../lib' ); - -var out = zerosnd( [ 1, 3 ] ); -console.log( out ); -// => [ [ 0.0, 0.0, 0.0 ] ] - -out = zerosnd( [ 3, 1 ] ); -console.log( out ); -// => [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] - -out = zerosnd( [ 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ 0.0, 0.0, 0.0 ] ] ] - -out = zerosnd( [ 1, 3, 1 ] ); -console.log( out ); -// => [ [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ] ] - -out = zerosnd( [ 1, 1, 1, 3 ] ); -console.log( out ); -// => [ [ [ [ 0.0, 0.0, 0.0 ] ] ] ] diff --git a/docs/types/index.d.ts b/index.d.ts similarity index 98% rename from docs/types/index.d.ts rename to index.d.ts index 6ac1768..f487d37 100644 --- a/docs/types/index.d.ts +++ b/index.d.ts @@ -18,7 +18,7 @@ // TypeScript Version: 4.1 -/// +/// import { Shape } from '@stdlib/types/ndarray'; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..d87b9f3 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import e from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-fillednd@v0.2.2-esm/index.mjs";function t(t){return e(0,t)}export{t as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..2f58faf --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 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\nimport fillednd from '@stdlib/array-base-fillednd';\n\n\n// MAIN //\n\n/**\n* Returns a zero-filled n-dimensional nested array.\n*\n* @param {NonNegativeIntegerArray} shape - array shape\n* @returns {Array} filled array\n*\n* @example\n* var out = zerosnd( [ 3 ] );\n* // returns [ 0.0, 0.0, 0.0 ]\n*\n* @example\n* var out = zerosnd( [ 1, 3 ] );\n* // returns [ [ 0.0, 0.0, 0.0 ] ]\n*/\nfunction zerosnd( shape ) {\n\treturn fillednd( 0.0, shape );\n}\n\n\n// EXPORTS //\n\nexport default zerosnd;\n"],"names":["zerosnd","shape","fillednd"],"mappings":";;8FAyCA,SAASA,EAASC,GACjB,OAAOC,EAAU,EAAKD,EACvB"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 996b500..0000000 --- a/lib/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Create a zero-filled n-dimensional nested array. -* -* @module @stdlib/array-base-zerosnd -* -* @example -* var zerosnd = require( '@stdlib/array-base-zerosnd' ); -* -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 013c25e..0000000 --- a/lib/main.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var fillednd = require( '@stdlib/array-base-fillednd' ); - - -// MAIN // - -/** -* Returns a zero-filled n-dimensional nested array. -* -* @param {NonNegativeIntegerArray} shape - array shape -* @returns {Array} filled array -* -* @example -* var out = zerosnd( [ 3 ] ); -* // returns [ 0.0, 0.0, 0.0 ] -* -* @example -* var out = zerosnd( [ 1, 3 ] ); -* // returns [ [ 0.0, 0.0, 0.0 ] ] -*/ -function zerosnd( shape ) { - return fillednd( 0.0, shape ); -} - - -// EXPORTS // - -module.exports = zerosnd; diff --git a/package.json b/package.json index c16df3e..68470f3 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.2.2", "description": "Create a zero-filled n-dimensional nested array.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,37 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-fillednd": "^0.2.2", - "@stdlib/types": "^0.4.3", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/assert-is-array-array": "^0.2.2", - "@stdlib/math-base-special-cbrt": "^0.2.2", - "@stdlib/math-base-special-floor": "^0.2.3", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/math-base-special-sqrt": "^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.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -90,4 +36,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..99281cd --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 0b36573..0000000 --- a/test/test.js +++ /dev/null @@ -1,616 +0,0 @@ -/** -* @license Apache-2.0 -* -* 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. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var zerosnd = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof zerosnd, 'function', 'main export is a function' ); - t.end(); -}); - -tape( 'the function returns a filled nested array (0d)', function test( t ) { - var expected; - var actual; - - expected = []; - actual = zerosnd( [] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (1d)', function test( t ) { - var expected; - var actual; - - expected = [ 0.0, 0.0, 0.0 ]; - actual = zerosnd( [ 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [ 0.0, 0.0, 0.0 ] ]; - actual = zerosnd( [ 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0 ], [ 0.0 ], [ 0.0 ] ]; - actual = zerosnd( [ 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ 0.0, 0.0 ], [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]; - actual = zerosnd( [ 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (3d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ]; - actual = zerosnd( [ 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ]; - actual = zerosnd( [ 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns a filled nested array', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ - [ 0.0, 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ], - [ - [ - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ], - [ - [ 0.0 ], - [ 0.0 ], - [ 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 2, 1, 2, 3, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ], - [ - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ], - [ - [ 0.0, 0.0 ], - [ 0.0, 0.0 ], - [ 0.0, 0.0 ] - ] - ] - ] - ]; - actual = zerosnd( [ 1, 2, 2, 3, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty array if provided a shape having a first element equal to zero (1d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (2d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (3d)', function test( t ) { - var expected; - var actual; - - expected = [ [ [] ] ]; - actual = zerosnd( [ 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [] ] ]; - actual = zerosnd( [ 1, 2, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [ [], [], [] ] ]; - actual = zerosnd( [ 1, 3, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (4d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns an empty outer array if provided a shape having a first element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = []; - - actual = zerosnd( [ 0, 1, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 0, 0, 0, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - actual = zerosnd( [ 0, 100, 100, 100, 100 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a second element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ [] ]; - actual = zerosnd( [ 1, 0, 1, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [] ]; - actual = zerosnd( [ 2, 0, 2, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ [], [], [] ]; - actual = zerosnd( [ 3, 0, 3, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a third element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [] - ] - ]; - actual = zerosnd( [ 1, 1, 0, 1, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [] - ] - ]; - actual = zerosnd( [ 1, 2, 0, 2, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [], - [], - [] - ] - ]; - actual = zerosnd( [ 1, 3, 0, 3, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fourth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 0, 1 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 0, 2 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [] ], - [ [] ], - [ [] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 0, 3 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -}); - -tape( 'the function returns empty inner arrays if provided a shape having a fifth element equal to zero (5d)', function test( t ) { - var expected; - var actual; - - expected = [ - [ - [ - [ [] ] - ] - ] - ]; - actual = zerosnd( [ 1, 1, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 2, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - expected = [ - [ - [ [ [] ] ], - [ [ [] ] ], - [ [ [] ] ] - ] - ]; - actual = zerosnd( [ 1, 3, 1, 1, 0 ] ); - t.deepEqual( actual, expected, 'returns expected value' ); - - t.end(); -});