From 74b3e47f98e027fa6df5ab5d35c0f5e41219dc03 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 21 Sep 2024 22:36:13 +0000 Subject: [PATCH 01/22] Transform error messages --- lib/main.js | 36 ++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/main.js b/lib/main.js index fc510be..1391297 100644 --- a/lib/main.js +++ b/lib/main.js @@ -38,7 +38,7 @@ var ArrayBuffer = require( '@stdlib/array-buffer' ); var DataView = require( '@stdlib/array-dataview' ); var getter = require( '@stdlib/array-base-getter' ); var accessorGetter = require( '@stdlib/array-base-accessor-getter' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); var fromIterator = require( './from_iterator.js' ); var fromIteratorMap = require( './from_iterator_map.js' ); var fromArray = require( './from_array.js' ); @@ -214,39 +214,39 @@ function Float64ArrayFE() { buf = new DataView( arg ); } else if ( isObject( arg ) ) { if ( HAS_ITERATOR_SYMBOL === false ) { - throw new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null29', arg ) ); } if ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } buf = arg[ ITERATOR_SYMBOL ](); if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } tmp = fromIterator( buf ); buf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE ); } else { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } } else { buf = arguments[ 1 ]; if ( !isArrayBuffer( buf ) ) { - throw new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) ); + throw new TypeError( format( 'null2B', buf ) ); } byteOffset = arguments[ 2 ]; if ( !isNonNegativeInteger( byteOffset ) ) { - throw new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) ); + throw new TypeError( format( 'null2C', byteOffset ) ); } if ( nargs === 2 ) { buf = new DataView( buf, byteOffset ); } else { len = arguments[ 3 ]; if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) ); + throw new TypeError( format( 'null2F', len ) ); } len *= BYTES_PER_ELEMENT; if ( len > (buf.byteLength-byteOffset) ) { - throw new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len ) ); + throw new RangeError( format( 'null2G', len ) ); } buf = new DataView( buf, byteOffset, len ); } @@ -336,7 +336,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { var len; var i; if ( !isFunction( this ) ) { - throw new TypeError( 'invalid invocation. `this` context must be a constructor.' ); + throw new TypeError( format('null01') ); } if ( !isFloat64ArrayFEConstructor( this ) ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); @@ -351,7 +351,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { if ( nargs > 2 ) { clbk = arguments[ 2 ]; if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) ); + throw new TypeError( format( 'null3N', clbk ) ); } if ( nargs > 3 ) { thisArg = arguments[ 3 ]; @@ -377,7 +377,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { buf = src[ ITERATOR_SYMBOL ](); if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) ); + throw new TypeError( format( 'nullAt', src ) ); } if ( clbk ) { tmp = fromIteratorMap( buf, clbk, thisArg ); @@ -392,7 +392,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { } return out; } - throw new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) ); + throw new TypeError( format( 'nullAt', src ) ); }); /** @@ -420,7 +420,7 @@ setReadOnly( Float64ArrayFE, 'of', function of( endianness ) { var args; var i; if ( !isFunction( this ) ) { - throw new TypeError( 'invalid invocation. `this` context must be a constructor.' ); + throw new TypeError( format('null01') ); } if ( !isFloat64ArrayFEConstructor( this ) ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); @@ -537,7 +537,7 @@ setReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); } if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) ); + throw new TypeError( format( 'null2K', idx ) ); } if ( idx >= this._length ) { return; @@ -624,7 +624,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { if ( arguments.length > 1 ) { idx = arguments[ 1 ]; if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) ); + throw new TypeError( format( 'null2L', idx ) ); } } else { idx = 0; @@ -632,7 +632,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { if ( isCollection( value ) ) { N = value.length; if ( idx+N > this._length ) { - throw new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' ); + throw new RangeError( format('null03') ); } sbuf = value; if ( sbuf.get && sbuf.set ) { @@ -663,7 +663,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { return; } if ( idx >= this._length ) { - throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) ); + throw new RangeError( format( 'null2M', idx ) ); } buf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE ); }); diff --git a/package.json b/package.json index 062a5b5..33cf006 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@stdlib/assert-is-object": "^0.2.2", "@stdlib/assert-is-string": "^0.2.2", "@stdlib/string-base-lowercase": "^0.4.0", - "@stdlib/string-format": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", "@stdlib/symbol-iterator": "^0.2.2", "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.3", "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", From 6ff7a7d811c90070529058c9ec7524aa0d18b2ac Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 21 Sep 2024 22:37:32 +0000 Subject: [PATCH 02/22] 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 | 50 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 51 +- SECURITY.md | 5 - benchmark/benchmark.from.js | 310 -- benchmark/benchmark.get.js | 85 - benchmark/benchmark.js | 533 --- benchmark/benchmark.of.js | 69 - benchmark/benchmark.set.js | 209 - benchmark/benchmark.set.length.js | 110 - benchmark/benchmark.to_string.js | 50 - benchmark/benchmark.to_string.length.js | 94 - branches.md | 56 - dist/index.js | 19 - dist/index.js.map | 7 - examples/index.js | 42 - index.mjs | 4 + index.mjs.map | 1 + lib/from_array.js | 46 - lib/from_iterator.js | 48 - lib/from_iterator_map.js | 53 - lib/index.js | 94 - lib/main.js | 708 --- package.json | 74 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 35 - 48 files changed, 4870 insertions(+), 5933 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.from.js delete mode 100644 benchmark/benchmark.get.js delete mode 100644 benchmark/benchmark.js delete mode 100644 benchmark/benchmark.of.js delete mode 100644 benchmark/benchmark.set.js delete mode 100644 benchmark/benchmark.set.length.js delete mode 100644 benchmark/benchmark.to_string.js delete mode 100644 benchmark/benchmark.to_string.length.js delete mode 100644 branches.md delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 examples/index.js create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/from_array.js delete mode 100644 lib/from_iterator.js delete mode 100644 lib/from_iterator_map.js delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9acabc8..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/fixed-endian-float64) 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 54acaa3..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/fixed-endian-float64) 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 9b5400f..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 2 * * 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 + + ```
@@ -468,7 +459,7 @@ logEach( '%s', out ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -531,13 +522,13 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-fixed-endian-float64/main/LICENSE -[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed +[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed/tree/esm -[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer +[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer/tree/esm -[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory +[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory/tree/esm -[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64 +[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64/tree/esm
diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.from.js b/benchmark/benchmark.from.js deleted file mode 100644 index cf3e838..0000000 --- a/benchmark/benchmark.from.js +++ /dev/null @@ -1,310 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// MAIN // - -bench( pkg+'::typed_array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 'little-endian', 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::iterable:from', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } - } -}); - -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } -}); - -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable(), clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } - - function clbk( v ) { - return v * 2.0; - } -}); diff --git a/benchmark/benchmark.get.js b/benchmark/benchmark.get.js deleted file mode 100644 index 764daf1..0000000 --- a/benchmark/benchmark.get.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js deleted file mode 100644 index 1c5c261..0000000 --- a/benchmark/benchmark.js +++ /dev/null @@ -1,533 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var Float64Array = require( '@stdlib/array-float64' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// FUNCTIONS // - -/** -* Returns an "iterable" object. -* -* @private -* @returns {Object} iterable object -*/ -function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } -} - - -// MAIN // - -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:buffer', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.buffer; - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArrayBuffer( v ) ) { - b.fail( 'should return an ArrayBuffer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteLength', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteLength; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteOffset', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteOffset; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:length', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.length; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.of.js b/benchmark/benchmark.of.js deleted file mode 100644 index 84f00cd..0000000 --- a/benchmark/benchmark.of.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':of', function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 'little-endian', 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of.apply( Float64ArrayFE, buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.js b/benchmark/benchmark.set.js deleted file mode 100644 index f420d74..0000000 --- a/benchmark/benchmark.set.js +++ /dev/null @@ -1,209 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'little-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'big-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.length.js b/benchmark/benchmark.set.length.js deleted file mode 100644 index dff28fc..0000000 --- a/benchmark/benchmark.set.length.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var randu = require( '@stdlib/random-array-randu' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var values; - var arr1; - var arr2; - var arr3; - var N; - - arr1 = randu( len ); - arr2 = randu( len ); - arr3 = randu( len ); - arr1 = new Float64ArrayFE( 'little-endian', arr1 ); - - values = [ - new Float64ArrayFE( 'little-endian', arr2 ), - new Float64ArrayFE( 'big-endian', arr3 ) - ]; - N = values.length; - - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr1.set( values[ i%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); - } -} - -main(); diff --git a/benchmark/benchmark.to_string.js b/benchmark/benchmark.to_string.js deleted file mode 100644 index 42d0139..0000000 --- a/benchmark/benchmark.to_string.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':toString', function benchmark( b ) { - var out; - var arr; - var i; - - arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 2.0, 1.0 ] ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.to_string.length.js b/benchmark/benchmark.to_string.length.js deleted file mode 100644 index 72a1f2d..0000000 --- a/benchmark/benchmark.to_string.length.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var zeroTo = require( '@stdlib/array-zero-to' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) ); - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 193762e..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64" -%% click B href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/main" -%% click C href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/production" -%% click D href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm" -%% click E href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno" -%% click F href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64 -[production-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/production -[deno-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index f2f9958..0000000 --- a/dist/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict";var c=function(n,t){return function(){return t||n((t={exports:{}}).exports,t),t.exports}};var M=c(function(tr,S){"use strict";function J(n){var t,r;for(t=[];r=n.next(),!r.done;)t.push(r.value);return t}S.exports=J});var R=c(function(nr,O){"use strict";function K(n,t,r){var a,e,u;for(a=[],u=-1;e=n.next(),!e.done;)u+=1,a.push(t.call(r,e.value,u));return a}O.exports=K});var x=c(function(ar,k){"use strict";function Q(n,t,r){var a,e;for(a=t.length,e=0;ee.byteLength-n)throw new RangeError(s("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",u));e=new m(e,n,u)}}return y(this,"_buffer",e),y(this,"_length",e.byteLength/l),y(this,"_isLE",a),this}y(o,"BYTES_PER_ELEMENT",l);y(o,"name","Float64ArrayFE");y(o,"from",function(t,r){var a,e,u,i,h,f,g,b,F,w,v;if(!p(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!G(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(e=B(t),e===null||!L(e))throw new TypeError(s("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(h=D(e),u=arguments.length,u>2){if(i=arguments[2],!p(i))throw new TypeError(s("invalid argument. Third argument must be a function. Value: `%s`.",i));u>3&&(a=arguments[3])}if(q(r)){if(i){for(w=r.length,r.get&&r.set?F=P("default"):F=A("default"),f=new this(e,w),g=f._buffer,v=0;v=this._length))return this._buffer.getFloat64(t*l,this._isLE)});_(o.prototype,"length",function(){return this._length});y(o.prototype,"set",function(t){var r,a,e,u,i,h,f,g;if(!V(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(e=this._buffer,arguments.length>1){if(a=arguments[1],!E(a))throw new TypeError(s("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",a))}else a=0;if(q(t)){if(h=t.length,a+h>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,r.get&&r.set?i=P("default"):i=A("default"),g=e.byteOffset+a*l,r.buffer===e.buffer&&r.byteOffsetg){for(u=[],f=0;f=this._length)throw new RangeError(s("invalid argument. Index argument is out-of-bounds. Value: `%u`.",a));e.setFloat64(a*l,t,this._isLE)});y(o.prototype,"toString",function(){var t,r,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],r=this._buffer,a=0;a\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nmodule.exports = Float64ArrayFE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-float64\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\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_from_iterator", "__commonJSMin", "exports", "module", "fromIterator", "it", "out", "v", "require_from_iterator_map", "__commonJSMin", "exports", "module", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "i", "require_from_array", "__commonJSMin", "exports", "module", "fromArray", "view", "arr", "isLE", "len", "i", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isCollection", "isArrayBuffer", "isObject", "isFunction", "isString", "contains", "lowercase", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "setReadOnlyAccessor", "ArrayBuffer", "DataView", "getter", "accessorGetter", "format", "fromIterator", "fromIteratorMap", "fromArray", "BYTES_PER_ELEMENT", "HAS_ITERATOR_SYMBOL", "isByteOrder", "byteOrder", "value", "isLittleEndian", "isFloat64ArrayFEConstructor", "Float64ArrayFE", "isFloat64ArrayFE", "byteOffset", "endianness", "nargs", "isLE", "buf", "len", "arg", "tmp", "src", "thisArg", "order", "clbk", "out", "get", "i", "args", "idx", "sbuf", "N", "j", "main"] -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index fe5213c..0000000 --- a/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Float64Array = require( '@stdlib/array-float64' ); -var logEach = require( '@stdlib/console-log-each' ); -var Float64ArrayFE = require( './../lib' ); - -// Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); -logEach( '%s', out ); - -// Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; -out = new Float64ArrayFE( 'big-endian', arr ); -logEach( '%s', out ); - -// Create a typed array from an array buffer: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'little-endian', arr.buffer ); -logEach( '%s', out ); - -// Create a typed array from an array buffer view: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'big-endian', arr.buffer, 8, 2 ); -logEach( '%s', out ); diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..5210c5d --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import{isPrimitive as t}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-nonnegative-integer@v0.2.2-esm/index.mjs";import e from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-collection@v0.2.2-esm/index.mjs";import r from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-arraybuffer@v0.2.2-esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-object@v0.2.2-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-function@v0.2.2-esm/index.mjs";import{isPrimitive as i}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-string@v0.2.2-esm/index.mjs";import{factory as o}from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-assert-contains@v0.2.2-esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/string-base-lowercase@v0.4.0-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-has-iterator-symbol-support@v0.2.2-esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/symbol-iterator@v0.2.2-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-property@v0.2.1-esm/index.mjs";import u from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-accessor@v0.2.2-esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/array-buffer@v0.2.2-esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/array-dataview@v0.2.2-esm/index.mjs";import m from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-getter@v0.2.2-esm/index.mjs";import w from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-accessor-getter@v0.2.2-esm/index.mjs";import g from"https://cdn.jsdelivr.net/gh/stdlib-js/error-tools-fmtprodmsg@v0.2.2-esm/index.mjs";function y(t){var e,r;for(e=[];!(r=t.next()).done;)e.push(r.value);return e}function v(t,e,r){var n,s;for(n=e.length,s=0;su.byteLength-i)throw new RangeError(g("null2G",m));u=new p(u,i,m)}}return a(this,"_buffer",u),a(this,"_length",u.byteLength/b),a(this,"_isLE",f),this}a(x,"BYTES_PER_ELEMENT",b),a(x,"name","Float64ArrayFE"),a(x,"from",(function(t,r){var i,o,l,f,a,u,d,p,v,F,x;if(!s(this))throw new TypeError(g("null01"));if(!_(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(null===(o=j(t))||!c(o))throw new TypeError(g("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(a=T(o),(l=arguments.length)>2){if(!s(f=arguments[2]))throw new TypeError(g("null3N",f));l>3&&(i=arguments[3])}if(e(r)){if(f){for(F=r.length,v=r.get&&r.set?w("default"):m("default"),d=(u=new this(o,F))._buffer,x=0;x=this._length))return this._buffer.getFloat64(e*b,this._isLE)})),u(x.prototype,"length",(function(){return this._length})),a(x.prototype,"set",(function(r){var n,s,i,o,l,f,h,a;if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(i=this._buffer,arguments.length>1){if(!t(s=arguments[1]))throw new TypeError(g("null2L",s))}else s=0;if(e(r)){if(s+(f=r.length)>this._length)throw new RangeError(g("null03"));if(l=(n=r).get&&n.set?w("default"):m("default"),a=i.byteOffset+s*b,n.buffer===i.buffer&&n.byteOffseta){for(o=[],h=0;h=this._length)throw new RangeError(g("null2M",s));i.setFloat64(s*b,r,this._isLE)}})),a(x.prototype,"toString",(function(){var t,e,r;if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],e=this._buffer,r=0;r\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'null29', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'null2B', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'null2C', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2F', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'null2G', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'null3N', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'nullAt', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'nullAt', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'null2K', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'null2L', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( format('null03') );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'null2M', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( clbk.call( thisArg, v.value, i ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n"],"names":["fromIterator","it","out","v","next","done","push","value","fromArray","view","arr","isLE","len","i","length","setFloat64","BYTES_PER_ELEMENT","HAS_ITERATOR_SYMBOL","hasIteratorSymbolSupport","isByteOrder","contains","byteOrder","isString","lowercase","isLittleEndian","isFloat64ArrayFEConstructor","Float64ArrayFE","isFloat64ArrayFE","constructor","name","byteOffset","endianness","nargs","buf","arg","tmp","arguments","this","TypeError","format","DataView","ArrayBuffer","isNonNegativeInteger","isCollection","isArrayBuffer","isObject","isFunction","ITERATOR_SYMBOL","byteLength","RangeError","setReadOnly","src","thisArg","order","clbk","get","set","accessorGetter","getter","_buffer","call","fromIteratorMap","args","setReadOnlyAccessor","prototype","buffer","idx","_length","getFloat64","_isLE","sbuf","N","j","join"],"mappings":"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"} \ No newline at end of file diff --git a/lib/from_array.js b/lib/from_array.js deleted file mode 100644 index c8cfb23..0000000 --- a/lib/from_array.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Fills an output DataView with double-precision values. -* -* @private -* @param {DataView} view - output data view -* @param {Array} arr - input array -* @param {boolean} isLE - boolean indicating whether the store values in little-endian byte order -* @returns {DataView} output data view -*/ -function fromArray( view, arr, isLE ) { - var len; - var i; - - len = arr.length; - for ( i = 0; i < len; i++ ) { - view.setFloat64( i*8, arr[ i ], isLE ); // FIXME: handle accessor arrays, FIXME: avoid hardcoding bytes per element - } - return view; -} - - -// EXPORTS // - -module.exports = fromArray; diff --git a/lib/from_iterator.js b/lib/from_iterator.js deleted file mode 100644 index c1adb5d..0000000 --- a/lib/from_iterator.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Returns an array of iterated values. -* -* @private -* @param {Object} it - iterator -* @returns {Array} output array -*/ -function fromIterator( it ) { - var out; - var v; - - out = []; - while ( true ) { - v = it.next(); - if ( v.done ) { - break; - } - out.push( v.value ); - } - return out; -} - - -// EXPORTS // - -module.exports = fromIterator; diff --git a/lib/from_iterator_map.js b/lib/from_iterator_map.js deleted file mode 100644 index 9a6e354..0000000 --- a/lib/from_iterator_map.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Returns an array of iterated values. -* -* @private -* @param {Object} it - iterator -* @param {Function} clbk - callback to invoke for each iterated value -* @param {*} thisArg - invocation context -* @returns {Array} output array -*/ -function fromIteratorMap( it, clbk, thisArg ) { - var out; - var v; - var i; - - out = []; - i = -1; - while ( true ) { - v = it.next(); - if ( v.done ) { - break; - } - i += 1; - out.push( clbk.call( thisArg, v.value, i ) ); - } - return out; -} - - -// EXPORTS // - -module.exports = fromIteratorMap; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 2be932f..0000000 --- a/lib/index.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @module @stdlib/array-fixed-endian-float64 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 1391297..0000000 --- a/lib/main.js +++ /dev/null @@ -1,708 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-len, no-restricted-syntax, no-invalid-this */ - -'use strict'; - -// MODULES // - -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var isCollection = require( '@stdlib/assert-is-collection' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isObject = require( '@stdlib/assert-is-object' ); -var isFunction = require( '@stdlib/assert-is-function' ); -var isString = require( '@stdlib/assert-is-string' ).isPrimitive; -var contains = require( '@stdlib/array-base-assert-contains' ).factory; -var lowercase = require( '@stdlib/string-base-lowercase' ); -var hasIteratorSymbolSupport = require( '@stdlib/assert-has-iterator-symbol-support' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' ); -var setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var DataView = require( '@stdlib/array-dataview' ); -var getter = require( '@stdlib/array-base-getter' ); -var accessorGetter = require( '@stdlib/array-base-accessor-getter' ); -var format = require( '@stdlib/error-tools-fmtprodmsg' ); -var fromIterator = require( './from_iterator.js' ); -var fromIteratorMap = require( './from_iterator_map.js' ); -var fromArray = require( './from_array.js' ); - - -// VARIABLES // - -var BYTES_PER_ELEMENT = 8; // 8 bytes per double -var HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport(); -var isByteOrder = contains( [ 'little-endian', 'big-endian' ] ); - - -// FUNCTIONS // - -/** -* Normalizes a byte order value. -* -* @private -* @param {*} value - byte order -* @returns {(string|null)} normalized byte order -*/ -function byteOrder( value ) { - return ( isString( value ) ) ? lowercase( value ) : null; -} - -/** -* Tests whether a provided byte order is little-endian byte order. -* -* @private -* @param {string} value - byte order -* @returns {boolean} boolean indicating whether a byte order is little-endian byte order -*/ -function isLittleEndian( value ) { - return ( value === 'little-endian' ); -} - -/** -* Returns a boolean indicating if a value is a `Float64ArrayFE` constructor. -* -* @private -* @param {*} value - value to test -* @returns {boolean} boolean indicating if a value is a `Float64ArrayFE` constructor -*/ -function isFloat64ArrayFEConstructor( value ) { // eslint-disable-line id-length - return ( value === Float64ArrayFE ); -} - -/** -* Returns a boolean indicating if a value is a `Float64ArrayFE`. -* -* @private -* @param {*} value - value to test -* @returns {boolean} boolean indicating if a value is a `Float64ArrayFE` -*/ -function isFloat64ArrayFE( value ) { - return ( - typeof value === 'object' && - value !== null && - value.constructor.name === 'Float64ArrayFE' && - value.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT - ); -} - - -// MAIN // - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @constructor -* @param {string} endianness - byte order -* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable -* @param {NonNegativeInteger} [byteOffset=0] - byte offset -* @param {NonNegativeInteger} [length] - view length -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument -* @throws {TypeError} byte offset must be a nonnegative integer -* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -function Float64ArrayFE() { - var byteOffset; - var endianness; - var nargs; - var isLE; - var buf; - var len; - var arg; - var tmp; - - nargs = arguments.length; - if ( !(this instanceof Float64ArrayFE) ) { - if ( nargs < 2 ) { - return new Float64ArrayFE( arguments[0] ); - } - if ( nargs === 2 ) { - return new Float64ArrayFE( arguments[0], arguments[1] ); - } - if ( nargs === 3 ) { - return new Float64ArrayFE( arguments[0], arguments[1], arguments[2] ); - } - return new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] ); - } - endianness = byteOrder( arguments[ 0 ] ); - if ( endianness === null || !isByteOrder( endianness ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) ); - } - isLE = isLittleEndian( endianness ); - - nargs -= 1; - - // Create the underlying data buffer... - if ( nargs === 0 ) { - buf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility - } else if ( nargs === 1 ) { - arg = arguments[ nargs ]; - if ( isNonNegativeInteger( arg ) ) { - buf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) ); - } else if ( isCollection( arg ) ) { - buf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE ); - } else if ( isArrayBuffer( arg ) ) { - buf = new DataView( arg ); - } else if ( isObject( arg ) ) { - if ( HAS_ITERATOR_SYMBOL === false ) { - throw new TypeError( format( 'null29', arg ) ); - } - if ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) { - throw new TypeError( format( 'null2A', arg ) ); - } - buf = arg[ ITERATOR_SYMBOL ](); - if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'null2A', arg ) ); - } - tmp = fromIterator( buf ); - buf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE ); - } else { - throw new TypeError( format( 'null2A', arg ) ); - } - } else { - buf = arguments[ 1 ]; - if ( !isArrayBuffer( buf ) ) { - throw new TypeError( format( 'null2B', buf ) ); - } - byteOffset = arguments[ 2 ]; - if ( !isNonNegativeInteger( byteOffset ) ) { - throw new TypeError( format( 'null2C', byteOffset ) ); - } - if ( nargs === 2 ) { - buf = new DataView( buf, byteOffset ); - } else { - len = arguments[ 3 ]; - if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'null2F', len ) ); - } - len *= BYTES_PER_ELEMENT; - if ( len > (buf.byteLength-byteOffset) ) { - throw new RangeError( format( 'null2G', len ) ); - } - buf = new DataView( buf, byteOffset, len ); - } - } - setReadOnly( this, '_buffer', buf ); - setReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT ); - setReadOnly( this, '_isLE', isLE ); - - return this; -} - -/** -* Size (in bytes) of each array element. -* -* @name BYTES_PER_ELEMENT -* @memberof Float64ArrayFE -* @readonly -* @type {PositiveInteger} -* @default 8 -* -* @example -* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; -* // returns 8 -*/ -setReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT ); - -/** -* Constructor name. -* -* @name name -* @memberof Float64ArrayFE -* @readonly -* @type {string} -* @default 'Float64ArrayFE' -* -* @example -* var str = Float64ArrayFE.name; -* // returns 'Float64ArrayFE' -*/ -setReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' ); - -/** -* Creates a new `Float64ArrayFE` from an array-like object or an iterable. -* -* @name from -* @memberof Float64ArrayFE -* @type {Function} -* @param {string} endianness - byte order -* @param {(Collection|Iterable)} src - array-like object or iterable -* @param {Function} [clbk] - callback to invoke for each source element -* @param {*} [thisArg] - context -* @throws {TypeError} `this` context must be a constructor -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} second argument must be an array-like object or an iterable -* @throws {TypeError} third argument must be a function -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* function clbk( v ) { -* return v * 2.0; -* } -* -* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { - var thisArg; - var order; - var nargs; - var clbk; - var isLE; - var out; - var buf; - var tmp; - var get; - var len; - var i; - if ( !isFunction( this ) ) { - throw new TypeError( format('null01') ); - } - if ( !isFloat64ArrayFEConstructor( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - order = byteOrder( endianness ); - if ( order === null || !isByteOrder( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) ); - } - isLE = isLittleEndian( order ); - - nargs = arguments.length; - if ( nargs > 2 ) { - clbk = arguments[ 2 ]; - if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'null3N', clbk ) ); - } - if ( nargs > 3 ) { - thisArg = arguments[ 3 ]; - } - } - if ( isCollection( src ) ) { - if ( clbk ) { - len = src.length; - if ( src.get && src.set ) { - get = accessorGetter( 'default' ); - } else { - get = getter( 'default' ); - } - out = new this( order, len ); - buf = out._buffer; // eslint-disable-line no-underscore-dangle - for ( i = 0; i < len; i++ ) { - buf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE ); - } - return out; - } - return new this( order, src ); - } - if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { - buf = src[ ITERATOR_SYMBOL ](); - if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'nullAt', src ) ); - } - if ( clbk ) { - tmp = fromIteratorMap( buf, clbk, thisArg ); - } else { - tmp = fromIterator( buf ); - } - len = tmp.length; - out = new this( order, len ); - buf = out._buffer; // eslint-disable-line no-underscore-dangle - for ( i = 0; i < len; i++ ) { - buf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE ); - } - return out; - } - throw new TypeError( format( 'nullAt', src ) ); -}); - -/** -* Creates a new `Float64ArrayFE` from a variable number of arguments. -* -* @name of -* @memberof Float64ArrayFE -* @type {Function} -* @param {string} endianness - byte order -* @param {...*} element - array elements -* @throws {TypeError} `this` context must be a constructor -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} first argument must be a supported byte order -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 ); -* // returns -* -* var len = arr.length; -* // returns 4 -*/ -setReadOnly( Float64ArrayFE, 'of', function of( endianness ) { - var order; - var args; - var i; - if ( !isFunction( this ) ) { - throw new TypeError( format('null01') ); - } - if ( !isFloat64ArrayFEConstructor( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - order = byteOrder( endianness ); - if ( order === null || !isByteOrder( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) ); - } - args = []; - for ( i = 1; i < arguments.length; i++ ) { - args.push( arguments[ i ] ); - } - return new this( order, args ); -}); - -/** -* Pointer to the underlying data buffer. -* -* @name buffer -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {ArrayBuffer} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var buf = arr.buffer; -* // returns -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() { - return this._buffer.buffer; -}); - -/** -* Size (in bytes) of the array. -* -* @name byteLength -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var byteLength = arr.byteLength; -* // returns 80 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() { - return this._buffer.byteLength; -}); - -/** -* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`. -* -* @name byteOffset -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var byteOffset = arr.byteOffset; -* // returns 0 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() { - return this._buffer.byteOffset; -}); - -/** -* Size (in bytes) of each array element. -* -* @name BYTES_PER_ELEMENT -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {PositiveInteger} -* @default 8 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var nbytes = arr.BYTES_PER_ELEMENT; -* // returns 8 -*/ -setReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT ); - -/** -* Returns an array element. -* -* @name get -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @param {NonNegativeInteger} idx - element index -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} must provide a nonnegative integer -* @returns {(number|void)} array element -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var v = arr.get( 0 ); -* // returns 0.0 -* -* arr.set( [ 1.0, 2.0 ], 0 ); -* -* v = arr.get( 0 ); -* // returns 1.0 -* -* v = arr.get( 100 ); -* // returns undefined -*/ -setReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) { - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'null2K', idx ) ); - } - if ( idx >= this._length ) { - return; - } - return this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE ); -}); - -/** -* Number of array elements. -* -* @name length -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var len = arr.length; -* // returns 10 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() { - return this._length; -}); - -/** -* Sets an array element. -* -* ## Notes -* -* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario: -* -* ```text -* buf: --------------------- -* src: --------------------- -* ``` -* -* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array. -* -* In the other overlapping scenario, -* -* ```text -* buf: --------------------- -* src: --------------------- -* ``` -* -* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended. -* -* @name set -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @param {(Collection|Float64ArrayFE|*)} value - value(s) -* @param {NonNegativeInteger} [i=0] - element index at which to start writing values -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} index argument must be a nonnegative integer -* @throws {RangeError} index argument is out-of-bounds -* @throws {RangeError} target array lacks sufficient storage to accommodate source values -* @returns {void} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var v = arr.get( 0 ); -* // returns 0.0 -* -* arr.set( [ 1.0, 2.0 ], 0 ); -* -* v = arr.get( 0 ); -* // returns 1.0 -*/ -setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { - var sbuf; - var idx; - var buf; - var tmp; - var get; - var N; - var i; - var j; - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - buf = this._buffer; - if ( arguments.length > 1 ) { - idx = arguments[ 1 ]; - if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'null2L', idx ) ); - } - } else { - idx = 0; - } - if ( isCollection( value ) ) { - N = value.length; - if ( idx+N > this._length ) { - throw new RangeError( format('null03') ); - } - sbuf = value; - if ( sbuf.get && sbuf.set ) { - get = accessorGetter( 'default' ); - } else { - get = getter( 'default' ); - } - // Check for overlapping memory... - j = buf.byteOffset + (idx*BYTES_PER_ELEMENT); - if ( - sbuf.buffer === buf.buffer && - ( - sbuf.byteOffset < j && - sbuf.byteOffset+sbuf.byteLength > j - ) - ) { - // We need to copy source values... - tmp = []; - for ( i = 0; i < value.length; i++ ) { - tmp.push( get( value, i ) ); - } - sbuf = tmp; - get = getter( 'default' ); - } - for ( i = 0; i < N; idx++, i++ ) { - buf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE ); - } - return; - } - if ( idx >= this._length ) { - throw new RangeError( format( 'null2M', idx ) ); - } - buf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE ); -}); - -/** -* Serializes an array as a string. -* -* @name toString -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @throws {TypeError} `this` must be a Float64ArrayFE -* @returns {string} string representation -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 3 ); -* -* arr.set( 1.0, 0 ); -* arr.set( 2.0, 1 ); -* arr.set( 3.0, 2 ); -* -* var str = arr.toString(); -* // returns '1,2,3' -*/ -setReadOnly( Float64ArrayFE.prototype, 'toString', function toString() { - var out; - var buf; - var i; - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - out = []; - buf = this._buffer; - for ( i = 0; i < this._length; i++ ) { - out.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) ); - } - return out.join( ',' ); -}); - - -// EXPORTS // - -module.exports = Float64ArrayFE; diff --git a/package.json b/package.json index 33cf006..aa208db 100644 --- a/package.json +++ b/package.json @@ -3,31 +3,8 @@ "version": "0.0.0", "description": "Float64ArrayFE.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "doc": "./docs", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -36,53 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-accessor-getter": "^0.2.2", - "@stdlib/array-base-assert-contains": "^0.2.2", - "@stdlib/array-base-getter": "^0.2.2", - "@stdlib/array-buffer": "^0.2.2", - "@stdlib/array-dataview": "^0.2.2", - "@stdlib/assert-has-iterator-symbol-support": "^0.2.2", - "@stdlib/assert-is-arraybuffer": "^0.2.2", - "@stdlib/assert-is-collection": "^0.2.2", - "@stdlib/assert-is-function": "^0.2.2", - "@stdlib/assert-is-nonnegative-integer": "^0.2.2", - "@stdlib/assert-is-object": "^0.2.2", - "@stdlib/assert-is-string": "^0.2.2", - "@stdlib/string-base-lowercase": "^0.4.0", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2", - "@stdlib/symbol-iterator": "^0.2.2", - "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.3", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/array-float64": "^0.2.2", - "@stdlib/array-zero-to": "^0.2.2", - "@stdlib/assert-is-number": "^0.2.2", - "@stdlib/console-log-each": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/random-array-randu": "^0.2.1", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..1ac5d3c --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index fc72bbf..0000000 --- a/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF 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 ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -// TODO: add tests From f4b3d2168fcaefe95a7a5b5b35df567fbecd613a Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 22 Sep 2024 02:05:04 +0000 Subject: [PATCH 03/22] Transform error messages --- lib/main.js | 36 ++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/main.js b/lib/main.js index fc510be..1391297 100644 --- a/lib/main.js +++ b/lib/main.js @@ -38,7 +38,7 @@ var ArrayBuffer = require( '@stdlib/array-buffer' ); var DataView = require( '@stdlib/array-dataview' ); var getter = require( '@stdlib/array-base-getter' ); var accessorGetter = require( '@stdlib/array-base-accessor-getter' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); var fromIterator = require( './from_iterator.js' ); var fromIteratorMap = require( './from_iterator_map.js' ); var fromArray = require( './from_array.js' ); @@ -214,39 +214,39 @@ function Float64ArrayFE() { buf = new DataView( arg ); } else if ( isObject( arg ) ) { if ( HAS_ITERATOR_SYMBOL === false ) { - throw new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null29', arg ) ); } if ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } buf = arg[ ITERATOR_SYMBOL ](); if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } tmp = fromIterator( buf ); buf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE ); } else { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } } else { buf = arguments[ 1 ]; if ( !isArrayBuffer( buf ) ) { - throw new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) ); + throw new TypeError( format( 'null2B', buf ) ); } byteOffset = arguments[ 2 ]; if ( !isNonNegativeInteger( byteOffset ) ) { - throw new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) ); + throw new TypeError( format( 'null2C', byteOffset ) ); } if ( nargs === 2 ) { buf = new DataView( buf, byteOffset ); } else { len = arguments[ 3 ]; if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) ); + throw new TypeError( format( 'null2F', len ) ); } len *= BYTES_PER_ELEMENT; if ( len > (buf.byteLength-byteOffset) ) { - throw new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len ) ); + throw new RangeError( format( 'null2G', len ) ); } buf = new DataView( buf, byteOffset, len ); } @@ -336,7 +336,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { var len; var i; if ( !isFunction( this ) ) { - throw new TypeError( 'invalid invocation. `this` context must be a constructor.' ); + throw new TypeError( format('null01') ); } if ( !isFloat64ArrayFEConstructor( this ) ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); @@ -351,7 +351,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { if ( nargs > 2 ) { clbk = arguments[ 2 ]; if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) ); + throw new TypeError( format( 'null3N', clbk ) ); } if ( nargs > 3 ) { thisArg = arguments[ 3 ]; @@ -377,7 +377,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { buf = src[ ITERATOR_SYMBOL ](); if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) ); + throw new TypeError( format( 'nullAt', src ) ); } if ( clbk ) { tmp = fromIteratorMap( buf, clbk, thisArg ); @@ -392,7 +392,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { } return out; } - throw new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) ); + throw new TypeError( format( 'nullAt', src ) ); }); /** @@ -420,7 +420,7 @@ setReadOnly( Float64ArrayFE, 'of', function of( endianness ) { var args; var i; if ( !isFunction( this ) ) { - throw new TypeError( 'invalid invocation. `this` context must be a constructor.' ); + throw new TypeError( format('null01') ); } if ( !isFloat64ArrayFEConstructor( this ) ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); @@ -537,7 +537,7 @@ setReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); } if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) ); + throw new TypeError( format( 'null2K', idx ) ); } if ( idx >= this._length ) { return; @@ -624,7 +624,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { if ( arguments.length > 1 ) { idx = arguments[ 1 ]; if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) ); + throw new TypeError( format( 'null2L', idx ) ); } } else { idx = 0; @@ -632,7 +632,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { if ( isCollection( value ) ) { N = value.length; if ( idx+N > this._length ) { - throw new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' ); + throw new RangeError( format('null03') ); } sbuf = value; if ( sbuf.get && sbuf.set ) { @@ -663,7 +663,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { return; } if ( idx >= this._length ) { - throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) ); + throw new RangeError( format( 'null2M', idx ) ); } buf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE ); }); diff --git a/package.json b/package.json index 6791031..2acb8d7 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "@stdlib/assert-is-object": "^0.2.2", "@stdlib/assert-is-string": "^0.2.2", "@stdlib/string-base-lowercase": "^0.4.0", - "@stdlib/string-format": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", "@stdlib/symbol-iterator": "^0.2.2", "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.3", "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", From ed8cb1ca0281f5cc55d8ce912d9d1bfdf74004fc Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 22 Sep 2024 02:05:27 +0000 Subject: [PATCH 04/22] Remove files --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 3 files changed, 4847 deletions(-) delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 5210c5d..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import{isPrimitive as t}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-nonnegative-integer@v0.2.2-esm/index.mjs";import e from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-collection@v0.2.2-esm/index.mjs";import r from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-arraybuffer@v0.2.2-esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-object@v0.2.2-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-function@v0.2.2-esm/index.mjs";import{isPrimitive as i}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-string@v0.2.2-esm/index.mjs";import{factory as o}from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-assert-contains@v0.2.2-esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/string-base-lowercase@v0.4.0-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-has-iterator-symbol-support@v0.2.2-esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/symbol-iterator@v0.2.2-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-property@v0.2.1-esm/index.mjs";import u from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-accessor@v0.2.2-esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/array-buffer@v0.2.2-esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/array-dataview@v0.2.2-esm/index.mjs";import m from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-getter@v0.2.2-esm/index.mjs";import w from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-accessor-getter@v0.2.2-esm/index.mjs";import g from"https://cdn.jsdelivr.net/gh/stdlib-js/error-tools-fmtprodmsg@v0.2.2-esm/index.mjs";function y(t){var e,r;for(e=[];!(r=t.next()).done;)e.push(r.value);return e}function v(t,e,r){var n,s;for(n=e.length,s=0;su.byteLength-i)throw new RangeError(g("null2G",m));u=new p(u,i,m)}}return a(this,"_buffer",u),a(this,"_length",u.byteLength/b),a(this,"_isLE",f),this}a(x,"BYTES_PER_ELEMENT",b),a(x,"name","Float64ArrayFE"),a(x,"from",(function(t,r){var i,o,l,f,a,u,d,p,v,F,x;if(!s(this))throw new TypeError(g("null01"));if(!_(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(null===(o=j(t))||!c(o))throw new TypeError(g("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(a=T(o),(l=arguments.length)>2){if(!s(f=arguments[2]))throw new TypeError(g("null3N",f));l>3&&(i=arguments[3])}if(e(r)){if(f){for(F=r.length,v=r.get&&r.set?w("default"):m("default"),d=(u=new this(o,F))._buffer,x=0;x=this._length))return this._buffer.getFloat64(e*b,this._isLE)})),u(x.prototype,"length",(function(){return this._length})),a(x.prototype,"set",(function(r){var n,s,i,o,l,f,h,a;if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(i=this._buffer,arguments.length>1){if(!t(s=arguments[1]))throw new TypeError(g("null2L",s))}else s=0;if(e(r)){if(s+(f=r.length)>this._length)throw new RangeError(g("null03"));if(l=(n=r).get&&n.set?w("default"):m("default"),a=i.byteOffset+s*b,n.buffer===i.buffer&&n.byteOffseta){for(o=[],h=0;h=this._length)throw new RangeError(g("null2M",s));i.setFloat64(s*b,r,this._isLE)}})),a(x.prototype,"toString",(function(){var t,e,r;if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],e=this._buffer,r=0;r\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'null29', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'null2B', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'null2C', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2F', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'null2G', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'null3N', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'nullAt', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'nullAt', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'null2K', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'null2L', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( format('null03') );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'null2M', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( clbk.call( thisArg, v.value, i ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n"],"names":["fromIterator","it","out","v","next","done","push","value","fromArray","view","arr","isLE","len","i","length","setFloat64","BYTES_PER_ELEMENT","HAS_ITERATOR_SYMBOL","hasIteratorSymbolSupport","isByteOrder","contains","byteOrder","isString","lowercase","isLittleEndian","isFloat64ArrayFEConstructor","Float64ArrayFE","isFloat64ArrayFE","constructor","name","byteOffset","endianness","nargs","buf","arg","tmp","arguments","this","TypeError","format","DataView","ArrayBuffer","isNonNegativeInteger","isCollection","isArrayBuffer","isObject","isFunction","ITERATOR_SYMBOL","byteLength","RangeError","setReadOnly","src","thisArg","order","clbk","get","set","accessorGetter","getter","_buffer","call","fromIteratorMap","args","setReadOnlyAccessor","prototype","buffer","idx","_length","getFloat64","_isLE","sbuf","N","j","join"],"mappings":"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"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 1ac5d3c..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From a973155158ac94251ae813dcc83fabdda309a95f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 22 Sep 2024 02:05:46 +0000 Subject: [PATCH 05/22] 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 | 51 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 51 +- SECURITY.md | 5 - benchmark/benchmark.from.js | 310 -- benchmark/benchmark.get.js | 85 - benchmark/benchmark.js | 533 --- benchmark/benchmark.of.js | 69 - benchmark/benchmark.set.js | 209 - benchmark/benchmark.set.length.js | 110 - benchmark/benchmark.to_string.js | 50 - benchmark/benchmark.to_string.length.js | 94 - branches.md | 56 - dist/index.js | 19 - dist/index.js.map | 7 - examples/index.js | 42 - index.mjs | 4 + index.mjs.map | 1 + lib/from_array.js | 46 - lib/from_iterator.js | 48 - lib/from_iterator_map.js | 53 - lib/index.js | 94 - lib/main.js | 708 --- package.json | 73 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 35 - 48 files changed, 4870 insertions(+), 5933 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.from.js delete mode 100644 benchmark/benchmark.get.js delete mode 100644 benchmark/benchmark.js delete mode 100644 benchmark/benchmark.of.js delete mode 100644 benchmark/benchmark.set.js delete mode 100644 benchmark/benchmark.set.length.js delete mode 100644 benchmark/benchmark.to_string.js delete mode 100644 benchmark/benchmark.to_string.length.js delete mode 100644 branches.md delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 examples/index.js create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/from_array.js delete mode 100644 lib/from_iterator.js delete mode 100644 lib/from_iterator_map.js delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9acabc8..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/fixed-endian-float64) 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 54acaa3..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/fixed-endian-float64) 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 9b5400f..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 2 * * 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 + + ```
@@ -468,7 +459,7 @@ logEach( '%s', out ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -531,13 +522,13 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-fixed-endian-float64/main/LICENSE -[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed +[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed/tree/esm -[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer +[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer/tree/esm -[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory +[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory/tree/esm -[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64 +[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64/tree/esm
diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.from.js b/benchmark/benchmark.from.js deleted file mode 100644 index cf3e838..0000000 --- a/benchmark/benchmark.from.js +++ /dev/null @@ -1,310 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// MAIN // - -bench( pkg+'::typed_array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 'little-endian', 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::iterable:from', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } - } -}); - -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } -}); - -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable(), clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } - - function clbk( v ) { - return v * 2.0; - } -}); diff --git a/benchmark/benchmark.get.js b/benchmark/benchmark.get.js deleted file mode 100644 index 764daf1..0000000 --- a/benchmark/benchmark.get.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js deleted file mode 100644 index 1c5c261..0000000 --- a/benchmark/benchmark.js +++ /dev/null @@ -1,533 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2018 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var Float64Array = require( '@stdlib/array-float64' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// FUNCTIONS // - -/** -* Returns an "iterable" object. -* -* @private -* @returns {Object} iterable object -*/ -function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } -} - - -// MAIN // - -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:buffer', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.buffer; - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArrayBuffer( v ) ) { - b.fail( 'should return an ArrayBuffer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteLength', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteLength; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteOffset', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteOffset; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:length', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.length; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.of.js b/benchmark/benchmark.of.js deleted file mode 100644 index 84f00cd..0000000 --- a/benchmark/benchmark.of.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':of', function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 'little-endian', 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of.apply( Float64ArrayFE, buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.js b/benchmark/benchmark.set.js deleted file mode 100644 index f420d74..0000000 --- a/benchmark/benchmark.set.js +++ /dev/null @@ -1,209 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'little-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'big-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.length.js b/benchmark/benchmark.set.length.js deleted file mode 100644 index dff28fc..0000000 --- a/benchmark/benchmark.set.length.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var randu = require( '@stdlib/random-array-randu' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var values; - var arr1; - var arr2; - var arr3; - var N; - - arr1 = randu( len ); - arr2 = randu( len ); - arr3 = randu( len ); - arr1 = new Float64ArrayFE( 'little-endian', arr1 ); - - values = [ - new Float64ArrayFE( 'little-endian', arr2 ), - new Float64ArrayFE( 'big-endian', arr3 ) - ]; - N = values.length; - - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr1.set( values[ i%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); - } -} - -main(); diff --git a/benchmark/benchmark.to_string.js b/benchmark/benchmark.to_string.js deleted file mode 100644 index 42d0139..0000000 --- a/benchmark/benchmark.to_string.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':toString', function benchmark( b ) { - var out; - var arr; - var i; - - arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 2.0, 1.0 ] ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.to_string.length.js b/benchmark/benchmark.to_string.length.js deleted file mode 100644 index 72a1f2d..0000000 --- a/benchmark/benchmark.to_string.length.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var zeroTo = require( '@stdlib/array-zero-to' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) ); - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 193762e..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64" -%% click B href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/main" -%% click C href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/production" -%% click D href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm" -%% click E href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno" -%% click F href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64 -[production-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/production -[deno-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index f2f9958..0000000 --- a/dist/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict";var c=function(n,t){return function(){return t||n((t={exports:{}}).exports,t),t.exports}};var M=c(function(tr,S){"use strict";function J(n){var t,r;for(t=[];r=n.next(),!r.done;)t.push(r.value);return t}S.exports=J});var R=c(function(nr,O){"use strict";function K(n,t,r){var a,e,u;for(a=[],u=-1;e=n.next(),!e.done;)u+=1,a.push(t.call(r,e.value,u));return a}O.exports=K});var x=c(function(ar,k){"use strict";function Q(n,t,r){var a,e;for(a=t.length,e=0;ee.byteLength-n)throw new RangeError(s("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",u));e=new m(e,n,u)}}return y(this,"_buffer",e),y(this,"_length",e.byteLength/l),y(this,"_isLE",a),this}y(o,"BYTES_PER_ELEMENT",l);y(o,"name","Float64ArrayFE");y(o,"from",function(t,r){var a,e,u,i,h,f,g,b,F,w,v;if(!p(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!G(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(e=B(t),e===null||!L(e))throw new TypeError(s("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(h=D(e),u=arguments.length,u>2){if(i=arguments[2],!p(i))throw new TypeError(s("invalid argument. Third argument must be a function. Value: `%s`.",i));u>3&&(a=arguments[3])}if(q(r)){if(i){for(w=r.length,r.get&&r.set?F=P("default"):F=A("default"),f=new this(e,w),g=f._buffer,v=0;v=this._length))return this._buffer.getFloat64(t*l,this._isLE)});_(o.prototype,"length",function(){return this._length});y(o.prototype,"set",function(t){var r,a,e,u,i,h,f,g;if(!V(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(e=this._buffer,arguments.length>1){if(a=arguments[1],!E(a))throw new TypeError(s("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",a))}else a=0;if(q(t)){if(h=t.length,a+h>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,r.get&&r.set?i=P("default"):i=A("default"),g=e.byteOffset+a*l,r.buffer===e.buffer&&r.byteOffsetg){for(u=[],f=0;f=this._length)throw new RangeError(s("invalid argument. Index argument is out-of-bounds. Value: `%u`.",a));e.setFloat64(a*l,t,this._isLE)});y(o.prototype,"toString",function(){var t,r,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],r=this._buffer,a=0;a\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. First argument must be an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nmodule.exports = Float64ArrayFE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-float64\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\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_from_iterator", "__commonJSMin", "exports", "module", "fromIterator", "it", "out", "v", "require_from_iterator_map", "__commonJSMin", "exports", "module", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "i", "require_from_array", "__commonJSMin", "exports", "module", "fromArray", "view", "arr", "isLE", "len", "i", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isCollection", "isArrayBuffer", "isObject", "isFunction", "isString", "contains", "lowercase", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "setReadOnlyAccessor", "ArrayBuffer", "DataView", "getter", "accessorGetter", "format", "fromIterator", "fromIteratorMap", "fromArray", "BYTES_PER_ELEMENT", "HAS_ITERATOR_SYMBOL", "isByteOrder", "byteOrder", "value", "isLittleEndian", "isFloat64ArrayFEConstructor", "Float64ArrayFE", "isFloat64ArrayFE", "byteOffset", "endianness", "nargs", "isLE", "buf", "len", "arg", "tmp", "src", "thisArg", "order", "clbk", "out", "get", "i", "args", "idx", "sbuf", "N", "j", "main"] -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index fe5213c..0000000 --- a/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Float64Array = require( '@stdlib/array-float64' ); -var logEach = require( '@stdlib/console-log-each' ); -var Float64ArrayFE = require( './../lib' ); - -// Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); -logEach( '%s', out ); - -// Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; -out = new Float64ArrayFE( 'big-endian', arr ); -logEach( '%s', out ); - -// Create a typed array from an array buffer: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'little-endian', arr.buffer ); -logEach( '%s', out ); - -// Create a typed array from an array buffer view: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'big-endian', arr.buffer, 8, 2 ); -logEach( '%s', out ); diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..5210c5d --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import{isPrimitive as t}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-nonnegative-integer@v0.2.2-esm/index.mjs";import e from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-collection@v0.2.2-esm/index.mjs";import r from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-arraybuffer@v0.2.2-esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-object@v0.2.2-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-function@v0.2.2-esm/index.mjs";import{isPrimitive as i}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-string@v0.2.2-esm/index.mjs";import{factory as o}from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-assert-contains@v0.2.2-esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/string-base-lowercase@v0.4.0-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-has-iterator-symbol-support@v0.2.2-esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/symbol-iterator@v0.2.2-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-property@v0.2.1-esm/index.mjs";import u from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-accessor@v0.2.2-esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/array-buffer@v0.2.2-esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/array-dataview@v0.2.2-esm/index.mjs";import m from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-getter@v0.2.2-esm/index.mjs";import w from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-accessor-getter@v0.2.2-esm/index.mjs";import g from"https://cdn.jsdelivr.net/gh/stdlib-js/error-tools-fmtprodmsg@v0.2.2-esm/index.mjs";function y(t){var e,r;for(e=[];!(r=t.next()).done;)e.push(r.value);return e}function v(t,e,r){var n,s;for(n=e.length,s=0;su.byteLength-i)throw new RangeError(g("null2G",m));u=new p(u,i,m)}}return a(this,"_buffer",u),a(this,"_length",u.byteLength/b),a(this,"_isLE",f),this}a(x,"BYTES_PER_ELEMENT",b),a(x,"name","Float64ArrayFE"),a(x,"from",(function(t,r){var i,o,l,f,a,u,d,p,v,F,x;if(!s(this))throw new TypeError(g("null01"));if(!_(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(null===(o=j(t))||!c(o))throw new TypeError(g("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(a=T(o),(l=arguments.length)>2){if(!s(f=arguments[2]))throw new TypeError(g("null3N",f));l>3&&(i=arguments[3])}if(e(r)){if(f){for(F=r.length,v=r.get&&r.set?w("default"):m("default"),d=(u=new this(o,F))._buffer,x=0;x=this._length))return this._buffer.getFloat64(e*b,this._isLE)})),u(x.prototype,"length",(function(){return this._length})),a(x.prototype,"set",(function(r){var n,s,i,o,l,f,h,a;if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(i=this._buffer,arguments.length>1){if(!t(s=arguments[1]))throw new TypeError(g("null2L",s))}else s=0;if(e(r)){if(s+(f=r.length)>this._length)throw new RangeError(g("null03"));if(l=(n=r).get&&n.set?w("default"):m("default"),a=i.byteOffset+s*b,n.buffer===i.buffer&&n.byteOffseta){for(o=[],h=0;h=this._length)throw new RangeError(g("null2M",s));i.setFloat64(s*b,r,this._isLE)}})),a(x.prototype,"toString",(function(){var t,e,r;if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],e=this._buffer,r=0;r\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'null29', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'null2B', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'null2C', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2F', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'null2G', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'null3N', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'nullAt', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'nullAt', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'null2K', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'null2L', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( format('null03') );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'null2M', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( clbk.call( thisArg, v.value, i ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n"],"names":["fromIterator","it","out","v","next","done","push","value","fromArray","view","arr","isLE","len","i","length","setFloat64","BYTES_PER_ELEMENT","HAS_ITERATOR_SYMBOL","hasIteratorSymbolSupport","isByteOrder","contains","byteOrder","isString","lowercase","isLittleEndian","isFloat64ArrayFEConstructor","Float64ArrayFE","isFloat64ArrayFE","constructor","name","byteOffset","endianness","nargs","buf","arg","tmp","arguments","this","TypeError","format","DataView","ArrayBuffer","isNonNegativeInteger","isCollection","isArrayBuffer","isObject","isFunction","ITERATOR_SYMBOL","byteLength","RangeError","setReadOnly","src","thisArg","order","clbk","get","set","accessorGetter","getter","_buffer","call","fromIteratorMap","args","setReadOnlyAccessor","prototype","buffer","idx","_length","getFloat64","_isLE","sbuf","N","j","join"],"mappings":";;irDA6BA,SAASA,EAAcC,GACtB,IAAIC,EACAC,EAGJ,IADAD,EAAM,KAELC,EAAIF,EAAGG,QACAC,MAGPH,EAAII,KAAMH,EAAEI,OAEb,OAAOL,CACR,CCXA,SAASM,EAAWC,EAAMC,EAAKC,GAC9B,IAAIC,EACAC,EAGJ,IADAD,EAAMF,EAAII,OACJD,EAAI,EAAGA,EAAID,EAAKC,IACrBJ,EAAKM,WAAc,EAAFF,EAAKH,EAAKG,GAAKF,GAEjC,OAAOF,CACR,CCQA,IAAAO,EAAA,EACAC,EAAAC,IACAC,EAAAC,EAAA,CAAA,gBAAA,eAYA,SAAAC,EAAAd,GACA,OAAAe,EAAAf,GAAAgB,EAAAhB,GAAA,IACA,CASA,SAAAiB,EAAAjB,GACA,MAAA,kBAAAA,CACA,CASA,SAAAkB,EAAAlB,GACA,OAAAA,IAAAmB,CACA,CASA,SAAAC,EAAApB,GACA,MACA,iBAAAA,GACA,OAAAA,GACA,mBAAAA,EAAAqB,YAAAC,MACAtB,EAAAS,oBAAAA,CAEA,CAsEA,SAAAU,IACA,IAAAI,EACAC,EACAC,EACArB,EACAsB,EACArB,EACAsB,EACAC,EAGA,GADAH,EAAAI,UAAAtB,SACAuB,gBAAAX,GACA,OAAAM,EAAA,EACA,IAAAN,EAAAU,UAAA,IAEA,IAAAJ,EACA,IAAAN,EAAAU,UAAA,GAAAA,UAAA,IAEA,IAAAJ,EACA,IAAAN,EAAAU,UAAA,GAAAA,UAAA,GAAAA,UAAA,IAEA,IAAAV,EAAAU,UAAA,GAAAA,UAAA,GAAAA,UAAA,GAAAA,UAAA,IAGA,GAAA,QADAL,EAAAV,EAAAe,UAAA,OACAjB,EAAAY,GACA,MAAA,IAAAO,UAAAC,EAAA,gFAAAH,UAAA,KAOA,GALAzB,EAAAa,EAAAO,GAKA,KAHAC,GAAA,GAIAC,EAAA,IAAAO,EAAA,IAAAC,EAAA,SACA,GAAA,IAAAT,EAEA,GAAAU,EADAR,EAAAE,UAAAJ,IAEAC,EAAA,IAAAO,EAAA,IAAAC,EAAAP,EAAAlB,SACA,GAAA2B,EAAAT,GACAD,EAAAzB,EAAA,IAAAgC,EAAA,IAAAC,EAAAP,EAAApB,OAAAE,IAAAkB,EAAAvB,QACA,GAAAiC,EAAAV,GACAD,EAAA,IAAAO,EAAAN,OACA,KAAAW,EAAAX,GAcA,MAAA,IAAAI,UAAAC,EAAA,SAAAL,IAbA,IAAA,IAAAjB,EACA,MAAA,IAAAqB,UAAAC,EAAA,SAAAL,IAEA,IAAAY,EAAAZ,EAAAa,IACA,MAAA,IAAAT,UAAAC,EAAA,SAAAL,IAGA,GADAD,EAAAC,EAAAa,MACAD,EAAAb,EAAA7B,MACA,MAAA,IAAAkC,UAAAC,EAAA,SAAAL,IAEAC,EAAAnC,EAAAiC,GACAA,EAAAzB,EAAA,IAAAgC,EAAA,IAAAC,EAAAN,EAAArB,OAAAE,IAAAmB,EAAAxB,EAGA,KACA,CAEA,IAAAiC,EADAX,EAAAG,UAAA,IAEA,MAAA,IAAAE,UAAAC,EAAA,SAAAN,IAGA,IAAAS,EADAZ,EAAAM,UAAA,IAEA,MAAA,IAAAE,UAAAC,EAAA,SAAAT,IAEA,GAAA,IAAAE,EACAC,EAAA,IAAAO,EAAAP,EAAAH,OACA,CAEA,IAAAY,EADA9B,EAAAwB,UAAA,IAEA,MAAA,IAAAE,UAAAC,EAAA,SAAA3B,IAGA,IADAA,GAAAI,GACAiB,EAAAe,WAAAlB,EACA,MAAA,IAAAmB,WAAAV,EAAA,SAAA3B,IAEAqB,EAAA,IAAAO,EAAAP,EAAAH,EAAAlB,EACA,CACA,CAKA,OAJAsC,EAAAb,KAAA,UAAAJ,GACAiB,EAAAb,KAAA,UAAAJ,EAAAe,WAAAhC,GACAkC,EAAAb,KAAA,QAAA1B,GAEA0B,IACA,CAeAa,EAAAxB,EAAA,oBAAAV,GAeAkC,EAAAxB,EAAA,OAAA,kBAqCAwB,EAAAxB,EAAA,QAAA,SAAAK,EAAAoB,GACA,IAAAC,EACAC,EACArB,EACAsB,EACA3C,EACAT,EACA+B,EACAE,EACAoB,EACA3C,EACAC,EACA,IAAAiC,EAAAT,MACA,MAAA,IAAAC,UAAAC,EAAA,WAEA,IAAAd,EAAAY,MACA,MAAA,IAAAC,UAAA,uDAGA,GAAA,QADAe,EAAAhC,EAAAU,MACAZ,EAAAkC,GACA,MAAA,IAAAf,UAAAC,EAAA,gFAAAR,IAKA,GAHApB,EAAAa,EAAA6B,IAEArB,EAAAI,UAAAtB,QACA,EAAA,CAEA,IAAAgC,EADAQ,EAAAlB,UAAA,IAEA,MAAA,IAAAE,UAAAC,EAAA,SAAAe,IAEAtB,EAAA,IACAoB,EAAAhB,UAAA,GAEA,CACA,GAAAO,EAAAQ,GAAA,CACA,GAAAG,EAAA,CASA,IARA1C,EAAAuC,EAAArC,OAEAyC,EADAJ,EAAAI,KAAAJ,EAAAK,IACAC,EAAA,WAEAC,EAAA,WAGAzB,GADA/B,EAAA,IAAAmC,KAAAgB,EAAAzC,IACA+C,QACA9C,EAAA,EAAAA,EAAAD,EAAAC,IACAoB,EAAAlB,WAAAF,EAAAG,EAAAsC,EAAAM,KAAAR,EAAAG,EAAAJ,EAAAtC,GAAAA,GAAAF,GAEA,OAAAT,CACA,CACA,OAAA,IAAAmC,KAAAgB,EAAAF,EACA,CACA,GAAAN,EAAAM,IAAAlC,GAAA6B,EAAAK,EAAAJ,IAAA,CAEA,GADAd,EAAAkB,EAAAJ,MACAD,EAAAb,EAAA7B,MACA,MAAA,IAAAkC,UAAAC,EAAA,SAAAY,IAUA,IAPAhB,EADAmB,EC9VA,SAA0BrD,EAAIqD,EAAMF,GACnC,IAAIlD,EACAC,EACAU,EAIJ,IAFAX,EAAM,GACNW,GAAK,IAEJV,EAAIF,EAAGG,QACAC,MAGPQ,GAAK,EACLX,EAAII,KAAMgD,EAAKM,KAAMR,EAASjD,EAAEI,MAAOM,IAExC,OAAOX,CACR,CD+UA2D,CAAA5B,EAAAqB,EAAAF,GAEApD,EAAAiC,GAIAA,GADA/B,EAAA,IAAAmC,KAAAgB,EADAzC,EAAAuB,EAAArB,SAEA6C,QACA9C,EAAA,EAAAA,EAAAD,EAAAC,IACAoB,EAAAlB,WAAAF,EAAAG,EAAAmB,EAAAtB,GAAAF,GAEA,OAAAT,CACA,CACA,MAAA,IAAAoC,UAAAC,EAAA,SAAAY,GACA,IAsBAD,EAAAxB,EAAA,MAAA,SAAAK,GACA,IAAAsB,EACAS,EACAjD,EACA,IAAAiC,EAAAT,MACA,MAAA,IAAAC,UAAAC,EAAA,WAEA,IAAAd,EAAAY,MACA,MAAA,IAAAC,UAAA,uDAGA,GAAA,QADAe,EAAAhC,EAAAU,MACAZ,EAAAkC,GACA,MAAA,IAAAf,UAAAC,EAAA,gFAAAR,IAGA,IADA+B,EAAA,GACAjD,EAAA,EAAAA,EAAAuB,UAAAtB,OAAAD,IACAiD,EAAAxD,KAAA8B,UAAAvB,IAEA,OAAA,IAAAwB,KAAAgB,EAAAS,EACA,IAgBAC,EAAArC,EAAAsC,UAAA,UAAA,WACA,OAAA3B,KAAAsB,QAAAM,MACA,IAgBAF,EAAArC,EAAAsC,UAAA,cAAA,WACA,OAAA3B,KAAAsB,QAAAX,UACA,IAgBAe,EAAArC,EAAAsC,UAAA,cAAA,WACA,OAAA3B,KAAAsB,QAAA7B,UACA,IAiBAoB,EAAAxB,EAAAsC,UAAA,oBAAAtC,EAAAV,mBA2BAkC,EAAAxB,EAAAsC,UAAA,OAAA,SAAAE,GACA,IAAAvC,EAAAU,MACA,MAAA,IAAAC,UAAA,uDAEA,IAAAI,EAAAwB,GACA,MAAA,IAAA5B,UAAAC,EAAA,SAAA2B,IAEA,KAAAA,GAAA7B,KAAA8B,SAGA,OAAA9B,KAAAsB,QAAAS,WAAAF,EAAAlD,EAAAqB,KAAAgC,MACA,IAgBAN,EAAArC,EAAAsC,UAAA,UAAA,WACA,OAAA3B,KAAA8B,OACA,IA+CAjB,EAAAxB,EAAAsC,UAAA,OAAA,SAAAzD,GACA,IAAA+D,EACAJ,EACAjC,EACAE,EACAoB,EACAgB,EACA1D,EACA2D,EACA,IAAA7C,EAAAU,MACA,MAAA,IAAAC,UAAA,uDAGA,GADAL,EAAAI,KAAAsB,QACAvB,UAAAtB,OAAA,GAEA,IAAA4B,EADAwB,EAAA9B,UAAA,IAEA,MAAA,IAAAE,UAAAC,EAAA,SAAA2B,SAGAA,EAAA,EAEA,GAAAvB,EAAApC,GAAA,CAEA,GAAA2D,GADAK,EAAAhE,EAAAO,QACAuB,KAAA8B,QACA,MAAA,IAAAlB,WAAAV,EAAA,WAUA,GANAgB,GAFAe,EAAA/D,GACAgD,KAAAe,EAAAd,IACAC,EAAA,WAEAC,EAAA,WAGAc,EAAAvC,EAAAH,WAAAoC,EAAAlD,EAEAsD,EAAAL,SAAAhC,EAAAgC,QAEAK,EAAAxC,WAAA0C,GACAF,EAAAxC,WAAAwC,EAAAtB,WAAAwB,EAEA,CAGA,IADArC,EAAA,GACAtB,EAAA,EAAAA,EAAAN,EAAAO,OAAAD,IACAsB,EAAA7B,KAAAiD,EAAAhD,EAAAM,IAEAyD,EAAAnC,EACAoB,EAAAG,EAAA,UACA,CACA,IAAA7C,EAAA,EAAAA,EAAA0D,EAAAL,IAAArD,IACAoB,EAAAlB,WAAAmD,EAAAlD,EAAAuC,EAAAe,EAAAzD,GAAAwB,KAAAgC,MAGA,KAhCA,CAiCA,GAAAH,GAAA7B,KAAA8B,QACA,MAAA,IAAAlB,WAAAV,EAAA,SAAA2B,IAEAjC,EAAAlB,WAAAmD,EAAAlD,EAAAT,EAAA8B,KAAAgC,MAJA,CAKA,IAqBAnB,EAAAxB,EAAAsC,UAAA,YAAA,WACA,IAAA9D,EACA+B,EACApB,EACA,IAAAc,EAAAU,MACA,MAAA,IAAAC,UAAA,uDAIA,IAFApC,EAAA,GACA+B,EAAAI,KAAAsB,QACA9C,EAAA,EAAAA,EAAAwB,KAAA8B,QAAAtD,IACAX,EAAAI,KAAA2B,EAAAmC,WAAAvD,EAAAG,EAAAqB,KAAAgC,QAEA,OAAAnE,EAAAuE,KAAA,IACA"} \ No newline at end of file diff --git a/lib/from_array.js b/lib/from_array.js deleted file mode 100644 index c8cfb23..0000000 --- a/lib/from_array.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Fills an output DataView with double-precision values. -* -* @private -* @param {DataView} view - output data view -* @param {Array} arr - input array -* @param {boolean} isLE - boolean indicating whether the store values in little-endian byte order -* @returns {DataView} output data view -*/ -function fromArray( view, arr, isLE ) { - var len; - var i; - - len = arr.length; - for ( i = 0; i < len; i++ ) { - view.setFloat64( i*8, arr[ i ], isLE ); // FIXME: handle accessor arrays, FIXME: avoid hardcoding bytes per element - } - return view; -} - - -// EXPORTS // - -module.exports = fromArray; diff --git a/lib/from_iterator.js b/lib/from_iterator.js deleted file mode 100644 index c1adb5d..0000000 --- a/lib/from_iterator.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Returns an array of iterated values. -* -* @private -* @param {Object} it - iterator -* @returns {Array} output array -*/ -function fromIterator( it ) { - var out; - var v; - - out = []; - while ( true ) { - v = it.next(); - if ( v.done ) { - break; - } - out.push( v.value ); - } - return out; -} - - -// EXPORTS // - -module.exports = fromIterator; diff --git a/lib/from_iterator_map.js b/lib/from_iterator_map.js deleted file mode 100644 index 9a6e354..0000000 --- a/lib/from_iterator_map.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Returns an array of iterated values. -* -* @private -* @param {Object} it - iterator -* @param {Function} clbk - callback to invoke for each iterated value -* @param {*} thisArg - invocation context -* @returns {Array} output array -*/ -function fromIteratorMap( it, clbk, thisArg ) { - var out; - var v; - var i; - - out = []; - i = -1; - while ( true ) { - v = it.next(); - if ( v.done ) { - break; - } - i += 1; - out.push( clbk.call( thisArg, v.value, i ) ); - } - return out; -} - - -// EXPORTS // - -module.exports = fromIteratorMap; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 2be932f..0000000 --- a/lib/index.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @module @stdlib/array-fixed-endian-float64 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 1391297..0000000 --- a/lib/main.js +++ /dev/null @@ -1,708 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-len, no-restricted-syntax, no-invalid-this */ - -'use strict'; - -// MODULES // - -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var isCollection = require( '@stdlib/assert-is-collection' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isObject = require( '@stdlib/assert-is-object' ); -var isFunction = require( '@stdlib/assert-is-function' ); -var isString = require( '@stdlib/assert-is-string' ).isPrimitive; -var contains = require( '@stdlib/array-base-assert-contains' ).factory; -var lowercase = require( '@stdlib/string-base-lowercase' ); -var hasIteratorSymbolSupport = require( '@stdlib/assert-has-iterator-symbol-support' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' ); -var setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var DataView = require( '@stdlib/array-dataview' ); -var getter = require( '@stdlib/array-base-getter' ); -var accessorGetter = require( '@stdlib/array-base-accessor-getter' ); -var format = require( '@stdlib/error-tools-fmtprodmsg' ); -var fromIterator = require( './from_iterator.js' ); -var fromIteratorMap = require( './from_iterator_map.js' ); -var fromArray = require( './from_array.js' ); - - -// VARIABLES // - -var BYTES_PER_ELEMENT = 8; // 8 bytes per double -var HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport(); -var isByteOrder = contains( [ 'little-endian', 'big-endian' ] ); - - -// FUNCTIONS // - -/** -* Normalizes a byte order value. -* -* @private -* @param {*} value - byte order -* @returns {(string|null)} normalized byte order -*/ -function byteOrder( value ) { - return ( isString( value ) ) ? lowercase( value ) : null; -} - -/** -* Tests whether a provided byte order is little-endian byte order. -* -* @private -* @param {string} value - byte order -* @returns {boolean} boolean indicating whether a byte order is little-endian byte order -*/ -function isLittleEndian( value ) { - return ( value === 'little-endian' ); -} - -/** -* Returns a boolean indicating if a value is a `Float64ArrayFE` constructor. -* -* @private -* @param {*} value - value to test -* @returns {boolean} boolean indicating if a value is a `Float64ArrayFE` constructor -*/ -function isFloat64ArrayFEConstructor( value ) { // eslint-disable-line id-length - return ( value === Float64ArrayFE ); -} - -/** -* Returns a boolean indicating if a value is a `Float64ArrayFE`. -* -* @private -* @param {*} value - value to test -* @returns {boolean} boolean indicating if a value is a `Float64ArrayFE` -*/ -function isFloat64ArrayFE( value ) { - return ( - typeof value === 'object' && - value !== null && - value.constructor.name === 'Float64ArrayFE' && - value.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT - ); -} - - -// MAIN // - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @constructor -* @param {string} endianness - byte order -* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable -* @param {NonNegativeInteger} [byteOffset=0] - byte offset -* @param {NonNegativeInteger} [length] - view length -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument -* @throws {TypeError} byte offset must be a nonnegative integer -* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -function Float64ArrayFE() { - var byteOffset; - var endianness; - var nargs; - var isLE; - var buf; - var len; - var arg; - var tmp; - - nargs = arguments.length; - if ( !(this instanceof Float64ArrayFE) ) { - if ( nargs < 2 ) { - return new Float64ArrayFE( arguments[0] ); - } - if ( nargs === 2 ) { - return new Float64ArrayFE( arguments[0], arguments[1] ); - } - if ( nargs === 3 ) { - return new Float64ArrayFE( arguments[0], arguments[1], arguments[2] ); - } - return new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] ); - } - endianness = byteOrder( arguments[ 0 ] ); - if ( endianness === null || !isByteOrder( endianness ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) ); - } - isLE = isLittleEndian( endianness ); - - nargs -= 1; - - // Create the underlying data buffer... - if ( nargs === 0 ) { - buf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility - } else if ( nargs === 1 ) { - arg = arguments[ nargs ]; - if ( isNonNegativeInteger( arg ) ) { - buf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) ); - } else if ( isCollection( arg ) ) { - buf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE ); - } else if ( isArrayBuffer( arg ) ) { - buf = new DataView( arg ); - } else if ( isObject( arg ) ) { - if ( HAS_ITERATOR_SYMBOL === false ) { - throw new TypeError( format( 'null29', arg ) ); - } - if ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) { - throw new TypeError( format( 'null2A', arg ) ); - } - buf = arg[ ITERATOR_SYMBOL ](); - if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'null2A', arg ) ); - } - tmp = fromIterator( buf ); - buf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE ); - } else { - throw new TypeError( format( 'null2A', arg ) ); - } - } else { - buf = arguments[ 1 ]; - if ( !isArrayBuffer( buf ) ) { - throw new TypeError( format( 'null2B', buf ) ); - } - byteOffset = arguments[ 2 ]; - if ( !isNonNegativeInteger( byteOffset ) ) { - throw new TypeError( format( 'null2C', byteOffset ) ); - } - if ( nargs === 2 ) { - buf = new DataView( buf, byteOffset ); - } else { - len = arguments[ 3 ]; - if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'null2F', len ) ); - } - len *= BYTES_PER_ELEMENT; - if ( len > (buf.byteLength-byteOffset) ) { - throw new RangeError( format( 'null2G', len ) ); - } - buf = new DataView( buf, byteOffset, len ); - } - } - setReadOnly( this, '_buffer', buf ); - setReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT ); - setReadOnly( this, '_isLE', isLE ); - - return this; -} - -/** -* Size (in bytes) of each array element. -* -* @name BYTES_PER_ELEMENT -* @memberof Float64ArrayFE -* @readonly -* @type {PositiveInteger} -* @default 8 -* -* @example -* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; -* // returns 8 -*/ -setReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT ); - -/** -* Constructor name. -* -* @name name -* @memberof Float64ArrayFE -* @readonly -* @type {string} -* @default 'Float64ArrayFE' -* -* @example -* var str = Float64ArrayFE.name; -* // returns 'Float64ArrayFE' -*/ -setReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' ); - -/** -* Creates a new `Float64ArrayFE` from an array-like object or an iterable. -* -* @name from -* @memberof Float64ArrayFE -* @type {Function} -* @param {string} endianness - byte order -* @param {(Collection|Iterable)} src - array-like object or iterable -* @param {Function} [clbk] - callback to invoke for each source element -* @param {*} [thisArg] - context -* @throws {TypeError} `this` context must be a constructor -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} second argument must be an array-like object or an iterable -* @throws {TypeError} third argument must be a function -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* function clbk( v ) { -* return v * 2.0; -* } -* -* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { - var thisArg; - var order; - var nargs; - var clbk; - var isLE; - var out; - var buf; - var tmp; - var get; - var len; - var i; - if ( !isFunction( this ) ) { - throw new TypeError( format('null01') ); - } - if ( !isFloat64ArrayFEConstructor( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - order = byteOrder( endianness ); - if ( order === null || !isByteOrder( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) ); - } - isLE = isLittleEndian( order ); - - nargs = arguments.length; - if ( nargs > 2 ) { - clbk = arguments[ 2 ]; - if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'null3N', clbk ) ); - } - if ( nargs > 3 ) { - thisArg = arguments[ 3 ]; - } - } - if ( isCollection( src ) ) { - if ( clbk ) { - len = src.length; - if ( src.get && src.set ) { - get = accessorGetter( 'default' ); - } else { - get = getter( 'default' ); - } - out = new this( order, len ); - buf = out._buffer; // eslint-disable-line no-underscore-dangle - for ( i = 0; i < len; i++ ) { - buf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE ); - } - return out; - } - return new this( order, src ); - } - if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { - buf = src[ ITERATOR_SYMBOL ](); - if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'nullAt', src ) ); - } - if ( clbk ) { - tmp = fromIteratorMap( buf, clbk, thisArg ); - } else { - tmp = fromIterator( buf ); - } - len = tmp.length; - out = new this( order, len ); - buf = out._buffer; // eslint-disable-line no-underscore-dangle - for ( i = 0; i < len; i++ ) { - buf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE ); - } - return out; - } - throw new TypeError( format( 'nullAt', src ) ); -}); - -/** -* Creates a new `Float64ArrayFE` from a variable number of arguments. -* -* @name of -* @memberof Float64ArrayFE -* @type {Function} -* @param {string} endianness - byte order -* @param {...*} element - array elements -* @throws {TypeError} `this` context must be a constructor -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} first argument must be a supported byte order -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 ); -* // returns -* -* var len = arr.length; -* // returns 4 -*/ -setReadOnly( Float64ArrayFE, 'of', function of( endianness ) { - var order; - var args; - var i; - if ( !isFunction( this ) ) { - throw new TypeError( format('null01') ); - } - if ( !isFloat64ArrayFEConstructor( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - order = byteOrder( endianness ); - if ( order === null || !isByteOrder( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) ); - } - args = []; - for ( i = 1; i < arguments.length; i++ ) { - args.push( arguments[ i ] ); - } - return new this( order, args ); -}); - -/** -* Pointer to the underlying data buffer. -* -* @name buffer -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {ArrayBuffer} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var buf = arr.buffer; -* // returns -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() { - return this._buffer.buffer; -}); - -/** -* Size (in bytes) of the array. -* -* @name byteLength -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var byteLength = arr.byteLength; -* // returns 80 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() { - return this._buffer.byteLength; -}); - -/** -* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`. -* -* @name byteOffset -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var byteOffset = arr.byteOffset; -* // returns 0 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() { - return this._buffer.byteOffset; -}); - -/** -* Size (in bytes) of each array element. -* -* @name BYTES_PER_ELEMENT -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {PositiveInteger} -* @default 8 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var nbytes = arr.BYTES_PER_ELEMENT; -* // returns 8 -*/ -setReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT ); - -/** -* Returns an array element. -* -* @name get -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @param {NonNegativeInteger} idx - element index -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} must provide a nonnegative integer -* @returns {(number|void)} array element -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var v = arr.get( 0 ); -* // returns 0.0 -* -* arr.set( [ 1.0, 2.0 ], 0 ); -* -* v = arr.get( 0 ); -* // returns 1.0 -* -* v = arr.get( 100 ); -* // returns undefined -*/ -setReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) { - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'null2K', idx ) ); - } - if ( idx >= this._length ) { - return; - } - return this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE ); -}); - -/** -* Number of array elements. -* -* @name length -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var len = arr.length; -* // returns 10 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() { - return this._length; -}); - -/** -* Sets an array element. -* -* ## Notes -* -* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario: -* -* ```text -* buf: --------------------- -* src: --------------------- -* ``` -* -* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array. -* -* In the other overlapping scenario, -* -* ```text -* buf: --------------------- -* src: --------------------- -* ``` -* -* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended. -* -* @name set -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @param {(Collection|Float64ArrayFE|*)} value - value(s) -* @param {NonNegativeInteger} [i=0] - element index at which to start writing values -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} index argument must be a nonnegative integer -* @throws {RangeError} index argument is out-of-bounds -* @throws {RangeError} target array lacks sufficient storage to accommodate source values -* @returns {void} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var v = arr.get( 0 ); -* // returns 0.0 -* -* arr.set( [ 1.0, 2.0 ], 0 ); -* -* v = arr.get( 0 ); -* // returns 1.0 -*/ -setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { - var sbuf; - var idx; - var buf; - var tmp; - var get; - var N; - var i; - var j; - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - buf = this._buffer; - if ( arguments.length > 1 ) { - idx = arguments[ 1 ]; - if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'null2L', idx ) ); - } - } else { - idx = 0; - } - if ( isCollection( value ) ) { - N = value.length; - if ( idx+N > this._length ) { - throw new RangeError( format('null03') ); - } - sbuf = value; - if ( sbuf.get && sbuf.set ) { - get = accessorGetter( 'default' ); - } else { - get = getter( 'default' ); - } - // Check for overlapping memory... - j = buf.byteOffset + (idx*BYTES_PER_ELEMENT); - if ( - sbuf.buffer === buf.buffer && - ( - sbuf.byteOffset < j && - sbuf.byteOffset+sbuf.byteLength > j - ) - ) { - // We need to copy source values... - tmp = []; - for ( i = 0; i < value.length; i++ ) { - tmp.push( get( value, i ) ); - } - sbuf = tmp; - get = getter( 'default' ); - } - for ( i = 0; i < N; idx++, i++ ) { - buf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE ); - } - return; - } - if ( idx >= this._length ) { - throw new RangeError( format( 'null2M', idx ) ); - } - buf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE ); -}); - -/** -* Serializes an array as a string. -* -* @name toString -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @throws {TypeError} `this` must be a Float64ArrayFE -* @returns {string} string representation -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 3 ); -* -* arr.set( 1.0, 0 ); -* arr.set( 2.0, 1 ); -* arr.set( 3.0, 2 ); -* -* var str = arr.toString(); -* // returns '1,2,3' -*/ -setReadOnly( Float64ArrayFE.prototype, 'toString', function toString() { - var out; - var buf; - var i; - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - out = []; - buf = this._buffer; - for ( i = 0; i < this._length; i++ ) { - out.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) ); - } - return out.join( ',' ); -}); - - -// EXPORTS // - -module.exports = Float64ArrayFE; diff --git a/package.json b/package.json index 2acb8d7..aa208db 100644 --- a/package.json +++ b/package.json @@ -3,30 +3,8 @@ "version": "0.0.0", "description": "Float64ArrayFE.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -35,53 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-accessor-getter": "^0.2.2", - "@stdlib/array-base-assert-contains": "^0.2.2", - "@stdlib/array-base-getter": "^0.2.2", - "@stdlib/array-buffer": "^0.2.2", - "@stdlib/array-dataview": "^0.2.2", - "@stdlib/assert-has-iterator-symbol-support": "^0.2.2", - "@stdlib/assert-is-arraybuffer": "^0.2.2", - "@stdlib/assert-is-collection": "^0.2.2", - "@stdlib/assert-is-function": "^0.2.2", - "@stdlib/assert-is-nonnegative-integer": "^0.2.2", - "@stdlib/assert-is-object": "^0.2.2", - "@stdlib/assert-is-string": "^0.2.2", - "@stdlib/string-base-lowercase": "^0.4.0", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2", - "@stdlib/symbol-iterator": "^0.2.2", - "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.3", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/array-float64": "^0.2.2", - "@stdlib/array-zero-to": "^0.2.2", - "@stdlib/assert-is-number": "^0.2.2", - "@stdlib/console-log-each": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/random-array-randu": "^0.2.1", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..1ac5d3c --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index fc72bbf..0000000 --- a/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF 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 ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -// TODO: add tests From 98970e8bda0c1ab87d7034d2ad19b7b7f0134a5c Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 22 Sep 2024 04:10:17 +0000 Subject: [PATCH 06/22] Transform error messages --- lib/main.js | 34 +++++++++++++++++----------------- package.json | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/main.js b/lib/main.js index bb71795..1c87ce9 100644 --- a/lib/main.js +++ b/lib/main.js @@ -39,7 +39,7 @@ var ArrayBuffer = require( '@stdlib/array-buffer' ); var DataView = require( '@stdlib/array-dataview' ); var getter = require( '@stdlib/array-base-getter' ); var accessorGetter = require( '@stdlib/array-base-accessor-getter' ); -var format = require( '@stdlib/string-format' ); +var format = require( '@stdlib/error-tools-fmtprodmsg' ); var fromIterator = require( './from_iterator.js' ); var fromIteratorMap = require( './from_iterator_map.js' ); var fromArray = require( './from_array.js' ); @@ -218,19 +218,19 @@ function Float64ArrayFE() { buf = new DataView( arg ); } else if ( isObject( arg ) ) { if ( HAS_ITERATOR_SYMBOL === false ) { - throw new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null29', arg ) ); } if ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } buf = arg[ ITERATOR_SYMBOL ](); if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } tmp = fromIterator( buf ); buf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE ); } else { - throw new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) ); + throw new TypeError( format( 'null2A', arg ) ); } } else { buf = arguments[ 1 ]; @@ -239,18 +239,18 @@ function Float64ArrayFE() { } byteOffset = arguments[ 2 ]; if ( !isNonNegativeInteger( byteOffset ) ) { - throw new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) ); + throw new TypeError( format( 'null2C', byteOffset ) ); } if ( nargs === 2 ) { buf = new DataView( buf, byteOffset ); } else { len = arguments[ 3 ]; if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) ); + throw new TypeError( format( 'null2F', len ) ); } len *= BYTES_PER_ELEMENT; if ( len > (buf.byteLength-byteOffset) ) { - throw new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len ) ); + throw new RangeError( format( 'null2G', len ) ); } buf = new DataView( buf, byteOffset, len ); } @@ -340,7 +340,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { var len; var i; if ( !isFunction( this ) ) { - throw new TypeError( 'invalid invocation. `this` context must be a constructor.' ); + throw new TypeError( format('null01') ); } if ( !isFloat64ArrayFEConstructor( this ) ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); @@ -355,7 +355,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { if ( nargs > 2 ) { clbk = arguments[ 2 ]; if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) ); + throw new TypeError( format( 'null3N', clbk ) ); } if ( nargs > 3 ) { thisArg = arguments[ 3 ]; @@ -381,7 +381,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { buf = src[ ITERATOR_SYMBOL ](); if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) ); + throw new TypeError( format( 'nullAt', src ) ); } if ( clbk ) { tmp = fromIteratorMap( buf, clbk, thisArg ); @@ -396,7 +396,7 @@ setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { } return out; } - throw new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) ); + throw new TypeError( format( 'nullAt', src ) ); }); /** @@ -424,7 +424,7 @@ setReadOnly( Float64ArrayFE, 'of', function of( endianness ) { var args; var i; if ( !isFunction( this ) ) { - throw new TypeError( 'invalid invocation. `this` context must be a constructor.' ); + throw new TypeError( format('null01') ); } if ( !isFloat64ArrayFEConstructor( this ) ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); @@ -541,7 +541,7 @@ setReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) { throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); } if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) ); + throw new TypeError( format( 'null2K', idx ) ); } if ( idx >= this._length ) { return; @@ -628,7 +628,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { if ( arguments.length > 1 ) { idx = arguments[ 1 ]; if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) ); + throw new TypeError( format( 'null2L', idx ) ); } } else { idx = 0; @@ -636,7 +636,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { if ( isCollection( value ) ) { N = value.length; if ( idx+N > this._length ) { - throw new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' ); + throw new RangeError( format('null03') ); } sbuf = value; if ( sbuf.get && sbuf.set ) { @@ -667,7 +667,7 @@ setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { return; } if ( idx >= this._length ) { - throw new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) ); + throw new RangeError( format( 'null2M', idx ) ); } buf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE ); }); diff --git a/package.json b/package.json index d9376b9..917c478 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@stdlib/assert-is-prototype-of": "^0.2.2", "@stdlib/assert-is-string": "^0.2.2", "@stdlib/string-base-lowercase": "^0.4.0", - "@stdlib/string-format": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", "@stdlib/symbol-iterator": "^0.2.2", "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.3", "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", From 295a485bc83b8be7566dbcd9a575d3a7a064462f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 22 Sep 2024 04:10:43 +0000 Subject: [PATCH 07/22] Remove files --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 3 files changed, 4847 deletions(-) delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 5210c5d..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import{isPrimitive as t}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-nonnegative-integer@v0.2.2-esm/index.mjs";import e from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-collection@v0.2.2-esm/index.mjs";import r from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-arraybuffer@v0.2.2-esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-object@v0.2.2-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-function@v0.2.2-esm/index.mjs";import{isPrimitive as i}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-string@v0.2.2-esm/index.mjs";import{factory as o}from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-assert-contains@v0.2.2-esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/string-base-lowercase@v0.4.0-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-has-iterator-symbol-support@v0.2.2-esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/symbol-iterator@v0.2.2-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-property@v0.2.1-esm/index.mjs";import u from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-accessor@v0.2.2-esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/array-buffer@v0.2.2-esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/array-dataview@v0.2.2-esm/index.mjs";import m from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-getter@v0.2.2-esm/index.mjs";import w from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-accessor-getter@v0.2.2-esm/index.mjs";import g from"https://cdn.jsdelivr.net/gh/stdlib-js/error-tools-fmtprodmsg@v0.2.2-esm/index.mjs";function y(t){var e,r;for(e=[];!(r=t.next()).done;)e.push(r.value);return e}function v(t,e,r){var n,s;for(n=e.length,s=0;su.byteLength-i)throw new RangeError(g("null2G",m));u=new p(u,i,m)}}return a(this,"_buffer",u),a(this,"_length",u.byteLength/b),a(this,"_isLE",f),this}a(x,"BYTES_PER_ELEMENT",b),a(x,"name","Float64ArrayFE"),a(x,"from",(function(t,r){var i,o,l,f,a,u,d,p,v,F,x;if(!s(this))throw new TypeError(g("null01"));if(!_(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(null===(o=j(t))||!c(o))throw new TypeError(g("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(a=T(o),(l=arguments.length)>2){if(!s(f=arguments[2]))throw new TypeError(g("null3N",f));l>3&&(i=arguments[3])}if(e(r)){if(f){for(F=r.length,v=r.get&&r.set?w("default"):m("default"),d=(u=new this(o,F))._buffer,x=0;x=this._length))return this._buffer.getFloat64(e*b,this._isLE)})),u(x.prototype,"length",(function(){return this._length})),a(x.prototype,"set",(function(r){var n,s,i,o,l,f,h,a;if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(i=this._buffer,arguments.length>1){if(!t(s=arguments[1]))throw new TypeError(g("null2L",s))}else s=0;if(e(r)){if(s+(f=r.length)>this._length)throw new RangeError(g("null03"));if(l=(n=r).get&&n.set?w("default"):m("default"),a=i.byteOffset+s*b,n.buffer===i.buffer&&n.byteOffseta){for(o=[],h=0;h=this._length)throw new RangeError(g("null2M",s));i.setFloat64(s*b,r,this._isLE)}})),a(x.prototype,"toString",(function(){var t,e,r;if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],e=this._buffer,r=0;r\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'null29', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'null2B', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'null2C', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2F', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'null2G', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'null3N', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'nullAt', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'nullAt', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'null2K', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'null2L', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( format('null03') );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'null2M', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( clbk.call( thisArg, v.value, i ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n"],"names":["fromIterator","it","out","v","next","done","push","value","fromArray","view","arr","isLE","len","i","length","setFloat64","BYTES_PER_ELEMENT","HAS_ITERATOR_SYMBOL","hasIteratorSymbolSupport","isByteOrder","contains","byteOrder","isString","lowercase","isLittleEndian","isFloat64ArrayFEConstructor","Float64ArrayFE","isFloat64ArrayFE","constructor","name","byteOffset","endianness","nargs","buf","arg","tmp","arguments","this","TypeError","format","DataView","ArrayBuffer","isNonNegativeInteger","isCollection","isArrayBuffer","isObject","isFunction","ITERATOR_SYMBOL","byteLength","RangeError","setReadOnly","src","thisArg","order","clbk","get","set","accessorGetter","getter","_buffer","call","fromIteratorMap","args","setReadOnlyAccessor","prototype","buffer","idx","_length","getFloat64","_isLE","sbuf","N","j","join"],"mappings":"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"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 1ac5d3c..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 74a9c312677082584633202e648c8706ad771f3d Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 22 Sep 2024 04:10:58 +0000 Subject: [PATCH 08/22] 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 | 54 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 51 +- SECURITY.md | 5 - benchmark/benchmark.from.js | 310 -- benchmark/benchmark.get.js | 85 - benchmark/benchmark.js | 533 --- benchmark/benchmark.of.js | 69 - benchmark/benchmark.set.js | 209 - benchmark/benchmark.set.length.js | 110 - benchmark/benchmark.to_string.js | 50 - benchmark/benchmark.to_string.length.js | 94 - branches.md | 56 - dist/index.js | 19 - dist/index.js.map | 7 - examples/index.js | 42 - index.mjs | 4 + index.mjs.map | 1 + lib/from_array.js | 46 - lib/from_iterator.js | 48 - lib/from_iterator_map.js | 53 - lib/index.js | 94 - lib/main.js | 712 --- package.json | 74 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 35 - 48 files changed, 4870 insertions(+), 5941 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.from.js delete mode 100644 benchmark/benchmark.get.js delete mode 100644 benchmark/benchmark.js delete mode 100644 benchmark/benchmark.of.js delete mode 100644 benchmark/benchmark.set.js delete mode 100644 benchmark/benchmark.set.length.js delete mode 100644 benchmark/benchmark.to_string.js delete mode 100644 benchmark/benchmark.to_string.length.js delete mode 100644 branches.md delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 examples/index.js create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/from_array.js delete mode 100644 lib/from_iterator.js delete mode 100644 lib/from_iterator_map.js delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9acabc8..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/fixed-endian-float64) 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 54acaa3..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/fixed-endian-float64) 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 9b5400f..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 2 * * 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 + + ```
@@ -468,7 +459,7 @@ logEach( '%s', out ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -531,13 +522,13 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-fixed-endian-float64/main/LICENSE -[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed +[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed/tree/esm -[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer +[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer/tree/esm -[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory +[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory/tree/esm -[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64 +[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64/tree/esm
diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.from.js b/benchmark/benchmark.from.js deleted file mode 100644 index cf3e838..0000000 --- a/benchmark/benchmark.from.js +++ /dev/null @@ -1,310 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// MAIN // - -bench( pkg+'::typed_array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 'little-endian', 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::iterable:from', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } - } -}); - -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } -}); - -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable(), clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } - - function clbk( v ) { - return v * 2.0; - } -}); diff --git a/benchmark/benchmark.get.js b/benchmark/benchmark.get.js deleted file mode 100644 index 764daf1..0000000 --- a/benchmark/benchmark.get.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js deleted file mode 100644 index d58d58a..0000000 --- a/benchmark/benchmark.js +++ /dev/null @@ -1,533 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var Float64Array = require( '@stdlib/array-float64' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// FUNCTIONS // - -/** -* Returns an "iterable" object. -* -* @private -* @returns {Object} iterable object -*/ -function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } -} - - -// MAIN // - -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:buffer', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.buffer; - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArrayBuffer( v ) ) { - b.fail( 'should return an ArrayBuffer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteLength', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteLength; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteOffset', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteOffset; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:length', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.length; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.of.js b/benchmark/benchmark.of.js deleted file mode 100644 index 84f00cd..0000000 --- a/benchmark/benchmark.of.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':of', function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 'little-endian', 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of.apply( Float64ArrayFE, buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.js b/benchmark/benchmark.set.js deleted file mode 100644 index f420d74..0000000 --- a/benchmark/benchmark.set.js +++ /dev/null @@ -1,209 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'little-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'big-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.length.js b/benchmark/benchmark.set.length.js deleted file mode 100644 index dff28fc..0000000 --- a/benchmark/benchmark.set.length.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var randu = require( '@stdlib/random-array-randu' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var values; - var arr1; - var arr2; - var arr3; - var N; - - arr1 = randu( len ); - arr2 = randu( len ); - arr3 = randu( len ); - arr1 = new Float64ArrayFE( 'little-endian', arr1 ); - - values = [ - new Float64ArrayFE( 'little-endian', arr2 ), - new Float64ArrayFE( 'big-endian', arr3 ) - ]; - N = values.length; - - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr1.set( values[ i%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); - } -} - -main(); diff --git a/benchmark/benchmark.to_string.js b/benchmark/benchmark.to_string.js deleted file mode 100644 index 42d0139..0000000 --- a/benchmark/benchmark.to_string.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':toString', function benchmark( b ) { - var out; - var arr; - var i; - - arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 2.0, 1.0 ] ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.to_string.length.js b/benchmark/benchmark.to_string.length.js deleted file mode 100644 index 72a1f2d..0000000 --- a/benchmark/benchmark.to_string.length.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var zeroTo = require( '@stdlib/array-zero-to' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) ); - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 193762e..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64" -%% click B href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/main" -%% click C href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/production" -%% click D href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm" -%% click E href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno" -%% click F href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64 -[production-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/production -[deno-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index f31e59c..0000000 --- a/dist/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict";var c=function(n,t){return function(){return t||n((t={exports:{}}).exports,t),t.exports}};var O=c(function(nr,M){"use strict";function J(n){var t,r;for(t=[];r=n.next(),!r.done;)t.push(r.value);return t}M.exports=J});var R=c(function(ar,S){"use strict";function K(n,t,r){var a,e,u;for(a=[],u=-1;e=n.next(),!e.done;)u+=1,a.push(t.call(r,e.value,u));return a}S.exports=K});var x=c(function(ir,k){"use strict";function Q(n,t,r){var a,e;for(a=t.length,e=0;ee.byteLength-n)throw new RangeError(s("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",u));e=new m(e,n,u)}}return y(this,"_buffer",e),y(this,"_length",e.byteLength/l),y(this,"_isLE",a),this}y(o,"BYTES_PER_ELEMENT",l);y(o,"name","Float64ArrayFE");y(o,"from",function(t,r){var a,e,u,i,v,f,g,b,F,w,h;if(!p(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!G(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(e=B(t),e===null||!L(e))throw new TypeError(s("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(v=D(e),u=arguments.length,u>2){if(i=arguments[2],!p(i))throw new TypeError(s("invalid argument. Third argument must be a function. Value: `%s`.",i));u>3&&(a=arguments[3])}if(q(r)){if(i){for(w=r.length,r.get&&r.set?F=P("default"):F=A("default"),f=new this(e,w),g=f._buffer,h=0;h=this._length))return this._buffer.getFloat64(t*l,this._isLE)});_(o.prototype,"length",function(){return this._length});y(o.prototype,"set",function(t){var r,a,e,u,i,v,f,g;if(!V(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(e=this._buffer,arguments.length>1){if(a=arguments[1],!E(a))throw new TypeError(s("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",a))}else a=0;if(q(t)){if(v=t.length,a+v>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=t,r.get&&r.set?i=P("default"):i=A("default"),g=e.byteOffset+a*l,r.buffer===e.buffer&&r.byteOffsetg){for(u=[],f=0;f=this._length)throw new RangeError(s("invalid argument. Index argument is out-of-bounds. Value: `%u`.",a));e.setFloat64(a*l,t,this._isLE)});y(o.prototype,"toString",function(){var t,r,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],r=this._buffer,a=0;a\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Length must be a nonnegative integer. Value: `%s`.', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object or an iterable. Value: `%s`.', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` context must be a constructor.' );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide a nonnegative integer. Value: `%s`.', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Index argument must be a nonnegative integer. Value: `%s`.', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( 'invalid arguments. Target array lacks sufficient storage to accommodate source values.' );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'invalid argument. Index argument is out-of-bounds. Value: `%u`.', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nmodule.exports = Float64ArrayFE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-float64\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cA6BA,SAASC,EAAcC,EAAK,CAC3B,IAAIC,EACAC,EAGJ,IADAD,EAAM,CAAC,EAENC,EAAIF,EAAG,KAAK,EACP,CAAAE,EAAE,MAGPD,EAAI,KAAMC,EAAE,KAAM,EAEnB,OAAOD,CACR,CAKAH,EAAO,QAAUC,IC/CjB,IAAAI,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cA+BA,SAASC,EAAiBC,EAAIC,EAAMC,EAAU,CAC7C,IAAIC,EACAC,EACAC,EAIJ,IAFAF,EAAM,CAAC,EACPE,EAAI,GAEHD,EAAIJ,EAAG,KAAK,EACP,CAAAI,EAAE,MAGPC,GAAK,EACLF,EAAI,KAAMF,EAAK,KAAMC,EAASE,EAAE,MAAOC,CAAE,CAAE,EAE5C,OAAOF,CACR,CAKAL,EAAO,QAAUC,ICpDjB,IAAAO,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cA+BA,SAASC,EAAWC,EAAMC,EAAKC,EAAO,CACrC,IAAIC,EACAC,EAGJ,IADAD,EAAMF,EAAI,OACJG,EAAI,EAAGA,EAAID,EAAKC,IACrBJ,EAAK,WAAYI,EAAE,EAAGH,EAAKG,CAAE,EAAGF,CAAK,EAEtC,OAAOF,CACR,CAKAF,EAAO,QAAUC,IC7CjB,IAAAM,EAAAC,EAAA,SAAAC,GAAAC,EAAA,cAwBA,IAAIC,EAAuB,QAAS,uCAAwC,EAAE,YAC1EC,EAAe,QAAS,8BAA+B,EACvDC,EAAgB,QAAS,+BAAgC,EACzDC,EAAW,QAAS,0BAA2B,EAC/CC,EAAa,QAAS,4BAA6B,EACnDC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAW,QAAS,oCAAqC,EAAE,QAC3DC,EAAY,QAAS,+BAAgC,EACrDC,EAA2B,QAAS,4CAA6C,EACjFC,EAAkB,QAAS,yBAA0B,EACrDC,EAAc,QAAS,uDAAwD,EAC/EC,EAAgB,QAAS,gCAAiC,EAC1DC,EAAsB,QAAS,uDAAwD,EACvFC,EAAc,QAAS,sBAAuB,EAC9CC,EAAW,QAAS,wBAAyB,EAC7CC,EAAS,QAAS,2BAA4B,EAC9CC,EAAiB,QAAS,oCAAqC,EAC/DC,EAAS,QAAS,uBAAwB,EAC1CC,EAAe,IACfC,GAAkB,IAClBC,EAAY,IAKZC,EAAoB,EACpBC,EAAsBd,EAAyB,EAC/Ce,EAAcjB,EAAU,CAAE,gBAAiB,YAAa,CAAE,EAY9D,SAASkB,EAAWC,EAAQ,CAC3B,OAASpB,EAAUoB,CAAM,EAAMlB,EAAWkB,CAAM,EAAI,IACrD,CASA,SAASC,EAAgBD,EAAQ,CAChC,OAASA,IAAU,eACpB,CASA,SAASE,EAA6BF,EAAQ,CAC7C,OAASA,IAAUG,CACpB,CASA,SAASC,EAAkBJ,EAAQ,CAClC,OACC,OAAOA,GAAU,UACjBA,IAAU,OAETA,EAAM,YAAY,OAAS,kBAC3Bd,EAAec,EAAOG,EAAe,SAAU,IAEhDH,EAAM,oBAAsBJ,CAE9B,CAsEA,SAASO,GAAiB,CACzB,IAAIE,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGJ,GADAL,EAAQ,UAAU,OACb,EAAE,gBAAgBJ,GACtB,OAAKI,EAAQ,EACL,IAAIJ,EAAgB,UAAU,CAAC,CAAE,EAEpCI,IAAU,EACP,IAAIJ,EAAgB,UAAU,CAAC,EAAG,UAAU,CAAC,CAAE,EAElDI,IAAU,EACP,IAAIJ,EAAgB,UAAU,CAAC,EAAG,UAAU,CAAC,EAAG,UAAU,CAAC,CAAE,EAE9D,IAAIA,EAAgB,UAAU,CAAC,EAAG,UAAU,CAAC,EAAG,UAAU,CAAC,EAAG,UAAU,CAAC,CAAE,EAGnF,GADAG,EAAaP,EAAW,UAAW,CAAE,CAAE,EAClCO,IAAe,MAAQ,CAACR,EAAaQ,CAAW,EACpD,MAAM,IAAI,UAAWd,EAAQ,gFAAiF,UAAW,CAAE,CAAE,CAAE,EAOhI,GALAgB,EAAOP,EAAgBK,CAAW,EAElCC,GAAS,EAGJA,IAAU,EACdE,EAAM,IAAIpB,EAAU,IAAID,EAAa,CAAE,CAAE,UAC9BmB,IAAU,EAErB,GADAI,EAAM,UAAWJ,CAAM,EAClBhC,EAAsBoC,CAAI,EAC9BF,EAAM,IAAIpB,EAAU,IAAID,EAAauB,EAAIf,CAAkB,CAAE,UAClDpB,EAAcmC,CAAI,EAC7BF,EAAMd,EAAW,IAAIN,EAAU,IAAID,EAAauB,EAAI,OAAOf,CAAkB,CAAE,EAAGe,EAAKH,CAAK,UACjF/B,EAAekC,CAAI,EAC9BF,EAAM,IAAIpB,EAAUsB,CAAI,UACbjC,EAAUiC,CAAI,EAAI,CAC7B,GAAKd,IAAwB,GAC5B,MAAM,IAAI,UAAWL,EAAQ,mJAAoJmB,CAAI,CAAE,EAExL,GAAK,CAAChC,EAAYgC,EAAK3B,CAAgB,CAAE,EACxC,MAAM,IAAI,UAAWQ,EAAQ,qHAAsHmB,CAAI,CAAE,EAG1J,GADAF,EAAME,EAAK3B,CAAgB,EAAE,EACxB,CAACL,EAAY8B,EAAI,IAAK,EAC1B,MAAM,IAAI,UAAWjB,EAAQ,qHAAsHmB,CAAI,CAAE,EAE1JC,EAAMnB,EAAcgB,CAAI,EACxBA,EAAMd,EAAW,IAAIN,EAAU,IAAID,EAAawB,EAAI,OAAOhB,CAAkB,CAAE,EAAGgB,EAAKJ,CAAK,CAC7F,KACC,OAAM,IAAI,UAAWhB,EAAQ,qHAAsHmB,CAAI,CAAE,MAEpJ,CAEN,GADAF,EAAM,UAAW,CAAE,EACd,CAAChC,EAAegC,CAAI,EACxB,MAAM,IAAI,UAAWjB,EAAQ,8DAA+DiB,CAAI,CAAE,EAGnG,GADAJ,EAAa,UAAW,CAAE,EACrB,CAAC9B,EAAsB8B,CAAW,EACtC,MAAM,IAAI,UAAWb,EAAQ,4EAA6Ea,CAAW,CAAE,EAExH,GAAKE,IAAU,EACdE,EAAM,IAAIpB,EAAUoB,EAAKJ,CAAW,MAC9B,CAEN,GADAK,EAAM,UAAW,CAAE,EACd,CAACnC,EAAsBmC,CAAI,EAC/B,MAAM,IAAI,UAAWlB,EAAQ,uEAAwEkB,CAAI,CAAE,EAG5G,GADAA,GAAOd,EACFc,EAAOD,EAAI,WAAWJ,EAC1B,MAAM,IAAI,WAAYb,EAAQ,iJAAkJkB,CAAI,CAAE,EAEvLD,EAAM,IAAIpB,EAAUoB,EAAKJ,EAAYK,CAAI,CAC1C,CACD,CACA,OAAAzB,EAAa,KAAM,UAAWwB,CAAI,EAClCxB,EAAa,KAAM,UAAWwB,EAAI,WAAWb,CAAkB,EAC/DX,EAAa,KAAM,QAASuB,CAAK,EAE1B,IACR,CAeAvB,EAAakB,EAAgB,oBAAqBP,CAAkB,EAepEX,EAAakB,EAAgB,OAAQ,gBAAiB,EAqCtDlB,EAAakB,EAAgB,OAAQ,SAAeG,EAAYO,EAAM,CACrE,IAAIC,EACAC,EACAR,EACAS,EACAR,EACAS,EACAR,EACAG,EACAM,EACAR,EACAS,EACJ,GAAK,CAACxC,EAAY,IAAK,EACtB,MAAM,IAAI,UAAW,2DAA4D,EAElF,GAAK,CAACuB,EAA6B,IAAK,EACvC,MAAM,IAAI,UAAW,qDAAsD,EAG5E,GADAa,EAAQhB,EAAWO,CAAW,EACzBS,IAAU,MAAQ,CAACjB,EAAaiB,CAAM,EAC1C,MAAM,IAAI,UAAWvB,EAAQ,gFAAiFc,CAAW,CAAE,EAK5H,GAHAE,EAAOP,EAAgBc,CAAM,EAE7BR,EAAQ,UAAU,OACbA,EAAQ,EAAI,CAEhB,GADAS,EAAO,UAAW,CAAE,EACf,CAACrC,EAAYqC,CAAK,EACtB,MAAM,IAAI,UAAWxB,EAAQ,oEAAqEwB,CAAK,CAAE,EAErGT,EAAQ,IACZO,EAAU,UAAW,CAAE,EAEzB,CACA,GAAKtC,EAAcqC,CAAI,EAAI,CAC1B,GAAKG,EAAO,CASX,IARAN,EAAMG,EAAI,OACLA,EAAI,KAAOA,EAAI,IACnBK,EAAM3B,EAAgB,SAAU,EAEhC2B,EAAM5B,EAAQ,SAAU,EAEzB2B,EAAM,IAAI,KAAMF,EAAOL,CAAI,EAC3BD,EAAMQ,EAAI,QACJE,EAAI,EAAGA,EAAIT,EAAKS,IACrBV,EAAI,WAAYU,EAAEvB,EAAmBoB,EAAK,KAAMF,EAASI,EAAKL,EAAKM,CAAE,EAAGA,CAAE,EAAGX,CAAK,EAEnF,OAAOS,CACR,CACA,OAAO,IAAI,KAAMF,EAAOF,CAAI,CAC7B,CACA,GAAKnC,EAAUmC,CAAI,GAAKhB,GAAuBlB,EAAYkC,EAAK7B,CAAgB,CAAE,EAAI,CAErF,GADAyB,EAAMI,EAAK7B,CAAgB,EAAE,EACxB,CAACL,EAAY8B,EAAI,IAAK,EAC1B,MAAM,IAAI,UAAWjB,EAAQ,8FAA+FqB,CAAI,CAAE,EAUnI,IARKG,EACJJ,EAAMlB,GAAiBe,EAAKO,EAAMF,CAAQ,EAE1CF,EAAMnB,EAAcgB,CAAI,EAEzBC,EAAME,EAAI,OACVK,EAAM,IAAI,KAAMF,EAAOL,CAAI,EAC3BD,EAAMQ,EAAI,QACJE,EAAI,EAAGA,EAAIT,EAAKS,IACrBV,EAAI,WAAYU,EAAEvB,EAAmBgB,EAAKO,CAAE,EAAGX,CAAK,EAErD,OAAOS,CACR,CACA,MAAM,IAAI,UAAWzB,EAAQ,8FAA+FqB,CAAI,CAAE,CACnI,CAAC,EAsBD5B,EAAakB,EAAgB,KAAM,SAAaG,EAAa,CAC5D,IAAIS,EACAK,EACAD,EACJ,GAAK,CAACxC,EAAY,IAAK,EACtB,MAAM,IAAI,UAAW,2DAA4D,EAElF,GAAK,CAACuB,EAA6B,IAAK,EACvC,MAAM,IAAI,UAAW,qDAAsD,EAG5E,GADAa,EAAQhB,EAAWO,CAAW,EACzBS,IAAU,MAAQ,CAACjB,EAAaiB,CAAM,EAC1C,MAAM,IAAI,UAAWvB,EAAQ,gFAAiFc,CAAW,CAAE,EAG5H,IADAc,EAAO,CAAC,EACFD,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAClCC,EAAK,KAAM,UAAWD,CAAE,CAAE,EAE3B,OAAO,IAAI,KAAMJ,EAAOK,CAAK,CAC9B,CAAC,EAgBDjC,EAAqBgB,EAAe,UAAW,SAAU,UAAe,CACvE,OAAO,KAAK,QAAQ,MACrB,CAAC,EAgBDhB,EAAqBgB,EAAe,UAAW,aAAc,UAAe,CAC3E,OAAO,KAAK,QAAQ,UACrB,CAAC,EAgBDhB,EAAqBgB,EAAe,UAAW,aAAc,UAAe,CAC3E,OAAO,KAAK,QAAQ,UACrB,CAAC,EAiBDlB,EAAakB,EAAe,UAAW,oBAAqBA,EAAe,iBAAkB,EA2B7FlB,EAAakB,EAAe,UAAW,MAAO,SAAckB,EAAM,CACjE,GAAK,CAACjB,EAAkB,IAAK,EAC5B,MAAM,IAAI,UAAW,qDAAsD,EAE5E,GAAK,CAAC7B,EAAsB8C,CAAI,EAC/B,MAAM,IAAI,UAAW7B,EAAQ,qEAAsE6B,CAAI,CAAE,EAE1G,GAAK,EAAAA,GAAO,KAAK,SAGjB,OAAO,KAAK,QAAQ,WAAYA,EAAIzB,EAAmB,KAAK,KAAM,CACnE,CAAC,EAgBDT,EAAqBgB,EAAe,UAAW,SAAU,UAAe,CACvE,OAAO,KAAK,OACb,CAAC,EA+CDlB,EAAakB,EAAe,UAAW,MAAO,SAAcH,EAAQ,CACnE,IAAIsB,EACAD,EACAZ,EACAG,EACAM,EACAK,EACAJ,EACAK,EACJ,GAAK,CAACpB,EAAkB,IAAK,EAC5B,MAAM,IAAI,UAAW,qDAAsD,EAG5E,GADAK,EAAM,KAAK,QACN,UAAU,OAAS,GAEvB,GADAY,EAAM,UAAW,CAAE,EACd,CAAC9C,EAAsB8C,CAAI,EAC/B,MAAM,IAAI,UAAW7B,EAAQ,+EAAgF6B,CAAI,CAAE,OAGpHA,EAAM,EAEP,GAAK7C,EAAcwB,CAAM,EAAI,CAE5B,GADAuB,EAAIvB,EAAM,OACLqB,EAAIE,EAAI,KAAK,QACjB,MAAM,IAAI,WAAY,wFAAyF,EAUhH,GARAD,EAAOtB,EACFsB,EAAK,KAAOA,EAAK,IACrBJ,EAAM3B,EAAgB,SAAU,EAEhC2B,EAAM5B,EAAQ,SAAU,EAGzBkC,EAAIf,EAAI,WAAcY,EAAIzB,EAEzB0B,EAAK,SAAWb,EAAI,QAEnBa,EAAK,WAAaE,GAClBF,EAAK,WAAWA,EAAK,WAAaE,EAElC,CAGD,IADAZ,EAAM,CAAC,EACDO,EAAI,EAAGA,EAAInB,EAAM,OAAQmB,IAC9BP,EAAI,KAAMM,EAAKlB,EAAOmB,CAAE,CAAE,EAE3BG,EAAOV,EACPM,EAAM5B,EAAQ,SAAU,CACzB,CACA,IAAM6B,EAAI,EAAGA,EAAII,EAAGF,IAAOF,IAC1BV,EAAI,WAAYY,EAAIzB,EAAmBsB,EAAKI,EAAMH,CAAE,EAAG,KAAK,KAAM,EAEnE,MACD,CACA,GAAKE,GAAO,KAAK,QAChB,MAAM,IAAI,WAAY7B,EAAQ,kEAAmE6B,CAAI,CAAE,EAExGZ,EAAI,WAAYY,EAAIzB,EAAmBI,EAAO,KAAK,KAAM,CAC1D,CAAC,EAqBDf,EAAakB,EAAe,UAAW,WAAY,UAAoB,CACtE,IAAIc,EACAR,EACAU,EACJ,GAAK,CAACf,EAAkB,IAAK,EAC5B,MAAM,IAAI,UAAW,qDAAsD,EAI5E,IAFAa,EAAM,CAAC,EACPR,EAAM,KAAK,QACLU,EAAI,EAAGA,EAAI,KAAK,QAASA,IAC9BF,EAAI,KAAMR,EAAI,WAAYU,EAAEvB,EAAmB,KAAK,KAAM,CAAE,EAE7D,OAAOqB,EAAI,KAAM,GAAI,CACtB,CAAC,EAKD3C,EAAO,QAAU6B,IC/mBjB,IAAIsB,GAAO,IAKX,OAAO,QAAUA", - "names": ["require_from_iterator", "__commonJSMin", "exports", "module", "fromIterator", "it", "out", "v", "require_from_iterator_map", "__commonJSMin", "exports", "module", "fromIteratorMap", "it", "clbk", "thisArg", "out", "v", "i", "require_from_array", "__commonJSMin", "exports", "module", "fromArray", "view", "arr", "isLE", "len", "i", "require_main", "__commonJSMin", "exports", "module", "isNonNegativeInteger", "isCollection", "isArrayBuffer", "isObject", "isFunction", "isString", "contains", "lowercase", "hasIteratorSymbolSupport", "ITERATOR_SYMBOL", "setReadOnly", "isPrototypeOf", "setReadOnlyAccessor", "ArrayBuffer", "DataView", "getter", "accessorGetter", "format", "fromIterator", "fromIteratorMap", "fromArray", "BYTES_PER_ELEMENT", "HAS_ITERATOR_SYMBOL", "isByteOrder", "byteOrder", "value", "isLittleEndian", "isFloat64ArrayFEConstructor", "Float64ArrayFE", "isFloat64ArrayFE", "byteOffset", "endianness", "nargs", "isLE", "buf", "len", "arg", "tmp", "src", "thisArg", "order", "clbk", "out", "get", "i", "args", "idx", "sbuf", "N", "j", "main"] -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index fe5213c..0000000 --- a/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Float64Array = require( '@stdlib/array-float64' ); -var logEach = require( '@stdlib/console-log-each' ); -var Float64ArrayFE = require( './../lib' ); - -// Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); -logEach( '%s', out ); - -// Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; -out = new Float64ArrayFE( 'big-endian', arr ); -logEach( '%s', out ); - -// Create a typed array from an array buffer: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'little-endian', arr.buffer ); -logEach( '%s', out ); - -// Create a typed array from an array buffer view: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'big-endian', arr.buffer, 8, 2 ); -logEach( '%s', out ); diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..7ded7b9 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import{isPrimitive as t}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-nonnegative-integer@v0.2.2-esm/index.mjs";import e from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-collection@v0.2.2-esm/index.mjs";import r from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-arraybuffer@v0.2.2-esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-object@v0.2.2-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-function@v0.2.2-esm/index.mjs";import{isPrimitive as i}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-string@v0.2.2-esm/index.mjs";import{factory as o}from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-assert-contains@v0.2.2-esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/string-base-lowercase@v0.4.0-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-has-iterator-symbol-support@v0.2.2-esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/symbol-iterator@v0.2.2-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-property@v0.2.1-esm/index.mjs";import u from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-prototype-of@v0.2.2-esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-accessor@v0.2.2-esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/array-buffer@v0.2.2-esm/index.mjs";import m from"https://cdn.jsdelivr.net/gh/stdlib-js/array-dataview@v0.2.2-esm/index.mjs";import w from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-getter@v0.2.2-esm/index.mjs";import g from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-accessor-getter@v0.2.2-esm/index.mjs";import v from"https://cdn.jsdelivr.net/gh/stdlib-js/error-tools-fmtprodmsg@v0.2.2-esm/index.mjs";function y(t){var e,r;for(e=[];!(r=t.next()).done;)e.push(r.value);return e}function b(t,e,r){var n,s;for(n=e.length,s=0;su.byteLength-i)throw new RangeError(v("null2G",d));u=new m(u,i,d)}}return a(this,"_buffer",u),a(this,"_length",u.byteLength/j),a(this,"_isLE",f),this}a(L,"BYTES_PER_ELEMENT",j),a(L,"name","Float64ArrayFE"),a(L,"from",(function(t,r){var i,o,l,f,a,u,d,p,m,b,x;if(!s(this))throw new TypeError(v("null01"));if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(null===(o=T(t))||!c(o))throw new TypeError(v("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(a=_(o),(l=arguments.length)>2){if(!s(f=arguments[2]))throw new TypeError(v("null3N",f));l>3&&(i=arguments[3])}if(e(r)){if(f){for(b=r.length,m=r.get&&r.set?g("default"):w("default"),d=(u=new this(o,b))._buffer,x=0;x=this._length))return this._buffer.getFloat64(e*j,this._isLE)})),d(L.prototype,"length",(function(){return this._length})),a(L.prototype,"set",(function(r){var n,s,i,o,l,f,h,a;if(!x(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(i=this._buffer,arguments.length>1){if(!t(s=arguments[1]))throw new TypeError(v("null2L",s))}else s=0;if(e(r)){if(s+(f=r.length)>this._length)throw new RangeError(v("null03"));if(l=(n=r).get&&n.set?g("default"):w("default"),a=i.byteOffset+s*j,n.buffer===i.buffer&&n.byteOffseta){for(o=[],h=0;h=this._length)throw new RangeError(v("null2M",s));i.setFloat64(s*j,r,this._isLE)}})),a(L.prototype,"toString",(function(){var t,e,r;if(!x(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],e=this._buffer,r=0;r\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'null29', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'null2C', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2F', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'null2G', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'null3N', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'nullAt', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'nullAt', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'null2K', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'null2L', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( format('null03') );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'null2M', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( clbk.call( thisArg, v.value, i ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n"],"names":["fromIterator","it","out","v","next","done","push","value","fromArray","view","arr","isLE","len","i","length","setFloat64","BYTES_PER_ELEMENT","HAS_ITERATOR_SYMBOL","hasIteratorSymbolSupport","isByteOrder","contains","byteOrder","isString","lowercase","isLittleEndian","isFloat64ArrayFEConstructor","Float64ArrayFE","isFloat64ArrayFE","constructor","name","isPrototypeOf","prototype","byteOffset","endianness","nargs","buf","arg","tmp","arguments","this","TypeError","format","DataView","ArrayBuffer","isNonNegativeInteger","isCollection","isArrayBuffer","isObject","isFunction","ITERATOR_SYMBOL","byteLength","RangeError","setReadOnly","src","thisArg","order","clbk","get","set","accessorGetter","getter","_buffer","call","fromIteratorMap","args","setReadOnlyAccessor","buffer","idx","_length","getFloat64","_isLE","sbuf","N","j","join"],"mappings":"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"} \ No newline at end of file diff --git a/lib/from_array.js b/lib/from_array.js deleted file mode 100644 index c8cfb23..0000000 --- a/lib/from_array.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Fills an output DataView with double-precision values. -* -* @private -* @param {DataView} view - output data view -* @param {Array} arr - input array -* @param {boolean} isLE - boolean indicating whether the store values in little-endian byte order -* @returns {DataView} output data view -*/ -function fromArray( view, arr, isLE ) { - var len; - var i; - - len = arr.length; - for ( i = 0; i < len; i++ ) { - view.setFloat64( i*8, arr[ i ], isLE ); // FIXME: handle accessor arrays, FIXME: avoid hardcoding bytes per element - } - return view; -} - - -// EXPORTS // - -module.exports = fromArray; diff --git a/lib/from_iterator.js b/lib/from_iterator.js deleted file mode 100644 index c1adb5d..0000000 --- a/lib/from_iterator.js +++ /dev/null @@ -1,48 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Returns an array of iterated values. -* -* @private -* @param {Object} it - iterator -* @returns {Array} output array -*/ -function fromIterator( it ) { - var out; - var v; - - out = []; - while ( true ) { - v = it.next(); - if ( v.done ) { - break; - } - out.push( v.value ); - } - return out; -} - - -// EXPORTS // - -module.exports = fromIterator; diff --git a/lib/from_iterator_map.js b/lib/from_iterator_map.js deleted file mode 100644 index 9a6e354..0000000 --- a/lib/from_iterator_map.js +++ /dev/null @@ -1,53 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* Returns an array of iterated values. -* -* @private -* @param {Object} it - iterator -* @param {Function} clbk - callback to invoke for each iterated value -* @param {*} thisArg - invocation context -* @returns {Array} output array -*/ -function fromIteratorMap( it, clbk, thisArg ) { - var out; - var v; - var i; - - out = []; - i = -1; - while ( true ) { - v = it.next(); - if ( v.done ) { - break; - } - i += 1; - out.push( clbk.call( thisArg, v.value, i ) ); - } - return out; -} - - -// EXPORTS // - -module.exports = fromIteratorMap; diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 2be932f..0000000 --- a/lib/index.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @module @stdlib/array-fixed-endian-float64 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 1c87ce9..0000000 --- a/lib/main.js +++ /dev/null @@ -1,712 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -/* eslint-disable max-len, no-restricted-syntax, no-invalid-this */ - -'use strict'; - -// MODULES // - -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var isCollection = require( '@stdlib/assert-is-collection' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isObject = require( '@stdlib/assert-is-object' ); -var isFunction = require( '@stdlib/assert-is-function' ); -var isString = require( '@stdlib/assert-is-string' ).isPrimitive; -var contains = require( '@stdlib/array-base-assert-contains' ).factory; -var lowercase = require( '@stdlib/string-base-lowercase' ); -var hasIteratorSymbolSupport = require( '@stdlib/assert-has-iterator-symbol-support' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' ); -var isPrototypeOf = require( '@stdlib/assert-is-prototype-of' ); // eslint-disable-line stdlib/no-redeclare -var setReadOnlyAccessor = require( '@stdlib/utils-define-nonenumerable-read-only-accessor' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var DataView = require( '@stdlib/array-dataview' ); -var getter = require( '@stdlib/array-base-getter' ); -var accessorGetter = require( '@stdlib/array-base-accessor-getter' ); -var format = require( '@stdlib/error-tools-fmtprodmsg' ); -var fromIterator = require( './from_iterator.js' ); -var fromIteratorMap = require( './from_iterator_map.js' ); -var fromArray = require( './from_array.js' ); - - -// VARIABLES // - -var BYTES_PER_ELEMENT = 8; // 8 bytes per double -var HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport(); -var isByteOrder = contains( [ 'little-endian', 'big-endian' ] ); - - -// FUNCTIONS // - -/** -* Normalizes a byte order value. -* -* @private -* @param {*} value - byte order -* @returns {(string|null)} normalized byte order -*/ -function byteOrder( value ) { - return ( isString( value ) ) ? lowercase( value ) : null; -} - -/** -* Tests whether a provided byte order is little-endian byte order. -* -* @private -* @param {string} value - byte order -* @returns {boolean} boolean indicating whether a byte order is little-endian byte order -*/ -function isLittleEndian( value ) { - return ( value === 'little-endian' ); -} - -/** -* Returns a boolean indicating if a value is a `Float64ArrayFE` constructor. -* -* @private -* @param {*} value - value to test -* @returns {boolean} boolean indicating if a value is a `Float64ArrayFE` constructor -*/ -function isFloat64ArrayFEConstructor( value ) { // eslint-disable-line id-length - return ( value === Float64ArrayFE ); -} - -/** -* Returns a boolean indicating if a value is a `Float64ArrayFE`. -* -* @private -* @param {*} value - value to test -* @returns {boolean} boolean indicating if a value is a `Float64ArrayFE` -*/ -function isFloat64ArrayFE( value ) { - return ( - typeof value === 'object' && - value !== null && - ( - value.constructor.name === 'Float64ArrayFE' || - isPrototypeOf( value, Float64ArrayFE.prototype ) - ) && - value.BYTES_PER_ELEMENT === BYTES_PER_ELEMENT - ); -} - - -// MAIN // - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @constructor -* @param {string} endianness - byte order -* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable -* @param {NonNegativeInteger} [byteOffset=0] - byte offset -* @param {NonNegativeInteger} [length] - view length -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument -* @throws {TypeError} byte offset must be a nonnegative integer -* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -function Float64ArrayFE() { - var byteOffset; - var endianness; - var nargs; - var isLE; - var buf; - var len; - var arg; - var tmp; - - nargs = arguments.length; - if ( !(this instanceof Float64ArrayFE) ) { - if ( nargs < 2 ) { - return new Float64ArrayFE( arguments[0] ); - } - if ( nargs === 2 ) { - return new Float64ArrayFE( arguments[0], arguments[1] ); - } - if ( nargs === 3 ) { - return new Float64ArrayFE( arguments[0], arguments[1], arguments[2] ); - } - return new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] ); - } - endianness = byteOrder( arguments[ 0 ] ); - if ( endianness === null || !isByteOrder( endianness ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) ); - } - isLE = isLittleEndian( endianness ); - - nargs -= 1; - - // Create the underlying data buffer... - if ( nargs === 0 ) { - buf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility - } else if ( nargs === 1 ) { - arg = arguments[ nargs ]; - if ( isNonNegativeInteger( arg ) ) { - buf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) ); - } else if ( isCollection( arg ) ) { - buf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE ); - } else if ( isArrayBuffer( arg ) ) { - buf = new DataView( arg ); - } else if ( isObject( arg ) ) { - if ( HAS_ITERATOR_SYMBOL === false ) { - throw new TypeError( format( 'null29', arg ) ); - } - if ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) { - throw new TypeError( format( 'null2A', arg ) ); - } - buf = arg[ ITERATOR_SYMBOL ](); - if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'null2A', arg ) ); - } - tmp = fromIterator( buf ); - buf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE ); - } else { - throw new TypeError( format( 'null2A', arg ) ); - } - } else { - buf = arguments[ 1 ]; - if ( !isArrayBuffer( buf ) ) { - throw new TypeError( format( 'invalid argument. Must provide an ArrayBuffer. Value: `%s`.', buf ) ); - } - byteOffset = arguments[ 2 ]; - if ( !isNonNegativeInteger( byteOffset ) ) { - throw new TypeError( format( 'null2C', byteOffset ) ); - } - if ( nargs === 2 ) { - buf = new DataView( buf, byteOffset ); - } else { - len = arguments[ 3 ]; - if ( !isNonNegativeInteger( len ) ) { - throw new TypeError( format( 'null2F', len ) ); - } - len *= BYTES_PER_ELEMENT; - if ( len > (buf.byteLength-byteOffset) ) { - throw new RangeError( format( 'null2G', len ) ); - } - buf = new DataView( buf, byteOffset, len ); - } - } - setReadOnly( this, '_buffer', buf ); - setReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT ); - setReadOnly( this, '_isLE', isLE ); - - return this; -} - -/** -* Size (in bytes) of each array element. -* -* @name BYTES_PER_ELEMENT -* @memberof Float64ArrayFE -* @readonly -* @type {PositiveInteger} -* @default 8 -* -* @example -* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT; -* // returns 8 -*/ -setReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT ); - -/** -* Constructor name. -* -* @name name -* @memberof Float64ArrayFE -* @readonly -* @type {string} -* @default 'Float64ArrayFE' -* -* @example -* var str = Float64ArrayFE.name; -* // returns 'Float64ArrayFE' -*/ -setReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' ); - -/** -* Creates a new `Float64ArrayFE` from an array-like object or an iterable. -* -* @name from -* @memberof Float64ArrayFE -* @type {Function} -* @param {string} endianness - byte order -* @param {(Collection|Iterable)} src - array-like object or iterable -* @param {Function} [clbk] - callback to invoke for each source element -* @param {*} [thisArg] - context -* @throws {TypeError} `this` context must be a constructor -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} second argument must be an array-like object or an iterable -* @throws {TypeError} third argument must be a function -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* function clbk( v ) { -* return v * 2.0; -* } -* -* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -setReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) { - var thisArg; - var order; - var nargs; - var clbk; - var isLE; - var out; - var buf; - var tmp; - var get; - var len; - var i; - if ( !isFunction( this ) ) { - throw new TypeError( format('null01') ); - } - if ( !isFloat64ArrayFEConstructor( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - order = byteOrder( endianness ); - if ( order === null || !isByteOrder( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) ); - } - isLE = isLittleEndian( order ); - - nargs = arguments.length; - if ( nargs > 2 ) { - clbk = arguments[ 2 ]; - if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'null3N', clbk ) ); - } - if ( nargs > 3 ) { - thisArg = arguments[ 3 ]; - } - } - if ( isCollection( src ) ) { - if ( clbk ) { - len = src.length; - if ( src.get && src.set ) { - get = accessorGetter( 'default' ); - } else { - get = getter( 'default' ); - } - out = new this( order, len ); - buf = out._buffer; // eslint-disable-line no-underscore-dangle - for ( i = 0; i < len; i++ ) { - buf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE ); - } - return out; - } - return new this( order, src ); - } - if ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) { - buf = src[ ITERATOR_SYMBOL ](); - if ( !isFunction( buf.next ) ) { - throw new TypeError( format( 'nullAt', src ) ); - } - if ( clbk ) { - tmp = fromIteratorMap( buf, clbk, thisArg ); - } else { - tmp = fromIterator( buf ); - } - len = tmp.length; - out = new this( order, len ); - buf = out._buffer; // eslint-disable-line no-underscore-dangle - for ( i = 0; i < len; i++ ) { - buf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE ); - } - return out; - } - throw new TypeError( format( 'nullAt', src ) ); -}); - -/** -* Creates a new `Float64ArrayFE` from a variable number of arguments. -* -* @name of -* @memberof Float64ArrayFE -* @type {Function} -* @param {string} endianness - byte order -* @param {...*} element - array elements -* @throws {TypeError} `this` context must be a constructor -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} first argument must be a supported byte order -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 ); -* // returns -* -* var len = arr.length; -* // returns 4 -*/ -setReadOnly( Float64ArrayFE, 'of', function of( endianness ) { - var order; - var args; - var i; - if ( !isFunction( this ) ) { - throw new TypeError( format('null01') ); - } - if ( !isFloat64ArrayFEConstructor( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - order = byteOrder( endianness ); - if ( order === null || !isByteOrder( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) ); - } - args = []; - for ( i = 1; i < arguments.length; i++ ) { - args.push( arguments[ i ] ); - } - return new this( order, args ); -}); - -/** -* Pointer to the underlying data buffer. -* -* @name buffer -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {ArrayBuffer} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var buf = arr.buffer; -* // returns -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() { - return this._buffer.buffer; -}); - -/** -* Size (in bytes) of the array. -* -* @name byteLength -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var byteLength = arr.byteLength; -* // returns 80 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() { - return this._buffer.byteLength; -}); - -/** -* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`. -* -* @name byteOffset -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var byteOffset = arr.byteOffset; -* // returns 0 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() { - return this._buffer.byteOffset; -}); - -/** -* Size (in bytes) of each array element. -* -* @name BYTES_PER_ELEMENT -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {PositiveInteger} -* @default 8 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var nbytes = arr.BYTES_PER_ELEMENT; -* // returns 8 -*/ -setReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT ); - -/** -* Returns an array element. -* -* @name get -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @param {NonNegativeInteger} idx - element index -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} must provide a nonnegative integer -* @returns {(number|void)} array element -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var v = arr.get( 0 ); -* // returns 0.0 -* -* arr.set( [ 1.0, 2.0 ], 0 ); -* -* v = arr.get( 0 ); -* // returns 1.0 -* -* v = arr.get( 100 ); -* // returns undefined -*/ -setReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) { - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'null2K', idx ) ); - } - if ( idx >= this._length ) { - return; - } - return this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE ); -}); - -/** -* Number of array elements. -* -* @name length -* @memberof Float64ArrayFE.prototype -* @readonly -* @type {NonNegativeInteger} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var len = arr.length; -* // returns 10 -*/ -setReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() { - return this._length; -}); - -/** -* Sets an array element. -* -* ## Notes -* -* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario: -* -* ```text -* buf: --------------------- -* src: --------------------- -* ``` -* -* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array. -* -* In the other overlapping scenario, -* -* ```text -* buf: --------------------- -* src: --------------------- -* ``` -* -* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended. -* -* @name set -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @param {(Collection|Float64ArrayFE|*)} value - value(s) -* @param {NonNegativeInteger} [i=0] - element index at which to start writing values -* @throws {TypeError} `this` must be a Float64ArrayFE -* @throws {TypeError} index argument must be a nonnegative integer -* @throws {RangeError} index argument is out-of-bounds -* @throws {RangeError} target array lacks sufficient storage to accommodate source values -* @returns {void} -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 10 ); -* -* var v = arr.get( 0 ); -* // returns 0.0 -* -* arr.set( [ 1.0, 2.0 ], 0 ); -* -* v = arr.get( 0 ); -* // returns 1.0 -*/ -setReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) { - var sbuf; - var idx; - var buf; - var tmp; - var get; - var N; - var i; - var j; - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - buf = this._buffer; - if ( arguments.length > 1 ) { - idx = arguments[ 1 ]; - if ( !isNonNegativeInteger( idx ) ) { - throw new TypeError( format( 'null2L', idx ) ); - } - } else { - idx = 0; - } - if ( isCollection( value ) ) { - N = value.length; - if ( idx+N > this._length ) { - throw new RangeError( format('null03') ); - } - sbuf = value; - if ( sbuf.get && sbuf.set ) { - get = accessorGetter( 'default' ); - } else { - get = getter( 'default' ); - } - // Check for overlapping memory... - j = buf.byteOffset + (idx*BYTES_PER_ELEMENT); - if ( - sbuf.buffer === buf.buffer && - ( - sbuf.byteOffset < j && - sbuf.byteOffset+sbuf.byteLength > j - ) - ) { - // We need to copy source values... - tmp = []; - for ( i = 0; i < value.length; i++ ) { - tmp.push( get( value, i ) ); - } - sbuf = tmp; - get = getter( 'default' ); - } - for ( i = 0; i < N; idx++, i++ ) { - buf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE ); - } - return; - } - if ( idx >= this._length ) { - throw new RangeError( format( 'null2M', idx ) ); - } - buf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE ); -}); - -/** -* Serializes an array as a string. -* -* @name toString -* @memberof Float64ArrayFE.prototype -* @type {Function} -* @throws {TypeError} `this` must be a Float64ArrayFE -* @returns {string} string representation -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 3 ); -* -* arr.set( 1.0, 0 ); -* arr.set( 2.0, 1 ); -* arr.set( 3.0, 2 ); -* -* var str = arr.toString(); -* // returns '1,2,3' -*/ -setReadOnly( Float64ArrayFE.prototype, 'toString', function toString() { - var out; - var buf; - var i; - if ( !isFloat64ArrayFE( this ) ) { - throw new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' ); - } - out = []; - buf = this._buffer; - for ( i = 0; i < this._length; i++ ) { - out.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) ); - } - return out.join( ',' ); -}); - - -// EXPORTS // - -module.exports = Float64ArrayFE; diff --git a/package.json b/package.json index 917c478..cd69010 100644 --- a/package.json +++ b/package.json @@ -3,30 +3,8 @@ "version": "0.0.0", "description": "Float64Array having a specified byte order.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -35,54 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-base-accessor-getter": "^0.2.2", - "@stdlib/array-base-assert-contains": "^0.2.2", - "@stdlib/array-base-getter": "^0.2.2", - "@stdlib/array-buffer": "^0.2.2", - "@stdlib/array-dataview": "^0.2.2", - "@stdlib/assert-has-iterator-symbol-support": "^0.2.2", - "@stdlib/assert-is-arraybuffer": "^0.2.2", - "@stdlib/assert-is-collection": "^0.2.2", - "@stdlib/assert-is-function": "^0.2.2", - "@stdlib/assert-is-nonnegative-integer": "^0.2.2", - "@stdlib/assert-is-object": "^0.2.2", - "@stdlib/assert-is-prototype-of": "^0.2.2", - "@stdlib/assert-is-string": "^0.2.2", - "@stdlib/string-base-lowercase": "^0.4.0", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2", - "@stdlib/symbol-iterator": "^0.2.2", - "@stdlib/utils-define-nonenumerable-read-only-accessor": "^0.2.3", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/array-float64": "^0.2.2", - "@stdlib/array-zero-to": "^0.2.2", - "@stdlib/assert-is-number": "^0.2.2", - "@stdlib/console-log-each": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/random-array-randu": "^0.2.1", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..a0464ed --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index fc72bbf..0000000 --- a/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF 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 ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -// TODO: add tests From f8d17e9bc6e4e9776b87326884810948b570a131 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 22 Sep 2024 04:12:07 +0000 Subject: [PATCH 09/22] Update README.md for ESM bundle v0.0.0 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e8a902..2e3f20f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ In contrast to the [`Float64Array`][@stdlib/array/float64] typed array construct ## Usage ```javascript -import Float64ArrayFE from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-float64@esm/index.mjs'; +import Float64ArrayFE from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-float64@v0.0.0-esm/index.mjs'; ``` #### Float64ArrayFE( endianness ) @@ -404,7 +404,7 @@ var str = arr.toString(); import Float64Array from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-float64@esm/index.mjs'; import logEach from 'https://cdn.jsdelivr.net/gh/stdlib-js/console-log-each@esm/index.mjs'; -import Float64ArrayFE from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-float64@esm/index.mjs'; +import Float64ArrayFE from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-float64@v0.0.0-esm/index.mjs'; // Create a typed array by specifying a length: var out = new Float64ArrayFE( 'little-endian', 3 ); From 5cc8c3773ad7fdc1745ab068cf078e7a38c37544 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 22 Sep 2024 04:12:07 +0000 Subject: [PATCH 10/22] Auto-generated commit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e3f20f..4097374 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,11 @@ In contrast to the [`Float64Array`][@stdlib/array/float64] typed array construct ## Usage +```javascript +import Float64ArrayFE from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-float64@esm/index.mjs'; +``` +The previous example will load the latest bundled code from the esm branch. Alternatively, you may load a specific version by loading the file from one of the [tagged bundles](https://github.com/stdlib-js/array-fixed-endian-float64/tags). For example, + ```javascript import Float64ArrayFE from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-float64@v0.0.0-esm/index.mjs'; ``` @@ -404,7 +409,7 @@ var str = arr.toString(); import Float64Array from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-float64@esm/index.mjs'; import logEach from 'https://cdn.jsdelivr.net/gh/stdlib-js/console-log-each@esm/index.mjs'; -import Float64ArrayFE from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-float64@v0.0.0-esm/index.mjs'; +import Float64ArrayFE from 'https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-float64@esm/index.mjs'; // Create a typed array by specifying a length: var out = new Float64ArrayFE( 'little-endian', 3 ); From 996bb754c6c607a0000069f84777172378c610f6 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 25 Sep 2024 06:49:44 +0000 Subject: [PATCH 11/22] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 478c95f..78064e6 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,8 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main" + "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/array-buffer": "^0.2.2", @@ -93,4 +94,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 01f9d4d38fc2931ddac6508f53e157ccce3a6b05 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 25 Sep 2024 06:50:14 +0000 Subject: [PATCH 12/22] Remove files --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 3 files changed, 4847 deletions(-) delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 7ded7b9..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import{isPrimitive as t}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-nonnegative-integer@v0.2.2-esm/index.mjs";import e from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-collection@v0.2.2-esm/index.mjs";import r from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-arraybuffer@v0.2.2-esm/index.mjs";import n from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-object@v0.2.2-esm/index.mjs";import s from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-function@v0.2.2-esm/index.mjs";import{isPrimitive as i}from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-string@v0.2.2-esm/index.mjs";import{factory as o}from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-assert-contains@v0.2.2-esm/index.mjs";import l from"https://cdn.jsdelivr.net/gh/stdlib-js/string-base-lowercase@v0.4.0-esm/index.mjs";import f from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-has-iterator-symbol-support@v0.2.2-esm/index.mjs";import h from"https://cdn.jsdelivr.net/gh/stdlib-js/symbol-iterator@v0.2.2-esm/index.mjs";import a from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-property@v0.2.1-esm/index.mjs";import u from"https://cdn.jsdelivr.net/gh/stdlib-js/assert-is-prototype-of@v0.2.2-esm/index.mjs";import d from"https://cdn.jsdelivr.net/gh/stdlib-js/utils-define-nonenumerable-read-only-accessor@v0.2.2-esm/index.mjs";import p from"https://cdn.jsdelivr.net/gh/stdlib-js/array-buffer@v0.2.2-esm/index.mjs";import m from"https://cdn.jsdelivr.net/gh/stdlib-js/array-dataview@v0.2.2-esm/index.mjs";import w from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-getter@v0.2.2-esm/index.mjs";import g from"https://cdn.jsdelivr.net/gh/stdlib-js/array-base-accessor-getter@v0.2.2-esm/index.mjs";import v from"https://cdn.jsdelivr.net/gh/stdlib-js/error-tools-fmtprodmsg@v0.2.2-esm/index.mjs";function y(t){var e,r;for(e=[];!(r=t.next()).done;)e.push(r.value);return e}function b(t,e,r){var n,s;for(n=e.length,s=0;su.byteLength-i)throw new RangeError(v("null2G",d));u=new m(u,i,d)}}return a(this,"_buffer",u),a(this,"_length",u.byteLength/j),a(this,"_isLE",f),this}a(L,"BYTES_PER_ELEMENT",j),a(L,"name","Float64ArrayFE"),a(L,"from",(function(t,r){var i,o,l,f,a,u,d,p,m,b,x;if(!s(this))throw new TypeError(v("null01"));if(!F(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(null===(o=T(t))||!c(o))throw new TypeError(v("invalid argument. First argument must be a supported byte order. Value: `%s`.",t));if(a=_(o),(l=arguments.length)>2){if(!s(f=arguments[2]))throw new TypeError(v("null3N",f));l>3&&(i=arguments[3])}if(e(r)){if(f){for(b=r.length,m=r.get&&r.set?g("default"):w("default"),d=(u=new this(o,b))._buffer,x=0;x=this._length))return this._buffer.getFloat64(e*j,this._isLE)})),d(L.prototype,"length",(function(){return this._length})),a(L.prototype,"set",(function(r){var n,s,i,o,l,f,h,a;if(!x(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");if(i=this._buffer,arguments.length>1){if(!t(s=arguments[1]))throw new TypeError(v("null2L",s))}else s=0;if(e(r)){if(s+(f=r.length)>this._length)throw new RangeError(v("null03"));if(l=(n=r).get&&n.set?g("default"):w("default"),a=i.byteOffset+s*j,n.buffer===i.buffer&&n.byteOffseta){for(o=[],h=0;h=this._length)throw new RangeError(v("null2M",s));i.setFloat64(s*j,r,this._isLE)}})),a(L.prototype,"toString",(function(){var t,e,r;if(!x(this))throw new TypeError("invalid invocation. `this` is not a Float64ArrayFE.");for(t=[],e=this._buffer,r=0;r\n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nfunction Float64ArrayFE() {\n\tvar byteOffset;\n\tvar endianness;\n\tvar nargs;\n\tvar isLE;\n\tvar buf;\n\tvar len;\n\tvar arg;\n\tvar tmp;\n\n\tnargs = arguments.length;\n\tif ( !(this instanceof Float64ArrayFE) ) {\n\t\tif ( nargs < 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0] );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1] );\n\t\t}\n\t\tif ( nargs === 3 ) {\n\t\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2] );\n\t\t}\n\t\treturn new Float64ArrayFE( arguments[0], arguments[1], arguments[2], arguments[3] );\n\t}\n\tendianness = byteOrder( arguments[ 0 ] );\n\tif ( endianness === null || !isByteOrder( endianness ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', arguments[ 0 ] ) );\n\t}\n\tisLE = isLittleEndian( endianness );\n\n\tnargs -= 1;\n\n\t// Create the underlying data buffer...\n\tif ( nargs === 0 ) {\n\t\tbuf = new DataView( new ArrayBuffer( 0 ) ); // backward-compatibility\n\t} else if ( nargs === 1 ) {\n\t\targ = arguments[ nargs ];\n\t\tif ( isNonNegativeInteger( arg ) ) {\n\t\t\tbuf = new DataView( new ArrayBuffer( arg*BYTES_PER_ELEMENT ) );\n\t\t} else if ( isCollection( arg ) ) {\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( arg.length*BYTES_PER_ELEMENT ) ), arg, isLE );\n\t\t} else if ( isArrayBuffer( arg ) ) {\n\t\t\tbuf = new DataView( arg );\n\t\t} else if ( isObject( arg ) ) {\n\t\t\tif ( HAS_ITERATOR_SYMBOL === false ) {\n\t\t\t\tthrow new TypeError( format( 'null29', arg ) );\n\t\t\t}\n\t\t\tif ( !isFunction( arg[ ITERATOR_SYMBOL ] ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\tbuf = arg[ ITERATOR_SYMBOL ]();\n\t\t\tif ( !isFunction( buf.next ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t\t}\n\t\t\ttmp = fromIterator( buf );\n\t\t\tbuf = fromArray( new DataView( new ArrayBuffer( tmp.length*BYTES_PER_ELEMENT ) ), tmp, isLE );\n\t\t} else {\n\t\t\tthrow new TypeError( format( 'null2A', arg ) );\n\t\t}\n\t} else {\n\t\tbuf = arguments[ 1 ];\n\t\tif ( !isArrayBuffer( buf ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Must provide an ArrayBuffer. Value: `%s`.', buf ) );\n\t\t}\n\t\tbyteOffset = arguments[ 2 ];\n\t\tif ( !isNonNegativeInteger( byteOffset ) ) {\n\t\t\tthrow new TypeError( format( 'null2C', byteOffset ) );\n\t\t}\n\t\tif ( nargs === 2 ) {\n\t\t\tbuf = new DataView( buf, byteOffset );\n\t\t} else {\n\t\t\tlen = arguments[ 3 ];\n\t\t\tif ( !isNonNegativeInteger( len ) ) {\n\t\t\t\tthrow new TypeError( format( 'null2F', len ) );\n\t\t\t}\n\t\t\tlen *= BYTES_PER_ELEMENT;\n\t\t\tif ( len > (buf.byteLength-byteOffset) ) {\n\t\t\t\tthrow new RangeError( format( 'null2G', len ) );\n\t\t\t}\n\t\t\tbuf = new DataView( buf, byteOffset, len );\n\t\t}\n\t}\n\tsetReadOnly( this, '_buffer', buf );\n\tsetReadOnly( this, '_length', buf.byteLength/BYTES_PER_ELEMENT );\n\tsetReadOnly( this, '_isLE', isLE );\n\n\treturn this;\n}\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var nbytes = Float64ArrayFE.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE, 'BYTES_PER_ELEMENT', BYTES_PER_ELEMENT );\n\n/**\n* Constructor name.\n*\n* @name name\n* @memberof Float64ArrayFE\n* @readonly\n* @type {string}\n* @default 'Float64ArrayFE'\n*\n* @example\n* var str = Float64ArrayFE.name;\n* // returns 'Float64ArrayFE'\n*/\nsetReadOnly( Float64ArrayFE, 'name', 'Float64ArrayFE' );\n\n/**\n* Creates a new `Float64ArrayFE` from an array-like object or an iterable.\n*\n* @name from\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(Collection|Iterable)} src - array-like object or iterable\n* @param {Function} [clbk] - callback to invoke for each source element\n* @param {*} [thisArg] - context\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} second argument must be an array-like object or an iterable\n* @throws {TypeError} third argument must be a function\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.from( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* function clbk( v ) {\n* return v * 2.0;\n* }\n*\n* var arr = Float64ArrayFE.from( 'big-endian', [ 1.0, 2.0 ], clbk );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nsetReadOnly( Float64ArrayFE, 'from', function from( endianness, src ) {\n\tvar thisArg;\n\tvar order;\n\tvar nargs;\n\tvar clbk;\n\tvar isLE;\n\tvar out;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar len;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\tisLE = isLittleEndian( order );\n\n\tnargs = arguments.length;\n\tif ( nargs > 2 ) {\n\t\tclbk = arguments[ 2 ];\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'null3N', clbk ) );\n\t\t}\n\t\tif ( nargs > 3 ) {\n\t\t\tthisArg = arguments[ 3 ];\n\t\t}\n\t}\n\tif ( isCollection( src ) ) {\n\t\tif ( clbk ) {\n\t\t\tlen = src.length;\n\t\t\tif ( src.get && src.set ) {\n\t\t\t\tget = accessorGetter( 'default' );\n\t\t\t} else {\n\t\t\t\tget = getter( 'default' );\n\t\t\t}\n\t\t\tout = new this( order, len );\n\t\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, clbk.call( thisArg, get( src, i ), i ), isLE );\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\t\treturn new this( order, src );\n\t}\n\tif ( isObject( src ) && HAS_ITERATOR_SYMBOL && isFunction( src[ ITERATOR_SYMBOL ] ) ) {\n\t\tbuf = src[ ITERATOR_SYMBOL ]();\n\t\tif ( !isFunction( buf.next ) ) {\n\t\t\tthrow new TypeError( format( 'nullAt', src ) );\n\t\t}\n\t\tif ( clbk ) {\n\t\t\ttmp = fromIteratorMap( buf, clbk, thisArg );\n\t\t} else {\n\t\t\ttmp = fromIterator( buf );\n\t\t}\n\t\tlen = tmp.length;\n\t\tout = new this( order, len );\n\t\tbuf = out._buffer; // eslint-disable-line no-underscore-dangle\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tbuf.setFloat64( i*BYTES_PER_ELEMENT, tmp[ i ], isLE );\n\t\t}\n\t\treturn out;\n\t}\n\tthrow new TypeError( format( 'nullAt', src ) );\n});\n\n/**\n* Creates a new `Float64ArrayFE` from a variable number of arguments.\n*\n* @name of\n* @memberof Float64ArrayFE\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {...*} element - array elements\n* @throws {TypeError} `this` context must be a constructor\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} first argument must be a supported byte order\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = Float64ArrayFE.of( 'little-endian', 1.0, 1.0, 1.0, 1.0 );\n* // returns \n*\n* var len = arr.length;\n* // returns 4\n*/\nsetReadOnly( Float64ArrayFE, 'of', function of( endianness ) {\n\tvar order;\n\tvar args;\n\tvar i;\n\tif ( !isFunction( this ) ) {\n\t\tthrow new TypeError( format('null01') );\n\t}\n\tif ( !isFloat64ArrayFEConstructor( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\torder = byteOrder( endianness );\n\tif ( order === null || !isByteOrder( order ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a supported byte order. Value: `%s`.', endianness ) );\n\t}\n\targs = [];\n\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\targs.push( arguments[ i ] );\n\t}\n\treturn new this( order, args );\n});\n\n/**\n* Pointer to the underlying data buffer.\n*\n* @name buffer\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {ArrayBuffer}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var buf = arr.buffer;\n* // returns \n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'buffer', function get() {\n\treturn this._buffer.buffer;\n});\n\n/**\n* Size (in bytes) of the array.\n*\n* @name byteLength\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteLength = arr.byteLength;\n* // returns 80\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteLength', function get() {\n\treturn this._buffer.byteLength;\n});\n\n/**\n* Offset (in bytes) of the array from the start of its underlying `ArrayBuffer`.\n*\n* @name byteOffset\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var byteOffset = arr.byteOffset;\n* // returns 0\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'byteOffset', function get() {\n\treturn this._buffer.byteOffset;\n});\n\n/**\n* Size (in bytes) of each array element.\n*\n* @name BYTES_PER_ELEMENT\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {PositiveInteger}\n* @default 8\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var nbytes = arr.BYTES_PER_ELEMENT;\n* // returns 8\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'BYTES_PER_ELEMENT', Float64ArrayFE.BYTES_PER_ELEMENT );\n\n/**\n* Returns an array element.\n*\n* @name get\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {NonNegativeInteger} idx - element index\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} must provide a nonnegative integer\n* @returns {(number|void)} array element\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*\n* v = arr.get( 100 );\n* // returns undefined\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'get', function get( idx ) {\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tif ( !isNonNegativeInteger( idx ) ) {\n\t\tthrow new TypeError( format( 'null2K', idx ) );\n\t}\n\tif ( idx >= this._length ) {\n\t\treturn;\n\t}\n\treturn this._buffer.getFloat64( idx*BYTES_PER_ELEMENT, this._isLE );\n});\n\n/**\n* Number of array elements.\n*\n* @name length\n* @memberof Float64ArrayFE.prototype\n* @readonly\n* @type {NonNegativeInteger}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var len = arr.length;\n* // returns 10\n*/\nsetReadOnlyAccessor( Float64ArrayFE.prototype, 'length', function get() {\n\treturn this._length;\n});\n\n/**\n* Sets an array element.\n*\n* ## Notes\n*\n* - When provided a typed array, we must check whether the source array shares the same buffer as the target array and whether the underlying memory overlaps. In particular, we are concerned with the following scenario:\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* In the above, as we copy values from `src`, we will overwrite values in the `src` view, resulting in duplicated values copied into the end of `buf`, which is not intended. Hence, to avoid overwriting source values, we must **copy** source values to a temporary array.\n*\n* In the other overlapping scenario,\n*\n* ```text\n* buf: ---------------------\n* src: ---------------------\n* ```\n*\n* by the time we begin copying into the overlapping region, we are copying from the end of `src`, a non-overlapping region, which means we don't run the risk of copying copied values, rather than the original `src` values, as intended.\n*\n* @name set\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @param {(Collection|Float64ArrayFE|*)} value - value(s)\n* @param {NonNegativeInteger} [i=0] - element index at which to start writing values\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @throws {TypeError} index argument must be a nonnegative integer\n* @throws {RangeError} index argument is out-of-bounds\n* @throws {RangeError} target array lacks sufficient storage to accommodate source values\n* @returns {void}\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 10 );\n*\n* var v = arr.get( 0 );\n* // returns 0.0\n*\n* arr.set( [ 1.0, 2.0 ], 0 );\n*\n* v = arr.get( 0 );\n* // returns 1.0\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'set', function set( value ) {\n\tvar sbuf;\n\tvar idx;\n\tvar buf;\n\tvar tmp;\n\tvar get;\n\tvar N;\n\tvar i;\n\tvar j;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tbuf = this._buffer;\n\tif ( arguments.length > 1 ) {\n\t\tidx = arguments[ 1 ];\n\t\tif ( !isNonNegativeInteger( idx ) ) {\n\t\t\tthrow new TypeError( format( 'null2L', idx ) );\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tif ( isCollection( value ) ) {\n\t\tN = value.length;\n\t\tif ( idx+N > this._length ) {\n\t\t\tthrow new RangeError( format('null03') );\n\t\t}\n\t\tsbuf = value;\n\t\tif ( sbuf.get && sbuf.set ) {\n\t\t\tget = accessorGetter( 'default' );\n\t\t} else {\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\t// Check for overlapping memory...\n\t\tj = buf.byteOffset + (idx*BYTES_PER_ELEMENT);\n\t\tif (\n\t\t\tsbuf.buffer === buf.buffer &&\n\t\t\t(\n\t\t\t\tsbuf.byteOffset < j &&\n\t\t\t\tsbuf.byteOffset+sbuf.byteLength > j\n\t\t\t)\n\t\t) {\n\t\t\t// We need to copy source values...\n\t\t\ttmp = [];\n\t\t\tfor ( i = 0; i < value.length; i++ ) {\n\t\t\t\ttmp.push( get( value, i ) );\n\t\t\t}\n\t\t\tsbuf = tmp;\n\t\t\tget = getter( 'default' );\n\t\t}\n\t\tfor ( i = 0; i < N; idx++, i++ ) {\n\t\t\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, get( sbuf, i ), this._isLE );\n\t\t}\n\t\treturn;\n\t}\n\tif ( idx >= this._length ) {\n\t\tthrow new RangeError( format( 'null2M', idx ) );\n\t}\n\tbuf.setFloat64( idx*BYTES_PER_ELEMENT, value, this._isLE );\n});\n\n/**\n* Serializes an array as a string.\n*\n* @name toString\n* @memberof Float64ArrayFE.prototype\n* @type {Function}\n* @throws {TypeError} `this` must be a Float64ArrayFE\n* @returns {string} string representation\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 3 );\n*\n* arr.set( 1.0, 0 );\n* arr.set( 2.0, 1 );\n* arr.set( 3.0, 2 );\n*\n* var str = arr.toString();\n* // returns '1,2,3'\n*/\nsetReadOnly( Float64ArrayFE.prototype, 'toString', function toString() {\n\tvar out;\n\tvar buf;\n\tvar i;\n\tif ( !isFloat64ArrayFE( this ) ) {\n\t\tthrow new TypeError( 'invalid invocation. `this` is not a Float64ArrayFE.' );\n\t}\n\tout = [];\n\tbuf = this._buffer;\n\tfor ( i = 0; i < this._length; i++ ) {\n\t\tout.push( buf.getFloat64( i*BYTES_PER_ELEMENT, this._isLE ) );\n\t}\n\treturn out.join( ',' );\n});\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n","/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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// MAIN //\n\n/**\n* Returns an array of iterated values.\n*\n* @private\n* @param {Object} it - iterator\n* @param {Function} clbk - callback to invoke for each iterated value\n* @param {*} thisArg - invocation context\n* @returns {Array} output array\n*/\nfunction fromIteratorMap( it, clbk, thisArg ) {\n\tvar out;\n\tvar v;\n\tvar i;\n\n\tout = [];\n\ti = -1;\n\twhile ( true ) {\n\t\tv = it.next();\n\t\tif ( v.done ) {\n\t\t\tbreak;\n\t\t}\n\t\ti += 1;\n\t\tout.push( clbk.call( thisArg, v.value, i ) );\n\t}\n\treturn out;\n}\n\n\n// EXPORTS //\n\nexport default fromIteratorMap;\n"],"names":["fromIterator","it","out","v","next","done","push","value","fromArray","view","arr","isLE","len","i","length","setFloat64","BYTES_PER_ELEMENT","HAS_ITERATOR_SYMBOL","hasIteratorSymbolSupport","isByteOrder","contains","byteOrder","isString","lowercase","isLittleEndian","isFloat64ArrayFEConstructor","Float64ArrayFE","isFloat64ArrayFE","constructor","name","isPrototypeOf","prototype","byteOffset","endianness","nargs","buf","arg","tmp","arguments","this","TypeError","format","DataView","ArrayBuffer","isNonNegativeInteger","isCollection","isArrayBuffer","isObject","isFunction","ITERATOR_SYMBOL","byteLength","RangeError","setReadOnly","src","thisArg","order","clbk","get","set","accessorGetter","getter","_buffer","call","fromIteratorMap","args","setReadOnlyAccessor","buffer","idx","_length","getFloat64","_isLE","sbuf","N","j","join"],"mappings":"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"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index a0464ed..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 35b0fd83a631bad66e98718d026d5b50d17775c4 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 25 Sep 2024 06:50:32 +0000 Subject: [PATCH 13/22] 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 | 55 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 --- README.md | 51 +- SECURITY.md | 5 - benchmark/benchmark.from.js | 310 -- benchmark/benchmark.get.js | 85 - benchmark/benchmark.js | 533 --- benchmark/benchmark.of.js | 69 - benchmark/benchmark.set.js | 209 - benchmark/benchmark.set.length.js | 110 - benchmark/benchmark.to_string.js | 50 - benchmark/benchmark.to_string.length.js | 94 - branches.md | 56 - dist/index.js | 5 - dist/index.js.map | 7 - examples/index.js | 42 - index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 94 - lib/main.js | 100 - package.json | 63 +- stats.html | 4842 +++++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 35 - 45 files changed, 4871 insertions(+), 5157 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.from.js delete mode 100644 benchmark/benchmark.get.js delete mode 100644 benchmark/benchmark.js delete mode 100644 benchmark/benchmark.of.js delete mode 100644 benchmark/benchmark.set.js delete mode 100644 benchmark/benchmark.set.length.js delete mode 100644 benchmark/benchmark.to_string.js delete mode 100644 benchmark/benchmark.to_string.length.js delete mode 100644 branches.md delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 examples/index.js create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9acabc8..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/fixed-endian-float64) 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 54acaa3..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/fixed-endian-float64) 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 9b5400f..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 2 * * 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 + + ```
@@ -468,7 +459,7 @@ logEach( '%s', out ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -531,13 +522,13 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-fixed-endian-float64/main/LICENSE -[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed +[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed/tree/esm -[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer +[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer/tree/esm -[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory +[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory/tree/esm -[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64 +[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64/tree/esm
diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.from.js b/benchmark/benchmark.from.js deleted file mode 100644 index f4ff2a6..0000000 --- a/benchmark/benchmark.from.js +++ /dev/null @@ -1,310 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// MAIN // - -bench( pkg+'::typed_array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::iterable:from', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } - } -}); - -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } -}); - -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable(), clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } - - function clbk( v ) { - return v * 2.0; - } -}); diff --git a/benchmark/benchmark.get.js b/benchmark/benchmark.get.js deleted file mode 100644 index 764daf1..0000000 --- a/benchmark/benchmark.get.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js deleted file mode 100644 index d58d58a..0000000 --- a/benchmark/benchmark.js +++ /dev/null @@ -1,533 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var Float64Array = require( '@stdlib/array-float64' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// FUNCTIONS // - -/** -* Returns an "iterable" object. -* -* @private -* @returns {Object} iterable object -*/ -function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } -} - - -// MAIN // - -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:buffer', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.buffer; - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArrayBuffer( v ) ) { - b.fail( 'should return an ArrayBuffer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteLength', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteLength; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteOffset', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteOffset; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:length', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.length; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.of.js b/benchmark/benchmark.of.js deleted file mode 100644 index 84f00cd..0000000 --- a/benchmark/benchmark.of.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':of', function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 'little-endian', 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of.apply( Float64ArrayFE, buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.js b/benchmark/benchmark.set.js deleted file mode 100644 index f420d74..0000000 --- a/benchmark/benchmark.set.js +++ /dev/null @@ -1,209 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'little-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'big-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.length.js b/benchmark/benchmark.set.length.js deleted file mode 100644 index dff28fc..0000000 --- a/benchmark/benchmark.set.length.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var randu = require( '@stdlib/random-array-randu' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var values; - var arr1; - var arr2; - var arr3; - var N; - - arr1 = randu( len ); - arr2 = randu( len ); - arr3 = randu( len ); - arr1 = new Float64ArrayFE( 'little-endian', arr1 ); - - values = [ - new Float64ArrayFE( 'little-endian', arr2 ), - new Float64ArrayFE( 'big-endian', arr3 ) - ]; - N = values.length; - - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr1.set( values[ i%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); - } -} - -main(); diff --git a/benchmark/benchmark.to_string.js b/benchmark/benchmark.to_string.js deleted file mode 100644 index 42d0139..0000000 --- a/benchmark/benchmark.to_string.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':toString', function benchmark( b ) { - var out; - var arr; - var i; - - arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 2.0, 1.0 ] ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.to_string.length.js b/benchmark/benchmark.to_string.length.js deleted file mode 100644 index 72a1f2d..0000000 --- a/benchmark/benchmark.to_string.length.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var zeroTo = require( '@stdlib/array-zero-to' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) ); - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 193762e..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64" -%% click B href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/main" -%% click C href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/production" -%% click D href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm" -%% click E href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno" -%% click F href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64 -[production-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/production -[deno-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index b047003..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var a=s(function(v,t){ -var i=require('@stdlib/array-fixed-endian-factory/dist'),o=i("float64");t.exports=o -});var u=a();module.exports=u; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index d837bbd..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( '@stdlib/array-fixed-endian-factory' );\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nmodule.exports = Float64ArrayFE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-float64\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAU,QAAS,oCAAqC,EAwExDC,EAAiBD,EAAS,SAAU,EAKxCD,EAAO,QAAUE,ICXjB,IAAIC,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "factory", "Float64ArrayFE", "main"] -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index fe5213c..0000000 --- a/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Float64Array = require( '@stdlib/array-float64' ); -var logEach = require( '@stdlib/console-log-each' ); -var Float64ArrayFE = require( './../lib' ); - -// Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); -logEach( '%s', out ); - -// Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; -out = new Float64ArrayFE( 'big-endian', arr ); -logEach( '%s', out ); - -// Create a typed array from an array buffer: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'little-endian', arr.buffer ); -logEach( '%s', out ); - -// Create a typed array from an array buffer view: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'big-endian', arr.buffer, 8, 2 ); -logEach( '%s', out ); diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..7ddd52e --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import t from"https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-factory@esm/index.mjs";var a=t("float64");export{a as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..af887d1 --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport factory from '@stdlib/array-fixed-endian-factory';\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n"],"names":["Float64ArrayFE","factory"],"mappings":";;8FA8FG,IAACA,EAAiBC,EAAS"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 2be932f..0000000 --- a/lib/index.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @module @stdlib/array-fixed-endian-float64 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 2765abf..0000000 --- a/lib/main.js +++ /dev/null @@ -1,100 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var factory = require( '@stdlib/array-fixed-endian-factory' ); - - -// MAIN // - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @name Float64ArrayFE -* @constructor -* @type {Function} -* @param {string} endianness - byte order -* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable -* @param {NonNegativeInteger} [byteOffset=0] - byte offset -* @param {NonNegativeInteger} [length] - view length -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument -* @throws {TypeError} byte offset must be a nonnegative integer -* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -var Float64ArrayFE = factory( 'float64' ); - - -// EXPORTS // - -module.exports = Float64ArrayFE; diff --git a/package.json b/package.json index 78064e6..cd69010 100644 --- a/package.json +++ b/package.json @@ -3,30 +3,8 @@ "version": "0.0.0", "description": "Float64Array having a specified byte order.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -35,41 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/array-buffer": "^0.2.2", - "@stdlib/array-float64": "^0.2.2", - "@stdlib/array-zero-to": "^0.2.2", - "@stdlib/assert-is-arraybuffer": "^0.2.2", - "@stdlib/assert-is-nonnegative-integer": "^0.2.2", - "@stdlib/assert-is-number": "^0.2.2", - "@stdlib/console-log-each": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/random-array-randu": "^0.2.1", - "@stdlib/symbol-iterator": "^0.2.2", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -94,4 +37,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..129fd6c --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index fc72bbf..0000000 --- a/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF 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 ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -// TODO: add tests From c466f1c299e67a2dad271bf9a122f4304e8c24a3 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Dec 2024 22:33:09 +0000 Subject: [PATCH 14/22] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 478c95f..78064e6 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,8 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main" + "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/array-buffer": "^0.2.2", @@ -93,4 +94,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From 8f2ab00ca9c538c2bff9657c51673af1ee152c3c Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Dec 2024 22:33:31 +0000 Subject: [PATCH 15/22] Remove files --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 3 files changed, 4847 deletions(-) delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 7ddd52e..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import t from"https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-factory@esm/index.mjs";var a=t("float64");export{a as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index af887d1..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport factory from '@stdlib/array-fixed-endian-factory';\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n"],"names":["Float64ArrayFE","factory"],"mappings":";;8FA8FG,IAACA,EAAiBC,EAAS"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 129fd6c..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 21930330b3fede8ffc2df4d10616630987ce7d26 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Dec 2024 22:33:51 +0000 Subject: [PATCH 16/22] 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 - .github/workflows/test_published_package.yml | 105 - .gitignore | 190 - .npmignore | 229 - .npmrc | 31 - CHANGELOG.md | 56 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 53 +- SECURITY.md | 5 - benchmark/benchmark.from.js | 310 -- benchmark/benchmark.get.js | 85 - benchmark/benchmark.js | 533 -- benchmark/benchmark.of.js | 69 - benchmark/benchmark.set.js | 209 - benchmark/benchmark.set.length.js | 110 - benchmark/benchmark.to_string.js | 50 - benchmark/benchmark.to_string.length.js | 94 - branches.md | 56 - dist/index.js | 5 - dist/index.js.map | 7 - examples/index.js | 42 - index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 94 - lib/main.js | 100 - package.json | 63 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 35 - 46 files changed, 4872 insertions(+), 5264 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 .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.from.js delete mode 100644 benchmark/benchmark.get.js delete mode 100644 benchmark/benchmark.js delete mode 100644 benchmark/benchmark.of.js delete mode 100644 benchmark/benchmark.set.js delete mode 100644 benchmark/benchmark.set.length.js delete mode 100644 benchmark/benchmark.to_string.js delete mode 100644 benchmark/benchmark.to_string.length.js delete mode 100644 branches.md delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 examples/index.js create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 60d743f..0000000 --- a/.editorconfig +++ /dev/null @@ -1,181 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 -insert_final_newline = false - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9acabc8..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/fixed-endian-float64) 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 54acaa3..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/fixed-endian-float64) 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 9b5400f..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 2 * * 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 + + ```
@@ -475,7 +466,7 @@ logEach( '%s', out ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -538,17 +529,17 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-fixed-endian-float64/main/LICENSE -[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed +[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed/tree/esm -[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer +[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer/tree/esm -[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory +[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory/tree/esm -[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64 +[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64/tree/esm -[@stdlib/array/fixed-endian-float32]: https://github.com/stdlib-js/array-fixed-endian-float32 +[@stdlib/array/fixed-endian-float32]: https://github.com/stdlib-js/array-fixed-endian-float32/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.from.js b/benchmark/benchmark.from.js deleted file mode 100644 index f4ff2a6..0000000 --- a/benchmark/benchmark.from.js +++ /dev/null @@ -1,310 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// MAIN // - -bench( pkg+'::typed_array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::iterable:from', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } - } -}); - -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } -}); - -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable(), clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } - - function clbk( v ) { - return v * 2.0; - } -}); diff --git a/benchmark/benchmark.get.js b/benchmark/benchmark.get.js deleted file mode 100644 index 764daf1..0000000 --- a/benchmark/benchmark.get.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js deleted file mode 100644 index d58d58a..0000000 --- a/benchmark/benchmark.js +++ /dev/null @@ -1,533 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var Float64Array = require( '@stdlib/array-float64' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// FUNCTIONS // - -/** -* Returns an "iterable" object. -* -* @private -* @returns {Object} iterable object -*/ -function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } -} - - -// MAIN // - -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:buffer', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.buffer; - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArrayBuffer( v ) ) { - b.fail( 'should return an ArrayBuffer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteLength', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteLength; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteOffset', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteOffset; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:length', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.length; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.of.js b/benchmark/benchmark.of.js deleted file mode 100644 index 84f00cd..0000000 --- a/benchmark/benchmark.of.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':of', function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 'little-endian', 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of.apply( Float64ArrayFE, buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.js b/benchmark/benchmark.set.js deleted file mode 100644 index f420d74..0000000 --- a/benchmark/benchmark.set.js +++ /dev/null @@ -1,209 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'little-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'big-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.length.js b/benchmark/benchmark.set.length.js deleted file mode 100644 index dff28fc..0000000 --- a/benchmark/benchmark.set.length.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var randu = require( '@stdlib/random-array-randu' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var values; - var arr1; - var arr2; - var arr3; - var N; - - arr1 = randu( len ); - arr2 = randu( len ); - arr3 = randu( len ); - arr1 = new Float64ArrayFE( 'little-endian', arr1 ); - - values = [ - new Float64ArrayFE( 'little-endian', arr2 ), - new Float64ArrayFE( 'big-endian', arr3 ) - ]; - N = values.length; - - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr1.set( values[ i%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); - } -} - -main(); diff --git a/benchmark/benchmark.to_string.js b/benchmark/benchmark.to_string.js deleted file mode 100644 index 42d0139..0000000 --- a/benchmark/benchmark.to_string.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':toString', function benchmark( b ) { - var out; - var arr; - var i; - - arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 2.0, 1.0 ] ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.to_string.length.js b/benchmark/benchmark.to_string.length.js deleted file mode 100644 index 72a1f2d..0000000 --- a/benchmark/benchmark.to_string.length.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var zeroTo = require( '@stdlib/array-zero-to' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) ); - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 193762e..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64" -%% click B href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/main" -%% click C href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/production" -%% click D href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm" -%% click E href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno" -%% click F href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64 -[production-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/production -[deno-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index b047003..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var a=s(function(v,t){ -var i=require('@stdlib/array-fixed-endian-factory/dist'),o=i("float64");t.exports=o -});var u=a();module.exports=u; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index d837bbd..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( '@stdlib/array-fixed-endian-factory' );\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nmodule.exports = Float64ArrayFE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-float64\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAU,QAAS,oCAAqC,EAwExDC,EAAiBD,EAAS,SAAU,EAKxCD,EAAO,QAAUE,ICXjB,IAAIC,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "factory", "Float64ArrayFE", "main"] -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index fe5213c..0000000 --- a/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Float64Array = require( '@stdlib/array-float64' ); -var logEach = require( '@stdlib/console-log-each' ); -var Float64ArrayFE = require( './../lib' ); - -// Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); -logEach( '%s', out ); - -// Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; -out = new Float64ArrayFE( 'big-endian', arr ); -logEach( '%s', out ); - -// Create a typed array from an array buffer: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'little-endian', arr.buffer ); -logEach( '%s', out ); - -// Create a typed array from an array buffer view: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'big-endian', arr.buffer, 8, 2 ); -logEach( '%s', out ); diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..7ddd52e --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import t from"https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-factory@esm/index.mjs";var a=t("float64");export{a as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..af887d1 --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport factory from '@stdlib/array-fixed-endian-factory';\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n"],"names":["Float64ArrayFE","factory"],"mappings":";;8FA8FG,IAACA,EAAiBC,EAAS"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 2be932f..0000000 --- a/lib/index.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @module @stdlib/array-fixed-endian-float64 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 2765abf..0000000 --- a/lib/main.js +++ /dev/null @@ -1,100 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var factory = require( '@stdlib/array-fixed-endian-factory' ); - - -// MAIN // - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @name Float64ArrayFE -* @constructor -* @type {Function} -* @param {string} endianness - byte order -* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable -* @param {NonNegativeInteger} [byteOffset=0] - byte offset -* @param {NonNegativeInteger} [length] - view length -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument -* @throws {TypeError} byte offset must be a nonnegative integer -* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -var Float64ArrayFE = factory( 'float64' ); - - -// EXPORTS // - -module.exports = Float64ArrayFE; diff --git a/package.json b/package.json index 78064e6..cd69010 100644 --- a/package.json +++ b/package.json @@ -3,30 +3,8 @@ "version": "0.0.0", "description": "Float64Array having a specified byte order.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -35,41 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/array-buffer": "^0.2.2", - "@stdlib/array-float64": "^0.2.2", - "@stdlib/array-zero-to": "^0.2.2", - "@stdlib/assert-is-arraybuffer": "^0.2.2", - "@stdlib/assert-is-nonnegative-integer": "^0.2.2", - "@stdlib/assert-is-number": "^0.2.2", - "@stdlib/console-log-each": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/random-array-randu": "^0.2.1", - "@stdlib/symbol-iterator": "^0.2.2", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -94,4 +37,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..129fd6c --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index fc72bbf..0000000 --- a/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF 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 ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -// TODO: add tests From 487416e70ee306219c77351ec6e6ee9fbcaec5cd Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 20 Jan 2025 01:59:03 +0000 Subject: [PATCH 17/22] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 478c95f..78064e6 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,8 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main" + "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/array-buffer": "^0.2.2", @@ -93,4 +94,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From fa9e8bbc7e9ee23f4d8e094cac953dc688fa80dc Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 20 Jan 2025 02:14:57 +0000 Subject: [PATCH 18/22] Remove files --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 3 files changed, 4847 deletions(-) delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 7ddd52e..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import t from"https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-factory@esm/index.mjs";var a=t("float64");export{a as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index af887d1..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport factory from '@stdlib/array-fixed-endian-factory';\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n"],"names":["Float64ArrayFE","factory"],"mappings":";;8FA8FG,IAACA,EAAiBC,EAAS"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 129fd6c..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 717754101d5242c3385de346bf0b2d80545c12a1 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 20 Jan 2025 02:15:18 +0000 Subject: [PATCH 19/22] 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 | 56 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 53 +- SECURITY.md | 5 - benchmark/benchmark.from.js | 310 -- benchmark/benchmark.get.js | 85 - benchmark/benchmark.js | 533 -- benchmark/benchmark.of.js | 69 - benchmark/benchmark.set.js | 209 - benchmark/benchmark.set.length.js | 110 - benchmark/benchmark.to_string.js | 50 - benchmark/benchmark.to_string.length.js | 94 - branches.md | 56 - dist/index.js | 5 - dist/index.js.map | 7 - examples/index.js | 42 - index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 94 - lib/main.js | 100 - package.json | 63 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 35 - 47 files changed, 4872 insertions(+), 5264 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.from.js delete mode 100644 benchmark/benchmark.get.js delete mode 100644 benchmark/benchmark.js delete mode 100644 benchmark/benchmark.of.js delete mode 100644 benchmark/benchmark.set.js delete mode 100644 benchmark/benchmark.set.length.js delete mode 100644 benchmark/benchmark.to_string.js delete mode 100644 benchmark/benchmark.to_string.length.js delete mode 100644 branches.md delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 examples/index.js create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index dab5d2a..0000000 --- a/.editorconfig +++ /dev/null @@ -1,180 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 88823ad..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2025-01-20T01:51:36.268Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 9acabc8..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/fixed-endian-float64) 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 54acaa3..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/fixed-endian-float64) 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 9b5400f..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 2 * * 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 + + ```
@@ -475,7 +466,7 @@ logEach( '%s', out ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -538,17 +529,17 @@ Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors]. [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-fixed-endian-float64/main/LICENSE -[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed +[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed/tree/esm -[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer +[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer/tree/esm -[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory +[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory/tree/esm -[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64 +[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64/tree/esm -[@stdlib/array/fixed-endian-float32]: https://github.com/stdlib-js/array-fixed-endian-float32 +[@stdlib/array/fixed-endian-float32]: https://github.com/stdlib-js/array-fixed-endian-float32/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.from.js b/benchmark/benchmark.from.js deleted file mode 100644 index f4ff2a6..0000000 --- a/benchmark/benchmark.from.js +++ /dev/null @@ -1,310 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// MAIN // - -bench( pkg+'::typed_array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::iterable:from', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } - } -}); - -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } -}); - -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable(), clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } - - function clbk( v ) { - return v * 2.0; - } -}); diff --git a/benchmark/benchmark.get.js b/benchmark/benchmark.get.js deleted file mode 100644 index 764daf1..0000000 --- a/benchmark/benchmark.get.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js deleted file mode 100644 index d58d58a..0000000 --- a/benchmark/benchmark.js +++ /dev/null @@ -1,533 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var Float64Array = require( '@stdlib/array-float64' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// FUNCTIONS // - -/** -* Returns an "iterable" object. -* -* @private -* @returns {Object} iterable object -*/ -function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } -} - - -// MAIN // - -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:buffer', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.buffer; - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArrayBuffer( v ) ) { - b.fail( 'should return an ArrayBuffer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteLength', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteLength; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteOffset', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteOffset; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:length', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.length; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.of.js b/benchmark/benchmark.of.js deleted file mode 100644 index 84f00cd..0000000 --- a/benchmark/benchmark.of.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':of', function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 'little-endian', 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of.apply( Float64ArrayFE, buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.js b/benchmark/benchmark.set.js deleted file mode 100644 index f420d74..0000000 --- a/benchmark/benchmark.set.js +++ /dev/null @@ -1,209 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'little-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'big-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.length.js b/benchmark/benchmark.set.length.js deleted file mode 100644 index dff28fc..0000000 --- a/benchmark/benchmark.set.length.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var randu = require( '@stdlib/random-array-randu' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var values; - var arr1; - var arr2; - var arr3; - var N; - - arr1 = randu( len ); - arr2 = randu( len ); - arr3 = randu( len ); - arr1 = new Float64ArrayFE( 'little-endian', arr1 ); - - values = [ - new Float64ArrayFE( 'little-endian', arr2 ), - new Float64ArrayFE( 'big-endian', arr3 ) - ]; - N = values.length; - - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr1.set( values[ i%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); - } -} - -main(); diff --git a/benchmark/benchmark.to_string.js b/benchmark/benchmark.to_string.js deleted file mode 100644 index 42d0139..0000000 --- a/benchmark/benchmark.to_string.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':toString', function benchmark( b ) { - var out; - var arr; - var i; - - arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 2.0, 1.0 ] ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.to_string.length.js b/benchmark/benchmark.to_string.length.js deleted file mode 100644 index 72a1f2d..0000000 --- a/benchmark/benchmark.to_string.length.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var zeroTo = require( '@stdlib/array-zero-to' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) ); - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 193762e..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64" -%% click B href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/main" -%% click C href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/production" -%% click D href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm" -%% click E href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno" -%% click F href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64 -[production-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/production -[deno-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index b047003..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var a=s(function(v,t){ -var i=require('@stdlib/array-fixed-endian-factory/dist'),o=i("float64");t.exports=o -});var u=a();module.exports=u; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index d837bbd..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( '@stdlib/array-fixed-endian-factory' );\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nmodule.exports = Float64ArrayFE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-float64\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAU,QAAS,oCAAqC,EAwExDC,EAAiBD,EAAS,SAAU,EAKxCD,EAAO,QAAUE,ICXjB,IAAIC,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "factory", "Float64ArrayFE", "main"] -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index fe5213c..0000000 --- a/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Float64Array = require( '@stdlib/array-float64' ); -var logEach = require( '@stdlib/console-log-each' ); -var Float64ArrayFE = require( './../lib' ); - -// Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); -logEach( '%s', out ); - -// Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; -out = new Float64ArrayFE( 'big-endian', arr ); -logEach( '%s', out ); - -// Create a typed array from an array buffer: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'little-endian', arr.buffer ); -logEach( '%s', out ); - -// Create a typed array from an array buffer view: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'big-endian', arr.buffer, 8, 2 ); -logEach( '%s', out ); diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..e72b28f --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import t from"https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-factory@esm/index.mjs";var a=t("float64");export{a as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..af887d1 --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport factory from '@stdlib/array-fixed-endian-factory';\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n"],"names":["Float64ArrayFE","factory"],"mappings":";;8FA8FG,IAACA,EAAiBC,EAAS"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 2be932f..0000000 --- a/lib/index.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @module @stdlib/array-fixed-endian-float64 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 2765abf..0000000 --- a/lib/main.js +++ /dev/null @@ -1,100 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var factory = require( '@stdlib/array-fixed-endian-factory' ); - - -// MAIN // - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @name Float64ArrayFE -* @constructor -* @type {Function} -* @param {string} endianness - byte order -* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable -* @param {NonNegativeInteger} [byteOffset=0] - byte offset -* @param {NonNegativeInteger} [length] - view length -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument -* @throws {TypeError} byte offset must be a nonnegative integer -* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -var Float64ArrayFE = factory( 'float64' ); - - -// EXPORTS // - -module.exports = Float64ArrayFE; diff --git a/package.json b/package.json index 78064e6..cd69010 100644 --- a/package.json +++ b/package.json @@ -3,30 +3,8 @@ "version": "0.0.0", "description": "Float64Array having a specified byte order.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -35,41 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/array-buffer": "^0.2.2", - "@stdlib/array-float64": "^0.2.2", - "@stdlib/array-zero-to": "^0.2.2", - "@stdlib/assert-is-arraybuffer": "^0.2.2", - "@stdlib/assert-is-nonnegative-integer": "^0.2.2", - "@stdlib/assert-is-number": "^0.2.2", - "@stdlib/console-log-each": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/random-array-randu": "^0.2.1", - "@stdlib/symbol-iterator": "^0.2.2", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -94,4 +37,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..129fd6c --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index fc72bbf..0000000 --- a/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF 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 ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -// TODO: add tests From 285dc272f395890c58cc59df5fa63fa59aefe22f Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Jun 2025 00:38:00 +0000 Subject: [PATCH 20/22] Transform error messages --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 478c95f..78064e6 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,8 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main" + "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2" }, "devDependencies": { "@stdlib/array-buffer": "^0.2.2", @@ -93,4 +94,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} +} \ No newline at end of file From be0263474421726198e9d0e54745cb384060aef2 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Jun 2025 00:42:17 +0000 Subject: [PATCH 21/22] Remove files --- index.mjs | 4 - index.mjs.map | 1 - stats.html | 4842 ------------------------------------------------- 3 files changed, 4847 deletions(-) delete mode 100644 index.mjs delete mode 100644 index.mjs.map delete mode 100644 stats.html diff --git a/index.mjs b/index.mjs deleted file mode 100644 index e72b28f..0000000 --- a/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 -/// -import t from"https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-factory@esm/index.mjs";var a=t("float64");export{a as default}; -//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map deleted file mode 100644 index af887d1..0000000 --- a/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport factory from '@stdlib/array-fixed-endian-factory';\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n"],"names":["Float64ArrayFE","factory"],"mappings":";;8FA8FG,IAACA,EAAiBC,EAAS"} \ No newline at end of file diff --git a/stats.html b/stats.html deleted file mode 100644 index 129fd6c..0000000 --- a/stats.html +++ /dev/null @@ -1,4842 +0,0 @@ - - - - - - - - Rollup Visualizer - - - -
- - - - - From 1eb6d6410d7d10ec1ed3a1867da9cec835405968 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 9 Jun 2025 00:42:52 +0000 Subject: [PATCH 22/22] 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 | 56 - CITATION.cff | 30 - CODE_OF_CONDUCT.md | 3 - CONTRIBUTING.md | 3 - Makefile | 534 -- README.md | 53 +- SECURITY.md | 5 - benchmark/benchmark.from.js | 310 -- benchmark/benchmark.get.js | 85 - benchmark/benchmark.js | 533 -- benchmark/benchmark.of.js | 69 - benchmark/benchmark.set.js | 209 - benchmark/benchmark.set.length.js | 110 - benchmark/benchmark.to_string.js | 50 - benchmark/benchmark.to_string.length.js | 94 - branches.md | 56 - dist/index.js | 5 - dist/index.js.map | 7 - examples/index.js | 42 - index.mjs | 4 + index.mjs.map | 1 + lib/index.js | 94 - lib/main.js | 100 - package.json | 63 +- stats.html | 4842 ++++++++++++++++++ test/dist/test.js | 33 - test/test.js | 35 - 47 files changed, 4872 insertions(+), 5268 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.from.js delete mode 100644 benchmark/benchmark.get.js delete mode 100644 benchmark/benchmark.js delete mode 100644 benchmark/benchmark.of.js delete mode 100644 benchmark/benchmark.set.js delete mode 100644 benchmark/benchmark.set.length.js delete mode 100644 benchmark/benchmark.to_string.js delete mode 100644 benchmark/benchmark.to_string.length.js delete mode 100644 branches.md delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 examples/index.js create mode 100644 index.mjs create mode 100644 index.mjs.map delete mode 100644 lib/index.js delete mode 100644 lib/main.js create mode 100644 stats.html delete mode 100644 test/dist/test.js delete mode 100644 test/test.js diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index dab5d2a..0000000 --- a/.editorconfig +++ /dev/null @@ -1,180 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# EditorConfig configuration file (see ). - -# Indicate that this file is a root-level configuration file: -root = true - -# Set properties for all files: -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -# Set properties for JavaScript files: -[*.{js,js.txt}] -indent_style = tab - -# Set properties for JavaScript ES module files: -[*.{mjs,mjs.txt}] -indent_style = tab - -# Set properties for JavaScript CommonJS files: -[*.{cjs,cjs.txt}] -indent_style = tab - -# Set properties for JSON files: -[*.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `cli_opts.json` files: -[cli_opts.json] -indent_style = tab - -# Set properties for TypeScript files: -[*.ts] -indent_style = tab - -# Set properties for Python files: -[*.{py,py.txt}] -indent_style = space -indent_size = 4 - -# Set properties for Julia files: -[*.{jl,jl.txt}] -indent_style = tab - -# Set properties for R files: -[*.{R,R.txt}] -indent_style = tab - -# Set properties for C files: -[*.{c,c.txt}] -indent_style = tab - -# Set properties for C header files: -[*.{h,h.txt}] -indent_style = tab - -# Set properties for C++ files: -[*.{cpp,cpp.txt}] -indent_style = tab - -# Set properties for C++ header files: -[*.{hpp,hpp.txt}] -indent_style = tab - -# Set properties for Fortran files: -[*.{f,f.txt}] -indent_style = space -indent_size = 2 - -# Set properties for shell files: -[*.{sh,sh.txt}] -indent_style = tab - -# Set properties for AWK files: -[*.{awk,awk.txt}] -indent_style = tab - -# Set properties for HTML files: -[*.{html,html.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for XML files: -[*.{xml,xml.txt}] -indent_style = tab -tab_width = 2 - -# Set properties for CSS files: -[*.{css,css.txt}] -indent_style = tab - -# Set properties for Makefiles: -[Makefile] -indent_style = tab - -[*.{mk,mk.txt}] -indent_style = tab - -# Set properties for Markdown files: -[*.{md,md.txt}] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = true # Note: this disables using two spaces to force a hard line break, which is permitted in Markdown. As we don't typically follow that practice (TMK), we should be safe to automatically trim. - -# Set properties for `usage.txt` files: -[usage.txt] -indent_style = space -indent_size = 2 - -# Set properties for `repl.txt` files: -[repl.txt] -indent_style = space -indent_size = 4 - -# Set properties for `package.json` files: -[package.{json,json.txt}] -indent_style = space -indent_size = 2 - -# Set properties for `datapackage.json` files: -[datapackage.json] -indent_style = space -indent_size = 2 - -# Set properties for `manifest.json` files: -[manifest.json] -indent_style = space -indent_size = 2 - -# Set properties for `tsconfig.json` files: -[tsconfig.json] -indent_style = space -indent_size = 2 - -# Set properties for LaTeX files: -[*.{tex,tex.txt}] -indent_style = tab - -# Set properties for LaTeX Bibliography files: -[*.{bib,bib.txt}] -indent_style = tab - -# Set properties for YAML files: -[*.{yml,yml.txt}] -indent_style = space -indent_size = 2 - -# Set properties for GYP files: -[binding.gyp] -indent_style = space -indent_size = 2 - -[*.gypi] -indent_style = space -indent_size = 2 - -# Set properties for citation files: -[*.{cff,cff.txt}] -indent_style = space -indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 5f30286..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -/* For the `eslint` rules of this project, consult the main repository at https://github.com/stdlib-js/stdlib */ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 1c88e69..0000000 --- a/.gitattributes +++ /dev/null @@ -1,66 +0,0 @@ -#/ -# @license Apache-2.0 -# -# Copyright (c) 2017 The Stdlib Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#/ - -# Configuration file which assigns attributes to pathnames. -# -# [1]: https://git-scm.com/docs/gitattributes - -# Automatically normalize the line endings of any committed text files: -* text=auto - -# Override line endings for certain files on checkout: -*.crlf.csv text eol=crlf - -# Denote that certain files are binary and should not be modified: -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.ico binary -*.gz binary -*.zip binary -*.7z binary -*.mp3 binary -*.mp4 binary -*.mov binary - -# Override what is considered "vendored" by GitHub's linguist: -/lib/node_modules/** -linguist-vendored -linguist-generated - -# Configure directories which should *not* be included in GitHub language statistics: -/deps/** linguist-vendored -/dist/** linguist-generated -/workshops/** linguist-vendored - -benchmark/** linguist-vendored -docs/* linguist-documentation -etc/** linguist-vendored -examples/** linguist-documentation -scripts/** linguist-vendored -test/** linguist-vendored -tools/** linguist-vendored - -# Configure files which should *not* be included in GitHub language statistics: -Makefile linguist-vendored -*.mk linguist-vendored -*.jl linguist-vendored -*.py linguist-vendored -*.R linguist-vendored - -# Configure files which should be included in GitHub language statistics: -docs/types/*.d.ts -linguist-documentation diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 640cdf9..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2025-06-09T00:35:39.583Z diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index dee1a01..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/fixed-endian-float64) 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 54acaa3..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/fixed-endian-float64) 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 9b5400f..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 2 * * 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 + + ```
@@ -475,7 +466,7 @@ logEach( '%s', out ); ## Notice -This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. +This package is part of [stdlib][stdlib], a standard library with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. @@ -538,17 +529,17 @@ Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors]. [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/array-fixed-endian-float64/main/LICENSE -[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed +[@stdlib/array/typed]: https://github.com/stdlib-js/array-typed/tree/esm -[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer +[@stdlib/array/buffer]: https://github.com/stdlib-js/array-buffer/tree/esm -[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory +[@stdlib/wasm/memory]: https://github.com/stdlib-js/wasm-memory/tree/esm -[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64 +[@stdlib/array/float64]: https://github.com/stdlib-js/array-float64/tree/esm -[@stdlib/array/fixed-endian-float32]: https://github.com/stdlib-js/array-fixed-endian-float32 +[@stdlib/array/fixed-endian-float32]: https://github.com/stdlib-js/array-fixed-endian-float32/tree/esm diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9702d4c..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security - -> Policy for reporting security vulnerabilities. - -See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security). diff --git a/benchmark/benchmark.from.js b/benchmark/benchmark.from.js deleted file mode 100644 index f4ff2a6..0000000 --- a/benchmark/benchmark.from.js +++ /dev/null @@ -1,310 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// MAIN // - -bench( pkg+'::typed_array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 5 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::array:from', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array,clbk:from:len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', buf, clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function clbk( v ) { - return v * 2.0; - } -}); - -bench( pkg+'::iterable:from', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } - } -}); - -bench( pkg+'::iterable:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable() ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } -}); - -bench( pkg+'::iterable,clbk:from:len=5', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.from( 'little-endian', createIterable(), clbk ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); - - function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - var it = { - 'next': next, - 'i': 0, - 'N': 5 - }; - return it; - - function next() { - it.i += 1; - if ( it.i <= it.N ) { - return { - 'value': 1.0 - }; - } - return { - 'done': true - }; - } - } - } - - function clbk( v ) { - return v * 2.0; - } -}); diff --git a/benchmark/benchmark.get.js b/benchmark/benchmark.get.js deleted file mode 100644 index 764daf1..0000000 --- a/benchmark/benchmark.get.js +++ /dev/null @@ -1,85 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var isNumber = require( '@stdlib/assert-is-number' ).isPrimitive; -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':get:endianness=little-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':get:endianness=big-endian', function benchmark( b ) { - var arr; - var N; - var v; - var i; - - arr = []; - for ( i = 0; i < 10; i++ ) { - arr.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', arr ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.get( i%N ); - if ( typeof v !== 'number' ) { - b.fail( 'should return a number' ); - } - } - b.toc(); - if ( !isNumber( v ) ) { - b.fail( 'should return a number' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.js b/benchmark/benchmark.js deleted file mode 100644 index d58d58a..0000000 --- a/benchmark/benchmark.js +++ /dev/null @@ -1,533 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var ArrayBuffer = require( '@stdlib/array-buffer' ); -var Float64Array = require( '@stdlib/array-float64' ); -var isArrayBuffer = require( '@stdlib/assert-is-arraybuffer' ); -var isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive; -var ITERATOR_SYMBOL = require( '@stdlib/symbol-iterator' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// VARIABLES // - -var opts = { - 'skip': ( ITERATOR_SYMBOL === null ) -}; - - -// FUNCTIONS // - -/** -* Returns an "iterable" object. -* -* @private -* @returns {Object} iterable object -*/ -function createIterable() { - var out = {}; - out[ ITERATOR_SYMBOL ] = iterator; - return out; - - function iterator() { - return { - 'next': next - }; - } - - function next() { - return { - 'done': true - }; - } -} - - -// MAIN // - -bench( pkg+'::instantiation,new:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,new:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=little-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,no_new:endianness=big-endian', function benchmark( b ) { - var ctor; - var arr; - var i; - - ctor = Float64ArrayFE; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = ctor( 'big-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=little-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,length:endianness=big-endian', function benchmark( b ) { - var arr; - var i; - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,typed_array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new Float64Array( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,array:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = []; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=little-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,iterable:endianness=big-endian', opts, function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', createIterable() ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 0 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=little-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'little-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::instantiation,arraybuffer,byte_offset,length:endianness=big-endian', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = new ArrayBuffer( 8 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = new Float64ArrayFE( 'big-endian', buf, 8, 0 ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:buffer', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.buffer; - if ( typeof v !== 'object' ) { - b.fail( 'should return an object' ); - } - } - b.toc(); - if ( !isArrayBuffer( v ) ) { - b.fail( 'should return an ArrayBuffer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteLength', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteLength; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:byteOffset', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.byteOffset; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::get:length', function benchmark( b ) { - var arr; - var v; - var i; - - arr = new Float64ArrayFE( 'little-endian' ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - // Note: the following may be optimized away due to loop invariant code motion and/or other compiler optimizations, rendering this benchmark meaningless... - v = arr.length; - if ( v !== v ) { - b.fail( 'should not return NaN' ); - } - } - b.toc(); - if ( !isNonNegativeInteger( v ) ) { - b.fail( 'should return a nonnegative integer' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.of.js b/benchmark/benchmark.of.js deleted file mode 100644 index 84f00cd..0000000 --- a/benchmark/benchmark.of.js +++ /dev/null @@ -1,69 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':of', function benchmark( b ) { - var arr; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of( 'little-endian' ); - if ( arr.length !== 0 ) { - b.fail( 'should have length 0' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+':len=5', function benchmark( b ) { - var buf; - var arr; - var i; - - buf = [ 'little-endian', 1.0, 1.0, 1.0, 1.0, 1.0 ]; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - arr = Float64ArrayFE.of.apply( Float64ArrayFE, buf ); - if ( arr.length !== 5 ) { - b.fail( 'should have length 5' ); - } - } - b.toc(); - if ( !(arr instanceof Float64ArrayFE) ) { - b.fail( 'should return an instance' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.js b/benchmark/benchmark.set.js deleted file mode 100644 index f420d74..0000000 --- a/benchmark/benchmark.set.js +++ /dev/null @@ -1,209 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var Float64Array = require( '@stdlib/array-float64' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+'::number:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::number:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( values[ (i+1)%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'little-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var N; - var v; - var i; - - values = []; - for ( i = 0; i < 10; i++ ) { - values.push( i ); - } - arr = new Float64ArrayFE( 'big-endian', values ); - N = arr.length; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr.set( [ values[ (i+1)%N ] ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=little-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'little-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); - -bench( pkg+'::typed_array:set:endianness=big-endian', function benchmark( b ) { - var values; - var arr; - var buf; - var N; - var v; - var i; - - values = new Float64Array( 20 ); - N = values.length; - for ( i = 0; i < N; i++ ) { - values[ i ] = i; - } - arr = new Float64ArrayFE( 'big-endian', values ); - buf = new Float64Array( 1 ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - buf[ 0 ] = values[ i%N ]; - v = arr.set( buf ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.set.length.js b/benchmark/benchmark.set.length.js deleted file mode 100644 index dff28fc..0000000 --- a/benchmark/benchmark.set.length.js +++ /dev/null @@ -1,110 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var randu = require( '@stdlib/random-array-randu' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var values; - var arr1; - var arr2; - var arr3; - var N; - - arr1 = randu( len ); - arr2 = randu( len ); - arr3 = randu( len ); - arr1 = new Float64ArrayFE( 'little-endian', arr1 ); - - values = [ - new Float64ArrayFE( 'little-endian', arr2 ), - new Float64ArrayFE( 'big-endian', arr3 ) - ]; - N = values.length; - - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var v; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - v = arr1.set( values[ i%N ] ); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - } - b.toc(); - if ( typeof v !== 'undefined' ) { - b.fail( 'should return undefined' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':set:len='+len, f ); - } -} - -main(); diff --git a/benchmark/benchmark.to_string.js b/benchmark/benchmark.to_string.js deleted file mode 100644 index 42d0139..0000000 --- a/benchmark/benchmark.to_string.js +++ /dev/null @@ -1,50 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// MAIN // - -bench( pkg+':toString', function benchmark( b ) { - var out; - var arr; - var i; - - arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 2.0, 1.0 ] ); - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); -}); diff --git a/benchmark/benchmark.to_string.length.js b/benchmark/benchmark.to_string.length.js deleted file mode 100644 index 72a1f2d..0000000 --- a/benchmark/benchmark.to_string.length.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var bench = require( '@stdlib/bench-harness' ); -var pow = require( '@stdlib/math-base-special-pow' ); -var zeroTo = require( '@stdlib/array-zero-to' ); -var pkg = require( './../package.json' ).name; -var Float64ArrayFE = require( './../lib' ); - - -// FUNCTIONS // - -/** -* Creates a benchmark function. -* -* @private -* @param {PositiveInteger} len - array length -* @returns {Function} benchmark function -*/ -function createBenchmark( len ) { - var arr = new Float64ArrayFE( 'little-endian', zeroTo( len ) ); - return benchmark; - - /** - * Benchmark function. - * - * @private - * @param {Benchmark} b - benchmark instance - */ - function benchmark( b ) { - var out; - var i; - - b.tic(); - for ( i = 0; i < b.iterations; i++ ) { - out = arr.toString(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - } - b.toc(); - if ( typeof out !== 'string' ) { - b.fail( 'should return a string' ); - } - b.pass( 'benchmark finished' ); - b.end(); - } -} - - -// MAIN // - -/** -* Main execution sequence. -* -* @private -*/ -function main() { - var len; - var min; - var max; - var f; - var i; - - min = 1; // 10^min - max = 6; // 10^max - - for ( i = min; i <= max; i++ ) { - len = pow( 10, i ); - f = createBenchmark( len ); - bench( pkg+':toString:len='+len, f ); - } -} - -main(); diff --git a/branches.md b/branches.md deleted file mode 100644 index 193762e..0000000 --- a/branches.md +++ /dev/null @@ -1,56 +0,0 @@ - - -# Branches - -This repository has the following branches: - -- **main**: default branch generated from the [stdlib project][stdlib-url], where all development takes place. -- **production**: [production build][production-url] of the package (e.g., reformatted error messages to reduce bundle sizes and thus the number of bytes transmitted over a network). -- **esm**: [ES Module][esm-url] branch for use via a `script` tag without the need for installation and bundlers (see [README][esm-readme]). -- **deno**: [Deno][deno-url] branch for use in Deno (see [README][deno-readme]). -- **umd**: [UMD][umd-url] branch for use in Observable, or in dual browser/Node.js environments (see [README][umd-readme]). - -The following diagram illustrates the relationships among the above branches: - -```mermaid -graph TD; -A[stdlib]-->|generate standalone package|B; -B[main] -->|productionize| C[production]; -C -->|bundle| D[esm]; -C -->|bundle| E[deno]; -C -->|bundle| F[umd]; - -%% click A href "https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64" -%% click B href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/main" -%% click C href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/production" -%% click D href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm" -%% click E href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno" -%% click F href "https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd" -``` - -[stdlib-url]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/fixed-endian-float64 -[production-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/production -[deno-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/deno -[deno-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/deno/README.md -[umd-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/umd -[umd-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/umd/README.md -[esm-url]: https://github.com/stdlib-js/array-fixed-endian-float64/tree/esm -[esm-readme]: https://github.com/stdlib-js/array-fixed-endian-float64/blob/esm/README.md \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index b047003..0000000 --- a/dist/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";var s=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var a=s(function(v,t){ -var i=require('@stdlib/array-fixed-endian-factory/dist'),o=i("float64");t.exports=o -});var u=a();module.exports=u; -/** @license Apache-2.0 */ -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index d837bbd..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../lib/main.js", "../lib/index.js"], - "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar factory = require( '@stdlib/array-fixed-endian-factory' );\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nmodule.exports = Float64ArrayFE;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 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* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @module @stdlib/array-fixed-endian-float64\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* var ArrayBuffer = require( '@stdlib/array-buffer' );\n* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' );\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], - "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAU,QAAS,oCAAqC,EAwExDC,EAAiBD,EAAS,SAAU,EAKxCD,EAAO,QAAUE,ICXjB,IAAIC,EAAO,IAKX,OAAO,QAAUA", - "names": ["require_main", "__commonJSMin", "exports", "module", "factory", "Float64ArrayFE", "main"] -} diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index fe5213c..0000000 --- a/examples/index.js +++ /dev/null @@ -1,42 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -var Float64Array = require( '@stdlib/array-float64' ); -var logEach = require( '@stdlib/console-log-each' ); -var Float64ArrayFE = require( './../lib' ); - -// Create a typed array by specifying a length: -var out = new Float64ArrayFE( 'little-endian', 3 ); -logEach( '%s', out ); - -// Create a typed array from an array: -var arr = [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ]; -out = new Float64ArrayFE( 'big-endian', arr ); -logEach( '%s', out ); - -// Create a typed array from an array buffer: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'little-endian', arr.buffer ); -logEach( '%s', out ); - -// Create a typed array from an array buffer view: -arr = new Float64Array( [ 1.0, -1.0, -3.14, 3.14, 0.5, 0.5 ] ); // host byte order -out = new Float64ArrayFE( 'big-endian', arr.buffer, 8, 2 ); -logEach( '%s', out ); diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..e72b28f --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0 +/// +import t from"https://cdn.jsdelivr.net/gh/stdlib-js/array-fixed-endian-factory@esm/index.mjs";var a=t("float64");export{a as default}; +//# sourceMappingURL=index.mjs.map diff --git a/index.mjs.map b/index.mjs.map new file mode 100644 index 0000000..af887d1 --- /dev/null +++ b/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../lib/main.js"],"sourcesContent":["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2024 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nimport factory from '@stdlib/array-fixed-endian-factory';\n\n\n// MAIN //\n\n/**\n* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order.\n*\n* @name Float64ArrayFE\n* @constructor\n* @type {Function}\n* @param {string} endianness - byte order\n* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable\n* @param {NonNegativeInteger} [byteOffset=0] - byte offset\n* @param {NonNegativeInteger} [length] - view length\n* @throws {TypeError} first argument must be a supported byte order\n* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument\n* @throws {TypeError} byte offset must be a nonnegative integer\n* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements\n* @returns {Float64ArrayFE} typed array instance\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian' );\n* // returns \n*\n* var len = arr.length;\n* // returns 0\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 16 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8 );\n* // returns \n*\n* var len = arr.length;\n* // returns 1\n*\n* @example\n* import ArrayBuffer from '@stdlib/array-buffer';\n*\n* var buf = new ArrayBuffer( 32 );\n* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 );\n* // returns \n*\n* var len = arr.length;\n* // returns 2\n*/\nvar Float64ArrayFE = factory( 'float64' );\n\n\n// EXPORTS //\n\nexport default Float64ArrayFE;\n"],"names":["Float64ArrayFE","factory"],"mappings":";;8FA8FG,IAACA,EAAiBC,EAAS"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 2be932f..0000000 --- a/lib/index.js +++ /dev/null @@ -1,94 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @module @stdlib/array-fixed-endian-float64 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* var Float64ArrayFE = require( '@stdlib/array-fixed-endian-float64' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ - -// MODULES // - -var main = require( './main.js' ); - - -// EXPORTS // - -module.exports = main; diff --git a/lib/main.js b/lib/main.js deleted file mode 100644 index 2765abf..0000000 --- a/lib/main.js +++ /dev/null @@ -1,100 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var factory = require( '@stdlib/array-fixed-endian-factory' ); - - -// MAIN // - -/** -* Typed array constructor which returns a typed array representing an array of double-precision floating-point numbers in a specified byte order. -* -* @name Float64ArrayFE -* @constructor -* @type {Function} -* @param {string} endianness - byte order -* @param {(NonNegativeInteger|Collection|ArrayBuffer|Iterable)} [arg] - length, typed array, array-like object, buffer, or an iterable -* @param {NonNegativeInteger} [byteOffset=0] - byte offset -* @param {NonNegativeInteger} [length] - view length -* @throws {TypeError} first argument must be a supported byte order -* @throws {TypeError} if provided only two arguments, the second argument must be a valid argument -* @throws {TypeError} byte offset must be a nonnegative integer -* @throws {RangeError} must provide sufficient memory to accommodate byte offset and view length requirements -* @returns {Float64ArrayFE} typed array instance -* -* @example -* var arr = new Float64ArrayFE( 'little-endian' ); -* // returns -* -* var len = arr.length; -* // returns 0 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0 ] ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf ); -* // returns -* -* var len = arr.length; -* // returns 2 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 16 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8 ); -* // returns -* -* var len = arr.length; -* // returns 1 -* -* @example -* var ArrayBuffer = require( '@stdlib/array-buffer' ); -* -* var buf = new ArrayBuffer( 32 ); -* var arr = new Float64ArrayFE( 'little-endian', buf, 8, 2 ); -* // returns -* -* var len = arr.length; -* // returns 2 -*/ -var Float64ArrayFE = factory( 'float64' ); - - -// EXPORTS // - -module.exports = Float64ArrayFE; diff --git a/package.json b/package.json index 78064e6..cd69010 100644 --- a/package.json +++ b/package.json @@ -3,30 +3,8 @@ "version": "0.0.0", "description": "Float64Array having a specified byte order.", "license": "Apache-2.0", - "author": { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - }, - "contributors": [ - { - "name": "The Stdlib Authors", - "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" - } - ], - "main": "./lib", - "directories": { - "benchmark": "./benchmark", - "example": "./examples", - "lib": "./lib", - "test": "./test" - }, - "types": "./docs/types", - "scripts": { - "test": "make test", - "test-cov": "make test-cov", - "examples": "make examples", - "benchmark": "make benchmark" - }, + "type": "module", + "main": "./index.mjs", "homepage": "https://stdlib.io", "repository": { "type": "git", @@ -35,41 +13,6 @@ "bugs": { "url": "https://github.com/stdlib-js/stdlib/issues" }, - "dependencies": { - "@stdlib/array-fixed-endian-factory": "github:stdlib-js/array-fixed-endian-factory#main", - "@stdlib/error-tools-fmtprodmsg": "^0.2.2" - }, - "devDependencies": { - "@stdlib/array-buffer": "^0.2.2", - "@stdlib/array-float64": "^0.2.2", - "@stdlib/array-zero-to": "^0.2.2", - "@stdlib/assert-is-arraybuffer": "^0.2.2", - "@stdlib/assert-is-nonnegative-integer": "^0.2.2", - "@stdlib/assert-is-number": "^0.2.2", - "@stdlib/console-log-each": "^0.2.2", - "@stdlib/math-base-special-pow": "^0.3.0", - "@stdlib/random-array-randu": "^0.2.1", - "@stdlib/symbol-iterator": "^0.2.2", - "tape": "git+https://github.com/kgryte/tape.git#fix/globby", - "istanbul": "^0.4.1", - "tap-min": "git+https://github.com/Planeshifter/tap-min.git", - "@stdlib/bench-harness": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], "keywords": [ "stdlib", "stdtypes", @@ -94,4 +37,4 @@ "type": "opencollective", "url": "https://opencollective.com/stdlib" } -} \ No newline at end of file +} diff --git a/stats.html b/stats.html new file mode 100644 index 0000000..129fd6c --- /dev/null +++ b/stats.html @@ -0,0 +1,4842 @@ + + + + + + + + Rollup Visualizer + + + +
+ + + + + diff --git a/test/dist/test.js b/test/dist/test.js deleted file mode 100644 index a8a9c60..0000000 --- a/test/dist/test.js +++ /dev/null @@ -1,33 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2023 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var tape = require( 'tape' ); -var main = require( './../../dist' ); - - -// TESTS // - -tape( 'main export is defined', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( main !== void 0, true, 'main export is defined' ); - t.end(); -}); diff --git a/test/test.js b/test/test.js deleted file mode 100644 index fc72bbf..0000000 --- a/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF 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 ctor = require( './../lib' ); - - -// TESTS // - -tape( 'main export is a function', function test( t ) { - t.ok( true, __filename ); - t.strictEqual( typeof ctor, 'function', 'main export is a function' ); - t.end(); -}); - -// TODO: add tests pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy