Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
stdlib-bot committed Sep 30, 2023
1 parent 3848367 commit 4b30746
Showing 18 changed files with 244 additions and 76 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -41,11 +41,13 @@ jobs:

# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
3 changes: 2 additions & 1 deletion .github/workflows/cancel.yml
Original file line number Diff line number Diff line change
@@ -44,7 +44,8 @@ jobs:

# Cancel existing workflow runs:
- name: 'Cancel existing workflow runs'
uses: styfle/[email protected]
# Pin action to full length commit SHA corresponding to v0.11.0
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5
with:
workflow_id: >-
benchmark.yml,
36 changes: 23 additions & 13 deletions .github/workflows/close_pull_requests.yml
Original file line number Diff line number Diff line change
@@ -26,19 +26,29 @@ on:

# 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:
- 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/repl/signature) 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

# 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/repl/signature) 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
10 changes: 6 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -39,13 +39,15 @@ jobs:
# Define the sequence of job steps...
steps:

# Checkout the repository:
- name: 'Checkout the repository'
uses: actions/checkout@v3
# 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'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
12 changes: 8 additions & 4 deletions .github/workflows/npm_downloads.yml
Original file line number Diff line number Diff line change
@@ -45,12 +45,14 @@ jobs:
steps:
# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# 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'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -84,7 +86,8 @@ jobs:
# Upload the download data:
- name: 'Upload data'
uses: actions/upload-artifact@v3
# 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
@@ -99,7 +102,8 @@ jobs:

# Send data to events server:
- name: 'Post data'
uses: distributhor/workflow-webhook@v3
# 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 }}
51 changes: 34 additions & 17 deletions .github/workflows/productionize.yml
Original file line number Diff line number Diff line change
@@ -60,13 +60,15 @@ jobs:
steps:
# Checkout main branch of repository:
- name: 'Checkout main branch'
uses: actions/checkout@v3
# 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'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -131,15 +133,17 @@ jobs:
# Checkout the repository:
- name: 'Checkout repository'
if: ${{ github.event.inputs.require-passing-tests == 'true' }}
uses: actions/checkout@v3
# 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' }}
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -183,7 +187,8 @@ jobs:
steps:
# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Configure git:
- name: 'Configure git'
@@ -250,7 +255,8 @@ jobs:
# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -333,7 +339,8 @@ jobs:
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -356,7 +363,8 @@ jobs:
steps:
# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Configure git:
- name: 'Configure git'
@@ -415,7 +423,8 @@ jobs:
# Install Node.js
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -503,7 +512,8 @@ jobs:
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -526,7 +536,8 @@ jobs:
steps:
# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Configure git:
- name: 'Configure git'
@@ -593,7 +604,8 @@ jobs:
# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -679,7 +691,8 @@ jobs:
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -702,7 +715,8 @@ jobs:
steps:
# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Configure git:
- name: 'Configure git'
@@ -768,7 +782,8 @@ jobs:
# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -871,7 +886,8 @@ jobs:
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -895,7 +911,8 @@ jobs:

# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
fetch-depth: 2

15 changes: 10 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -61,11 +61,13 @@ jobs:

# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -197,7 +199,8 @@ jobs:
# Publish package to npm:
- name: 'Publish package to npm'
uses: JS-DevTools/npm-publish@v2
# Pin action to full length commit SHA corresponding to v2.2.2
uses: JS-DevTools/npm-publish@fe72237be0920f7a0cafd6a966c9b929c9466e9b
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
@@ -209,7 +212,8 @@ jobs:
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -230,7 +234,8 @@ jobs:

# Cancel any running or queued workflow runs:
- name: 'Cancel running or queued workflow runs'
uses: styfle/[email protected]
# Pin action to full length commit SHA corresponding to v0.11.0
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5
with:
workflow_id: >-
benchmark.yml,
15 changes: 10 additions & 5 deletions .github/workflows/publish_cli.yml
Original file line number Diff line number Diff line change
@@ -61,13 +61,15 @@ jobs:

# Checkout cli branch:
- name: 'Checkout cli branch'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
ref: cli

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -120,7 +122,8 @@ jobs:
# Publish package to npm:
- name: 'Publish package to npm'
uses: JS-DevTools/npm-publish@v2
# Pin action to full length commit SHA corresponding to v2.2.2
uses: JS-DevTools/npm-publish@fe72237be0920f7a0cafd6a966c9b929c9466e9b
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
@@ -132,7 +135,8 @@ jobs:
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -153,7 +157,8 @@ jobs:

# Cancel any running or queued workflow runs:
- name: 'Cancel running or queued workflow runs'
uses: styfle/[email protected]
# Pin action to full length commit SHA corresponding to v0.11.0
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5
with:
workflow_id: >-
benchmark.yml,
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -58,11 +58,13 @@ jobs:

# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -89,7 +91,8 @@ jobs:
# Send status to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
27 changes: 18 additions & 9 deletions .github/workflows/test_bundles.yml
Original file line number Diff line number Diff line change
@@ -49,13 +49,15 @@ jobs:
steps:
# Checkout UMD branch of the repository:
- name: 'Checkout branch with UMD build'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
ref: umd

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 17

@@ -88,7 +90,8 @@ jobs:
# Send notification to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -113,13 +116,15 @@ jobs:

# Checkout ES modules branch of the repository:
- name: 'Checkout branch with ESM build'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
ref: esm

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 17

@@ -130,7 +135,8 @@ jobs:
# Send notification to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -155,13 +161,15 @@ jobs:

# Checkout Deno branch of the repository:
- name: 'Checkout branch with Deno build'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
ref: deno

# Install Deno:
- name: 'Install Deno'
uses: denoland/setup-deno@v1
# Pin action to full length commit SHA corresponding to v1.1.2
uses: denoland/setup-deno@61fe2df320078202e33d7d5ad347e7dcfa0e8f31
with:
deno-version: vx.x.x

@@ -172,7 +180,8 @@ jobs:
# Send notification to Slack channel if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
15 changes: 10 additions & 5 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
@@ -46,11 +46,13 @@ jobs:

# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -77,7 +79,8 @@ jobs:
# Upload coverage report to Codecov:
- name: 'Upload coverage to Codecov'
id: upload
uses: codecov/codecov-action@v3
# Pin action to full length commit SHA corresponding to v3.1.4
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
with:
directory: reports/coverage
flags: unittests
@@ -106,7 +109,8 @@ jobs:
# Send Slack notification if job fails:
- name: 'Send status to Slack channel in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
@@ -115,7 +119,8 @@ jobs:

# Send data to events server:
- name: 'Post data'
uses: distributhor/workflow-webhook@v3
# Pin action to full length commit SHA corresponding to v3.0.3:
uses: distributhor/workflow-webhook@48a40b380ce4593b6a6676528cd005986ae56629
env:
webhook_url: ${{ secrets.STDLIB_COVERAGE_URL }}
webhook_secret: ${{ secrets.STDLIB_WEBHOOK_SECRET }}
9 changes: 6 additions & 3 deletions .github/workflows/test_install.yml
Original file line number Diff line number Diff line change
@@ -58,11 +58,13 @@ jobs:

# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@v3
# Pin action to full length commit SHA corresponding to v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@v3
# Pin action to full length commit SHA corresponding to v3.8.1
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: 16
timeout-minutes: 5
@@ -75,7 +77,8 @@ jobs:

# Send Slack notification if job fails:
- name: 'Send notification to Slack in case of failure'
uses: act10ns/slack@v2
# Pin action to full length commit SHA corresponding to v2.0.0
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
1 change: 1 addition & 0 deletions data/data.csv
Original file line number Diff line number Diff line change
@@ -3714,6 +3714,7 @@ ndarraySafeCasts,"ndarraySafeCasts( [dtype] )"
ndarraySameKindCasts,"ndarraySameKindCasts( [dtype] )"
ndempty,"ndempty( shape[, options] )"
ndemptyLike,"ndemptyLike( x[, options] )"
ndslice,"ndslice( x, ...s[, options] )"
ndzeros,"ndzeros( shape[, options] )"
ndzerosLike,"ndzerosLike( x[, options] )"
nextGraphemeClusterBreak,"nextGraphemeClusterBreak( str[, fromIndex] )"
2 changes: 1 addition & 1 deletion data/data.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@
"@stdlib/fs-write-file": "^0.1.0",
"@stdlib/namespace-aliases": "^0.1.0",
"@stdlib/process-exec-path": "^0.1.0",
"@stdlib/random-base-discrete-uniform": "^0.0.6",
"@stdlib/random-base-discrete-uniform": "^0.1.0",
"@stdlib/repl-help": "^0.1.0",
"@stdlib/string-replace": "^0.1.0",
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
101 changes: 101 additions & 0 deletions test/dist/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF 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 aliases = require( '@stdlib/namespace-aliases' );
var DATA = require( './../../data/data.json' );
var signature = require( './../../dist' );


// TESTS //

tape( 'main export is a function', function test( t ) {
t.ok( true, __filename );
t.strictEqual( typeof signature, 'function', 'main export is a function' );
t.end();
});

tape( 'the function throws an error if not provided a string', function test( t ) {
var values;
var i;

values = [
5,
NaN,
true,
false,
null,
void 0,
[],
{},
function noop() {}
];
for ( i = 0; i < values.length; i++ ) {
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
}
t.end();

function badValue( value ) {
return function badValue() {
signature( value );
};
}
});

tape( 'the function returns one or more signatures', function test( t ) {
var expected;
var actual;
var list;
var i;
var j;

list = aliases();
for ( i = 0; i < list.length; i++ ) {
expected = [];
for ( j = 0; j < DATA.length; j++ ) {
if ( DATA[ j ][ 0 ] === list[ i ] ) {
expected.push( DATA[ j ][ 1 ] );
}
}
if ( expected.length === 0 ) {
expected = null;
}
actual = signature( list[i] );
t.deepEqual( actual, expected, 'returns expected value for '+list[i] );
}
t.end();
});

tape( 'the function returns `null` if provided an unrecognized alias', function test( t ) {
var values;
var i;

values = [
'adfkaljdfdsafs',
'adklfadjflajdslfjalsdf',
'adflkajdlkfjasdlkfjsadlkfjlasdjflsdjfla'
];
for ( i = 0; i < values.length; i++ ) {
t.strictEqual( signature( values[ i ] ), null, 'returns expected value' );
}
t.end();
});

0 comments on commit 4b30746

Please sign in to comment.