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 fd6f4913f6722a6ede81f6ac8e9e2598e7cc2a8f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Aug 2023 05:46:04 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6189 insertions(+), 4409 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 f919dc24c6c0de4da5a308720b058b80e479aaf1 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Aug 2023 06:37:50 +0000 Subject: [PATCH 004/105] Remove files --- mod.d.ts | 260 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6442 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1a3fe0b..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 21aaad4ca2d95a7e70a8a82edc2064480f91a667 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Aug 2023 06:38:38 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6189 insertions(+), 4409 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 cda9a39e45f26bf0621a86a5dfab592ca656dfe8 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 17 Aug 2023 02:40:22 +0000 Subject: [PATCH 007/105] Remove files --- mod.d.ts | 260 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6442 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1a3fe0b..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From ee3b9468ac57ca977720cd931a2878c231e1d4f4 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 17 Aug 2023 02:41:07 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6189 insertions(+), 4409 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 c61ab87193a5ac33237e8ec26f907e8b8b9280d7 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 24 Aug 2023 22:02:18 +0000 Subject: [PATCH 010/105] Remove files --- mod.d.ts | 260 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6442 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 9d96412..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From b2ebe81a4097824a3a6cbb3319c46f7cbf55f30d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 24 Aug 2023 22:02:59 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6189 insertions(+), 4409 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 e6dd141783a30ffa71b18c477070268fc88f8eee Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 25 Aug 2023 00:31:34 +0000 Subject: [PATCH 013/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index bfa87ec..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 3c4c5eeefaaee3d862467fc5703f942e6ebad46d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 25 Aug 2023 00:32:21 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 42 files changed, 6189 insertions(+), 4409 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 3871ef922b60dd73bbb721aa338e69fd469f6784 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 25 Aug 2023 00:32:40 +0000 Subject: [PATCH 015/105] Update README.md for Deno bundle v0.0.1 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 84eef74..5f6927d 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@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.0.1-deno/mod.js'; ``` #### zerosnd( shape ) @@ -85,7 +85,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.0.1-deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From 2422d786f2f97a51a94326737b274ce29eec5d80 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 25 Aug 2023 00:32:41 +0000 Subject: [PATCH 016/105] Auto-generated commit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f6927d..e04cbd1 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ limitations under the License. ## Usage +```javascript +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +``` +The previous example will load the latest bundled code from the deno branch. Alternatively, you may load a specific version by loading the file from one of the [tagged bundles](https://github.com/stdlib-js/array-base-zerosnd/tags). For example, + ```javascript import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.0.1-deno/mod.js'; ``` @@ -85,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.0.1-deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From 72393a4b584e4eefbca489cabd66b4beda348bc2 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 24 Sep 2023 15:35:03 +0000 Subject: [PATCH 017/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 342a6e5..b050c80 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.0" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.0", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 76755623cb3d39edcadac373058196f984369312 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 24 Sep 2023 15:47:05 +0000 Subject: [PATCH 018/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index bfa87ec..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From e29a8670bad5e8079801323a7834bed5d615c280 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 24 Sep 2023 15:47:58 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/test.js | 616 -- 43 files changed, 6189 insertions(+), 4444 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 03144e465758683ecf0f7e2a28d7dd1024caa71d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 24 Sep 2023 15:54:17 +0000 Subject: [PATCH 020/105] Update README.md for Deno bundle v0.1.0 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e03d588..c22d325 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@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.1.0-deno/mod.js'; ``` #### zerosnd( shape ) @@ -85,7 +85,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.1.0-deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From 11bbff93a84851ef56103b6dac18a89354c30f70 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 24 Sep 2023 15:54:18 +0000 Subject: [PATCH 021/105] Auto-generated commit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c22d325..78d7225 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ limitations under the License. ## Usage +```javascript +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +``` +The previous example will load the latest bundled code from the deno branch. Alternatively, you may load a specific version by loading the file from one of the [tagged bundles](https://github.com/stdlib-js/array-base-zerosnd/tags). For example, + ```javascript import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.1.0-deno/mod.js'; ``` @@ -85,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.1.0-deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From 2232b582f75227d94426af1713b7b9f4d93eee6b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Oct 2023 16:20:03 +0000 Subject: [PATCH 022/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 342a6e5..b050c80 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.0" }, "devDependencies": { "@stdlib/assert-is-array-array": "^0.1.0", @@ -89,4 +90,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From f8e28db9ae73c3e003990385d18a0a71f1db4851 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 3 Oct 2023 01:08:38 +0000 Subject: [PATCH 023/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index bfa87ec..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 406647ea5421b14d506551235a20c4533a4aff6c Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 3 Oct 2023 01:09:44 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 616 -- test/test.js | 616 -- 45 files changed, 6189 insertions(+), 5119 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 bcbec3f274cf5ab41f706bad2901f56e61130e25 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 7 Oct 2023 02:16:06 +0000 Subject: [PATCH 026/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index bfa87ec..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 7475cf2ff4d852457277562136fb8cde90a7c14a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 7 Oct 2023 02:16:57 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 616 -- test/test.js | 616 -- 44 files changed, 6189 insertions(+), 5118 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 b9f9dc7461621b59aaee0537e37699626e304d0d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 3 Nov 2023 01:27:10 +0000 Subject: [PATCH 029/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index bfa87ec..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 04dcbfc125f44d1aed44fa187b560c2c12de16f6 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 3 Nov 2023 01:27:52 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 45 files changed, 6189 insertions(+), 4544 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 9d6425f4d6d3c3759e33bac188a23353de2fbafb Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 15:13:36 +0000 Subject: [PATCH 032/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index bfa87ec..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 4161a32cdfccc48ec7b5ac0dca98d0988faef424 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 15:14:16 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 44 files changed, 6189 insertions(+), 4543 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 15e2ce6ef8d08faa15d81d21693341ad31e90841 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Nov 2023 21:32:55 +0000 Subject: [PATCH 035/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 54c7618..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 0ea897dbe8dc2da1fe2f35ded7a8ebbd5df4633b 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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 44 files changed, 6189 insertions(+), 4543 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 09a34fafab225f827fde30da23091a97facf7a84 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 2 Dec 2023 11:11:25 +0000 Subject: [PATCH 038/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 4686b99aa9044b6f77acd1eb06e90d2d88798fb5 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 2 Dec 2023 11:12:09 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 45 files changed, 6189 insertions(+), 4539 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 c24d5e49ed1d3160e6bdbde4493419ae03c6424b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Jan 2024 14:29:24 +0000 Subject: [PATCH 041/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 4019faa..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 2767226e1f7d063504614215b82e520deecdc043 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Jan 2024 14:29:41 +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 | 22 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 46 files changed, 6189 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 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 6c6f712a3349333c3f6a2e82e9b3cb775cf8b45a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Feb 2024 13:42:41 +0000 Subject: [PATCH 044/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From adafdc87ffdb8de562a7891a778b14cafe7dd37e Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Feb 2024 13:43:02 +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 | 24 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 46 files changed, 6189 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 f8a75cfa8a53641b3b457c223e68c459f8fae6d3 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 15 Feb 2024 02:26:59 +0000 Subject: [PATCH 047/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 181c22f9244456a2d3226ab0ee90d61df75d0392 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 15 Feb 2024 02:27:14 +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 | 24 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 6177 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 -- 45 files changed, 6189 insertions(+), 4553 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 168f80c9eb59b88ae9cc31a0f18b3d048e780e94 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 15 Feb 2024 04:10:57 +0000 Subject: [PATCH 049/105] Update README.md for Deno bundle v0.2.0 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e67376e..3f0e729 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@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.0-deno/mod.js'; ``` #### zerosnd( shape ) @@ -85,7 +85,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.0-deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From abc6478cff49513e426ed950fa929140d3dd69bc Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 15 Feb 2024 04:10:57 +0000 Subject: [PATCH 050/105] Auto-generated commit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f0e729..4edeb74 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ limitations under the License. ## Usage +```javascript +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +``` +The previous example will load the latest bundled code from the deno branch. Alternatively, you may load a specific version by loading the file from one of the [tagged bundles](https://github.com/stdlib-js/array-base-zerosnd/tags). For example, + ```javascript import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.0-deno/mod.js'; ``` @@ -85,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.0-deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From f7addff1e4ac489cc9f69c7f007a1719e49c6a9f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 25 Feb 2024 02:04:30 +0000 Subject: [PATCH 051/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d004bae..6050ed5 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 cb03faa9faf8e32258d0f99e69248f2e3a05d286 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 25 Feb 2024 07:12:46 +0000 Subject: [PATCH 052/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 6177 ---------------------------------------------------- 4 files changed, 6441 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 4c692fa4463f9ea6d90bcdab93cd68c32bb52cc7 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 25 Feb 2024 07:13:06 +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 | 24 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4854 insertions(+), 4547 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 04e63ab4f737e466b1923d68e5659f89858c8917 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 25 Feb 2024 07:43:55 +0000 Subject: [PATCH 054/105] Update README.md for Deno bundle v0.2.1 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 605f7c2..ffe4130 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@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.1-deno/mod.js'; ``` #### zerosnd( shape ) @@ -85,7 +85,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.1-deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From 013e96a3a6312cd5f21fab7f29bf98da6774119f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 25 Feb 2024 07:43:56 +0000 Subject: [PATCH 055/105] Auto-generated commit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ffe4130..fe328bf 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ limitations under the License. ## Usage +```javascript +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +``` +The previous example will load the latest bundled code from the deno branch. Alternatively, you may load a specific version by loading the file from one of the [tagged bundles](https://github.com/stdlib-js/array-base-zerosnd/tags). For example, + ```javascript import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.1-deno/mod.js'; ``` @@ -85,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.1-deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From b8eb289697d4e13b6a1d45211802c250e20cf306 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Mar 2024 07:41:05 +0000 Subject: [PATCH 056/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 91449db..52e33c3 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 d9edcb8f4f6c4aa7cb5d386c40a74e44495f0484 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Mar 2024 13:19:53 +0000 Subject: [PATCH 057/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From cb96a1aa569eb862cc9348029893a2a47cf7c6bb Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Mar 2024 13:20:06 +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 | 24 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4854 insertions(+), 4549 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 15aba502310680e70aed4fb1bfeec11a2d260947 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Apr 2024 12:13:55 +0000 Subject: [PATCH 060/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From afa237f68a5845ed34da869a1cd013a98c179b52 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 1 Apr 2024 12:14:09 +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 | 24 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4854 insertions(+), 4552 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 f7fb81afedb91af85567da61b3e85933155e2a63 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 12 Apr 2024 08:39:00 +0000 Subject: [PATCH 063/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From b43ba11b98883f52c542278d9bc08139981caca3 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 12 Apr 2024 08:39:18 +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 | 24 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4854 insertions(+), 4553 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 ea9555975d29986a91842f94e3c6a16f59d1617b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 18 May 2024 03:03:16 +0000 Subject: [PATCH 066/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 80c5679322dd9b5b89527a5e36b3b90e458d297b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 18 May 2024 03:03:32 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4860 insertions(+), 4566 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 0766f363e81ff2ee1fb0609b6591e01c3cd23c71 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 29 Jul 2024 02:20:18 +0000 Subject: [PATCH 069/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 07cfd0a5772a408daa2679bd6bd879316a34c2e8 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 29 Jul 2024 02:20:36 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4860 insertions(+), 4705 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 c21befdecaf31b032ade51b24e70f0331e320516 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 29 Jul 2024 02:21:16 +0000 Subject: [PATCH 071/105] Update README.md for Deno bundle v0.2.2 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 35e9def..b8fbd0b 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@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.2-deno/mod.js'; ``` #### zerosnd( shape ) @@ -85,7 +85,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.2-deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From eac9f7a2e441840ce2fa8576ed241fe89b8e193f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 29 Jul 2024 02:21:17 +0000 Subject: [PATCH 072/105] Auto-generated commit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b8fbd0b..8f7092c 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ limitations under the License. ## Usage +```javascript +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; +``` +The previous example will load the latest bundled code from the deno branch. Alternatively, you may load a specific version by loading the file from one of the [tagged bundles](https://github.com/stdlib-js/array-base-zerosnd/tags). For example, + ```javascript import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.2-deno/mod.js'; ``` @@ -85,7 +90,7 @@ var out = zerosnd( [ 2, 3 ] ); ```javascript -import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@v0.2.2-deno/mod.js'; +import zerosnd from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-base-zerosnd@deno/mod.js'; var out = zerosnd( [ 1, 3 ] ); // returns [ [ 0.0, 0.0, 0.0 ] ] From 1c25766ee1150ef4559eb6d24216bbce1c89da18 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Aug 2024 07:48:15 +0000 Subject: [PATCH 073/105] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2a7df37..07bd810 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ }, "dependencies": { "@stdlib/array-base-fillednd": "^0.2.2", - "@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 094062806a10a33fa60248f64d1f2b1800c0e21e Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Aug 2024 12:39:09 +0000 Subject: [PATCH 074/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 8e5af44fa5483f7e549cab1cc103355931c6c263 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Thu, 1 Aug 2024 12:39:28 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4860 insertions(+), 4656 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 58ac8ea99eda51585ea6dcd53323416dc07b883d 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 --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From d9c7ecd992fc29faf98c08352beb0ff60b4b6cbd 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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4860 insertions(+), 4706 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 e2e0702de869ab4f5baef27aeb11571b819777a9 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 28 Sep 2024 21:20:08 +0000 Subject: [PATCH 080/105] Remove files --- mod.d.ts | 259 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5106 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index 1427748..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From ed4f56dedda67ddfaf1dc4152172f3a72c0658d1 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 28 Sep 2024 21:20:22 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 45 files changed, 4860 insertions(+), 4739 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 ab56a90971c99cffb29c913a643e03f2ecef05d1 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 1 Oct 2024 13:03:27 +0000 Subject: [PATCH 083/105] Remove files --- mod.d.ts | 258 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index d851c8e..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 4409ee392eb8b272f32326bbf6de0de6bd96bb85 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Tue, 1 Oct 2024 13:03:51 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4860 insertions(+), 4740 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 ddb9c3bc702fc8fd2d6e245613ae1153e21eff95 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Nov 2024 12:12:49 +0000 Subject: [PATCH 086/105] Remove files --- mod.d.ts | 258 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index d851c8e..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From d9ab54a6bdd5a1dcf6263e0d6e4d27fd34cb552f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Fri, 1 Nov 2024 12:13:09 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 46 files changed, 4860 insertions(+), 4740 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 d0b4bbcfae0fb78caf751bdb7a64f52247384c59 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 1 Dec 2024 12:38:00 +0000 Subject: [PATCH 089/105] Remove files --- mod.d.ts | 258 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index d851c8e..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From aa7443e8c25cb210292297a4abda0e43fc1a25c0 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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4860 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 b4eb298f478e878e0ee5a3c6660a908d3098fee3 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Dec 2024 02:29:31 +0000 Subject: [PATCH 092/105] Remove files --- mod.d.ts | 258 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index d851c8e..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 491f0f2c4e37ea3ac8f6f3f57d54df67c1d5dc03 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Dec 2024 02:29:51 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4860 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 d533edd61df946599c2621b2457ac683464fdbd0 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 30 Dec 2024 04:35:46 +0000 Subject: [PATCH 095/105] Remove files --- mod.d.ts | 258 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index d851c8e..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 04974c5c92c917d7f06aeb525f07cfc0e11b229b Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 30 Dec 2024 04:36:00 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4860 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 fce22e6bd9dcbd09c0902d7908bc18ad5efeadb9 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 --- mod.d.ts | 258 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index d851c8e..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index a9a38ed..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 2c9a347ae83343fb31f79c8edd241f9abefeae32 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 20 Jan 2025 02:04:01 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4860 insertions(+), 4844 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 494a020b6842e2a538c88a83af7770ddf12b8817 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 7 Apr 2025 00:47:22 +0000 Subject: [PATCH 101/105] Remove files --- mod.d.ts | 258 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index d851c8e..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 8eb4b57..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 9ca96813fd7ade836cb0574b739966a0674be97f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 7 Apr 2025 00:47:45 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4860 insertions(+), 4848 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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 bbcb19623d3db0d835a5a2e351da99d34a8a14cd Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Apr 2025 00:53:58 +0000 Subject: [PATCH 104/105] Remove files --- mod.d.ts | 258 --- mod.js | 4 - mod.js.map | 1 - stats.html | 4842 ---------------------------------------------------- 4 files changed, 5105 deletions(-) delete mode 100644 mod.d.ts delete mode 100644 mod.js delete mode 100644 mod.js.map delete mode 100644 stats.html diff --git a/mod.d.ts b/mod.d.ts deleted file mode 100644 index d851c8e..0000000 --- a/mod.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/mod.js b/mod.js deleted file mode 100644 index 8eb4b57..0000000 --- a/mod.js +++ /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 -/// -function r(n,t,u,e,f){var o,i,a;if(o=u[e],(i=e+1)===t)return function(r,n){var t,u;for(t=[],u=0;u - - - - - - Rollup Visualizer - - - -
- - - - - From 3c15f3d7194da6b8d1debdc5a7c0cd85b6a95bf8 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 14 Apr 2025 00:54:18 +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 | 36 +- 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 - lib/index.js | 40 - lib/main.js | 49 - docs/types/index.d.ts => mod.d.ts | 2 +- mod.js | 4 + mod.js.map | 1 + package.json | 60 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 616 --- 47 files changed, 4860 insertions(+), 4848 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 delete mode 100644 lib/index.js delete mode 100644 lib/main.js rename docs/types/index.d.ts => mod.d.ts (98%) create mode 100644 mod.js create mode 100644 mod.js.map 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 + + + + 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(); -});