From fb1f54ef7dd505c32212e4b13fb5ac22d101b398 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 24 Sep 2023 05:32:26 +0000 Subject: [PATCH] Release v0.1.0 --- .editorconfig | 5 +++ .github/.keepalive | 1 - .github/workflows/productionize.yml | 21 ++----------- .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/test_bundles.yml | 6 ++-- .github/workflows/test_coverage.yml | 2 +- .github/workflows/test_install.yml | 2 +- CITATION.cff | 30 ++++++++++++++++++ CONTRIBUTORS | 21 +++++++------ README.md | 15 +++++++-- dist/index.d.ts | 3 ++ dist/index.js | 7 +++++ dist/index.js.map | 7 +++++ docs/types/index.d.ts | 2 +- package.json | 48 ++++++++++++++--------------- test/test.two_arrays.js | 6 ++++ 17 files changed, 117 insertions(+), 63 deletions(-) delete mode 100644 .github/.keepalive create mode 100644 CITATION.cff create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map diff --git a/.editorconfig b/.editorconfig index 0fd4d6c..13e9c39 100644 --- a/.editorconfig +++ b/.editorconfig @@ -179,3 +179,8 @@ 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/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 3b29b47..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-07-01T06:19:23.286Z diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 3e8e2db..91f2b93 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -82,21 +82,6 @@ jobs: id: transform-error-messages uses: stdlib-js/transform-errors-action@main - # Format error messages: - - name: 'Replace double quotes with single quotes in rewritten format string error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \; - - # Format string literal error messages: - - name: 'Replace double quotes with single quotes in rewritten string literal error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \; - - # Format code: - - name: 'Replace double quotes with single quotes in inserted `require` calls' - run: | - find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \; - # 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: | @@ -349,7 +334,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} @@ -520,7 +505,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} @@ -697,7 +682,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 26be02d..474004b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -209,7 +209,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a768fab..28745fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test_bundles.yml b/.github/workflows/test_bundles.yml index e9df6a0..172cb2d 100644 --- a/.github/workflows/test_bundles.yml +++ b/.github/workflows/test_bundles.yml @@ -88,7 +88,7 @@ jobs: # Send notification to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} @@ -130,7 +130,7 @@ jobs: # Send notification to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} @@ -172,7 +172,7 @@ jobs: # Send notification to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 6d8aa0b..a73c515 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -106,7 +106,7 @@ jobs: # Send Slack notification if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 45b3490..35bfab4 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -75,7 +75,7 @@ jobs: # Send Slack notification if job fails: - name: 'Send notification to Slack in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..2ec6fff --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,30 @@ +cff-version: 1.2.0 +title: stdlib +message: >- + If you use this software, please cite it using the + metadata from this file. + +type: software + +authors: + - name: The Stdlib Authors + url: https://github.com/stdlib-js/stdlib/graphs/contributors + +repository-code: https://github.com/stdlib-js/stdlib +url: https://stdlib.io + +abstract: | + Standard library for JavaScript and Node.js. + +keywords: + - JavaScript + - Node.js + - TypeScript + - standard library + - scientific computing + - numerical computing + - statistical computing + +license: Apache-2.0 AND BSL-1.0 + +date-released: 2016 diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 0c2727b..93c4bde 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3,28 +3,31 @@ # Contributors listed in alphabetical order. Ali Salesi +Amit Jimiwal Athan Reines Brendan Graetz Bruno Fenzl Christopher Dambamuromo +Dan Rose Dominik Moritz +Dorrin Sotoudeh Frank Kovacs -Harshita Kalani <95532771+HarshitaKalani@users.noreply.github.com> -James +Harshita Kalani +James Gelok Jithin KS Joey Reed -Jordan-Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com> +Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com> Joris Labie Justin Dennison -KATTA NAGA NITHIN <88046362+nithinkatta@users.noreply.github.com> -Marcus +Marcus Fantham Matt Cochrane Milan Raj Momtchil Momtchev -Naresh Jagadeesan <37257700+Infinage@users.noreply.github.com> +Naresh Jagadeesan +Nithin Katta <88046362+nithinkatta@users.noreply.github.com> Ognjen Jevremović Philipp Burckhardt -Pranav <85227306+Pranavchiku@users.noreply.github.com> +Pranav Goswami Ricky Reusser Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com> Ryan Seal @@ -32,7 +35,5 @@ Seyyed Parsa Neshaei Shraddheya Shendre Stephannie Jiménez Gacha Yernar Yergaziyev -dorrin-sot <59933477+dorrin-sot@users.noreply.github.com> -drunken_devv <90555965+amitjimiwal@users.noreply.github.com> orimiles5 <97595296+orimiles5@users.noreply.github.com> -rei2hu +rei2hu diff --git a/README.md b/README.md index e1ce372..7d52ccf 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,17 @@ limitations under the License. --> + +
+ + About stdlib... + +

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

+

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

+

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

+

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

+
+ # Dispatch [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] @@ -321,8 +332,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. [npm-image]: http://img.shields.io/npm/v/@stdlib/ndarray-dispatch.svg [npm-url]: https://npmjs.org/package/@stdlib/ndarray-dispatch -[test-image]: https://github.com/stdlib-js/ndarray-dispatch/actions/workflows/test.yml/badge.svg?branch=main -[test-url]: https://github.com/stdlib-js/ndarray-dispatch/actions/workflows/test.yml?query=branch:main +[test-image]: https://github.com/stdlib-js/ndarray-dispatch/actions/workflows/test.yml/badge.svg?branch=v0.1.0 +[test-url]: https://github.com/stdlib-js/ndarray-dispatch/actions/workflows/test.yml?query=branch:v0.1.0 [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-dispatch/main.svg [coverage-url]: https://codecov.io/github/stdlib-js/ndarray-dispatch?branch=main diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..1295a44 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import dispatch from '../docs/types/index'; +export = dispatch; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..f06bb26 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,7 @@ +"use strict";var y=function(n,r){return function(){return r||n((r={exports:{}}).exports,r),r.exports}};var b=y(function(C,w){ +function k(n,r,e,u,f,m,i,o,l){var h,t,s,a;for(h=m,s=0;s [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\nfunction dispatch( fcns, types, data, nargs, nin, nout ) {\n\tvar narrays;\n\tvar nfcns;\n\tvar fcn;\n\n\tif ( isFunction( fcns ) ) {\n\t\tfcn = fcns;\n\t} else if ( !isFunctionArray( fcns ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be either a function or an array of functions. Value: `%s`.', fcns ) );\n\t}\n\tif ( !isCollection( types ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', types ) );\n\t}\n\tif ( !isCollection( data ) && data !== null ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an array-like object or null. Value: `%s`.', data ) );\n\t}\n\tif ( !isPositiveInteger( nargs ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a positive integer. Value: `%s`.', nargs ) );\n\t}\n\tif ( !isNonNegativeInteger( nin ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%s`.', nin ) );\n\t}\n\tif ( !isNonNegativeInteger( nout ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Sixth argument must be a nonnegative integer. Value: `%s`.', nout ) );\n\t}\n\tnarrays = nin + nout;\n\tif ( narrays === 0 ) {\n\t\tthrow new Error( 'invalid arguments. Interface must accept at least one input and/or output ndarray. Based on the provided arguments, `nin+nout` equals `0`.' );\n\t}\n\tif ( nargs !== narrays ) {\n\t\tthrow new Error( 'invalid arguments. Fourth argument does not equal the number of input and output ndarrays.' );\n\t}\n\tif ( fcn ) {\n\t\tnfcns = types.length / narrays;\n\t\tif ( !isInteger( nfcns ) ) {\n\t\t\tthrow new Error( 'invalid argument. Unexpected number of types. A type must be specified for each input and output ndarray for each provided ndarray function.' );\n\t\t}\n\t} else {\n\t\tnfcns = fcns.length;\n\t\tif ( types.length !== nfcns*narrays ) {\n\t\t\tthrow new Error( 'invalid argument. Unexpected number of types. A type must be specified for each input and output ndarray for each provided ndarray function.' );\n\t\t}\n\t}\n\tif ( data && data.length !== nfcns ) {\n\t\tthrow new Error( 'invalid argument. The third argument must have the same number of elements as the first argument.' );\n\t}\n\ttypes = types2enums( types );\n\treturn dispatcher;\n\n\t/**\n\t* ndarray function interface which performs multiple dispatch.\n\t*\n\t* @private\n\t* @param {ndarrayLike} x - ndarray\n\t* @param {...ndarrayLike} args - ndarray arguments\n\t* @throws {Error} insufficient arguments\n\t* @throws {Error} too many arguments\n\t* @throws {TypeError} input array arguments must be ndarray-like objects\n\t* @throws {TypeError} output array arguments must be ndarray-like objects\n\t* @throws {TypeError} unable to resolve an ndarray function supporting the provided ndarray argument data types\n\t* @returns {(ndarrayLike|Array|void)} destination array(s)\n\t*/\n\tfunction dispatcher() {\n\t\tvar arrays;\n\t\tvar dtypes;\n\t\tvar argc;\n\t\tvar idx;\n\t\tvar v;\n\t\tvar f;\n\t\tvar i;\n\n\t\targc = arguments.length;\n\t\tif ( argc !== nargs ) {\n\t\t\tif ( argc < nargs ) {\n\t\t\t\tthrow new Error( 'invalid invocation. Insufficient arguments.' );\n\t\t\t}\n\t\t\tthrow new Error( 'invalid invocation. Too many arguments.' );\n\t\t}\n\t\tarrays = [];\n\t\tdtypes = [];\n\t\tfor ( i = 0; i < nargs; i++ ) {\n\t\t\tv = arguments[ i ];\n\t\t\tif ( !isndarrayLike( v ) ) {\n\t\t\t\tif ( i < nin ) {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Input array must be an ndarray-like object. Value: `%s`.', v ) );\n\t\t\t\t} else {\n\t\t\t\t\tthrow new TypeError( format( 'invalid argument. Output array must be an ndarray-like object. Value: `%s`.', v ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\tarrays.push( v );\n\t\t\tdtypes.push( resolveEnum( v.dtype ) );\n\t\t}\n\t\t// Resolve the ndarray function satisfying the input array types:\n\t\tidx = indexOfTypes( nfcns, narrays, types, narrays, 1, 0, dtypes, 1, 0 ); // eslint-disable-line max-len\n\n\t\t// Check whether we were able to successfully resolve an ndarray function:\n\t\tif ( idx < 0 ) {\n\t\t\tthrow new TypeError( 'invalid arguments. Unable to resolve an ndarray function supporting the provided array argument data types.' );\n\t\t}\n\t\t// Retrieve the ndarray function:\n\t\tif ( fcn ) {\n\t\t\tf = fcn;\n\t\t} else {\n\t\t\tf = fcns[ idx ];\n\t\t}\n\t\t// Evaluate the ndarray function:\n\t\tif ( data ) {\n\t\t\tf( arrays, data[ idx ] );\n\t\t} else {\n\t\t\tf( arrays );\n\t\t}\n\t\tif ( nout === 1 ) {\n\t\t\treturn arrays[ narrays-1 ];\n\t\t}\n\t\tif ( nout === 0 ) {\n\t\t\treturn;\n\t\t}\n\t\treturn arrays.slice( nin );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = dispatch;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an ndarray function interface which performs multiple dispatch.\n*\n* @module @stdlib/ndarray-dispatch\n*\n* @example\n* var dispatch = require( '@stdlib/ndarray-dispatch' );\n* var ndarray = require( '@stdlib/ndarray-ctor' );\n* var unary = require( '@stdlib/ndarray-base-unary' );\n* var abs = require( '@stdlib/math-base-special-abs' );\n* var Float64Array = require( '@stdlib/array-float64' );\n*\n* var types = [\n* 'float64', 'float64'\n* ];\n*\n* var data = [\n* abs\n* ];\n*\n* var absolute = dispatch( unary, types, data, 2, 1, 1 );\n*\n* // ...\n*\n* var xbuf = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] );\n* var ybuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );\n*\n* var x = ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' );\n* var y = ndarray( 'float64', ybuf, [ 5 ], [ 1 ], 0, 'row-major' );\n*\n* absolute( x, y );\n* // ybuf => [ 1.0, 2.0, 3.0, 4.0, 5.0 ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], + "mappings": "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", + "names": ["require_index_of_types", "__commonJSMin", "exports", "module", "indexOfTypes", "N", "M", "x", "strideX1", "strideX2", "offsetX", "y", "strideY", "offsetY", "ix", "iy", "i", "j", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isPositiveInteger", "isInteger", "isFunctionArray", "isFunction", "isCollection", "isndarrayLike", "format", "resolveEnum", "indexOfTypes", "types2enums", "types", "out", "i", "dispatch", "fcns", "data", "nargs", "nin", "nout", "narrays", "nfcns", "fcn", "dispatcher", "arrays", "dtypes", "argc", "idx", "v", "f", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 610167d..d0190a1 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /// diff --git a/package.json b/package.json index 5161a39..39a6e09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stdlib/ndarray-dispatch", - "version": "0.0.6", + "version": "0.1.0", "description": "Create an ndarray function interface which performs multiple dispatch.", "license": "Apache-2.0", "author": { @@ -37,35 +37,35 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/assert-is-collection": "^0.0.8", - "@stdlib/assert-is-function": "^0.0.8", - "@stdlib/assert-is-function-array": "^0.0.7", - "@stdlib/assert-is-integer": "^0.0.8", - "@stdlib/assert-is-ndarray-like": "^0.0.6", - "@stdlib/assert-is-nonnegative-integer": "^0.0.7", - "@stdlib/assert-is-positive-integer": "^0.0.7", - "@stdlib/ndarray-base-dtype-resolve-enum": "^0.0.1", - "@stdlib/string-format": "^0.0.3", - "@stdlib/types": "^0.0.14" + "@stdlib/assert-is-collection": "^0.1.0", + "@stdlib/assert-is-function": "^0.1.0", + "@stdlib/assert-is-function-array": "^0.1.0", + "@stdlib/assert-is-integer": "^0.1.0", + "@stdlib/assert-is-ndarray-like": "^0.1.0", + "@stdlib/assert-is-nonnegative-integer": "^0.1.0", + "@stdlib/assert-is-positive-integer": "^0.1.0", + "@stdlib/ndarray-base-dtype-resolve-enum": "^0.1.0", + "@stdlib/string-format": "^0.1.0", + "@stdlib/types": "^0.1.0" }, "devDependencies": { - "@stdlib/array-float32": "^0.0.6", - "@stdlib/array-float64": "^0.0.6", - "@stdlib/array-int32": "^0.0.6", - "@stdlib/array-int8": "^0.0.6", - "@stdlib/array-uint8": "^0.0.7", - "@stdlib/bench": "^0.0.12", - "@stdlib/math-base-assert-is-nan": "^0.0.8", - "@stdlib/math-base-special-abs": "^0.0.6", - "@stdlib/math-base-special-pow": "^0.0.7", + "@stdlib/array-float32": "^0.1.0", + "@stdlib/array-float64": "^0.1.0", + "@stdlib/array-int32": "^0.1.0", + "@stdlib/array-int8": "^0.1.0", + "@stdlib/array-uint8": "^0.1.0", + "@stdlib/bench": "^0.1.0", + "@stdlib/math-base-assert-is-nan": "^0.1.0", + "@stdlib/math-base-special-abs": "^0.1.0", + "@stdlib/math-base-special-pow": "^0.1.0", "@stdlib/math-base-special-sin": "^0.0.6", "@stdlib/ndarray-base-buffer-dtype": "^0.0.6", - "@stdlib/ndarray-base-numel": "^0.0.8", + "@stdlib/ndarray-base-numel": "^0.1.0", "@stdlib/ndarray-base-unary": "^0.0.6", "@stdlib/ndarray-ctor": "^0.0.10", - "@stdlib/ndarray-dtypes": "^0.0.9", - "@stdlib/ndarray-ind2sub": "^0.0.7", - "@stdlib/strided-dtypes": "^0.0.8", + "@stdlib/ndarray-dtypes": "^0.1.0", + "@stdlib/ndarray-ind2sub": "^0.1.0", + "@stdlib/strided-dtypes": "^0.1.0", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1", "tap-min": "git+https://github.com/Planeshifter/tap-min.git" diff --git a/test/test.two_arrays.js b/test/test.two_arrays.js index 071500e..16eb61b 100644 --- a/test/test.two_arrays.js +++ b/test/test.two_arrays.js @@ -44,6 +44,12 @@ var sum = require( './fixtures/sum.js' ); // TESTS // +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dispatch, 'function', 'main export is a function' ); + t.end(); +}); + tape( 'the function returns a function which throws an error if not provided an ndarray for the first argument', function test( t ) { var values; var types;