From 71952a8ccee4cb9a95f99a14fe576c39047de2f9 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 19 Aug 2023 01:49:34 +0000 Subject: [PATCH] Auto-generated commit --- .github/workflows/productionize.yml | 21 +++------------------ .github/workflows/publish.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/test_bundles.yml | 6 +++--- .github/workflows/test_coverage.yml | 2 +- .github/workflows/test_install.yml | 2 +- dist/index.d.ts | 3 +++ dist/index.js | 5 +++++ dist/index.js.map | 7 +++++++ docs/types/index.d.ts | 2 +- 10 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 3e8e2db..91f2b93 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -82,21 +82,6 @@ jobs: id: transform-error-messages uses: stdlib-js/transform-errors-action@main - # Format error messages: - - name: 'Replace double quotes with single quotes in rewritten format string error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\( \"([a-zA-Z0-9]+)\"/Error\( format\( '\1'/g" {} \; - - # Format string literal error messages: - - name: 'Replace double quotes with single quotes in rewritten string literal error messages' - run: | - find . -name "*.js" -exec sed -E -i "s/Error\( format\(\"([a-zA-Z0-9]+)\"\)/Error\( format\( '\1' \)/g" {} \; - - # Format code: - - name: 'Replace double quotes with single quotes in inserted `require` calls' - run: | - find . -name "*.js" -exec sed -E -i "s/require\( ?\"@stdlib\/error-tools-fmtprodmsg\" ?\);/require\( '@stdlib\/error-tools-fmtprodmsg' \);/g" {} \; - # Change `@stdlib/string-format` to `@stdlib/error-tools-fmtprodmsg` in package.json if the former is a dependency, otherwise insert it as a dependency: - name: 'Update dependencies in package.json' run: | @@ -349,7 +334,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} @@ -520,7 +505,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} @@ -697,7 +682,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 26be02d..474004b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -209,7 +209,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9176a69..85e49f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,7 @@ jobs: # Send status to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test_bundles.yml b/.github/workflows/test_bundles.yml index e9df6a0..172cb2d 100644 --- a/.github/workflows/test_bundles.yml +++ b/.github/workflows/test_bundles.yml @@ -88,7 +88,7 @@ jobs: # Send notification to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} @@ -130,7 +130,7 @@ jobs: # Send notification to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} @@ -172,7 +172,7 @@ jobs: # Send notification to Slack channel if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 6d8aa0b..a73c515 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -106,7 +106,7 @@ jobs: # Send Slack notification if job fails: - name: 'Send status to Slack channel in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test_install.yml b/.github/workflows/test_install.yml index 61d9109..99b1364 100644 --- a/.github/workflows/test_install.yml +++ b/.github/workflows/test_install.yml @@ -75,7 +75,7 @@ jobs: # Send Slack notification if job fails: - name: 'Send notification to Slack in case of failure' - uses: act10ns/slack@v1 + uses: act10ns/slack@v2 with: status: ${{ job.status }} steps: ${{ toJson(steps) }} diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..8d5f07c --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import stridedarray2iterator from '../docs/types/index'; +export = stridedarray2iterator; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..4f1f293 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,5 @@ +"use strict";var E=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var w=E(function(C,h){ +var m=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),F=require('@stdlib/assert-is-function/dist'),V=require('@stdlib/assert-is-collection/dist'),y=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,A=require('@stdlib/assert-is-integer/dist').isPrimitive,G=require('@stdlib/array-base-assert-is-accessor-array/dist'),c=require('@stdlib/symbol-iterator/dist'),I=require('@stdlib/array-base-accessor-getter/dist'),P=require('@stdlib/array-base-getter/dist'),S=require('@stdlib/array-dtype/dist'),g=require('@stdlib/error-tools-fmtprodmsg/dist');function q(r,e,a,o){var s,i,f,t,u,l,d,v;if(!y(r))throw new TypeError(g('01h2d',r));if(!V(e))throw new TypeError(g('01h2y',e));if(!A(a))throw new TypeError(g('01h2z',a));if(!y(o))throw new TypeError(g('01h30',o));if(arguments.length>4){if(t=arguments[4],!F(t))throw new TypeError(g('01h31',t));s=arguments[5]}return u=o,v=-1,i={},t?m(i,"next",p):m(i,"next",b),m(i,"return",x),c&&m(i,c,T),d=S(e),G(e)?l=I(d):l=P(d),i;function p(){var n;return v+=1,f||v>=r?{done:!0}:(n=t.call(s,l(e,u),u,v,e),u+=a,{value:n,done:!1})}function b(){var n;return v+=1,f||v>=r?{done:!0}:(n=l(e,u),u+=a,{value:n,done:!1})}function x(n){return f=!0,arguments.length?{value:n,done:!0}:{done:!0}}function T(){return t?q(r,e,a,o,t,s):q(r,e,a,o)}}h.exports=q +});var j=w();module.exports=j; +/** @license Apache-2.0 */ +//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..45feaf3 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../lib/main.js", "../lib/index.js"], + "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 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 setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isCollection = require( '@stdlib/assert-is-collection' );\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar isInteger = require( '@stdlib/assert-is-integer' ).isPrimitive;\nvar isAccessorArray = require( '@stdlib/array-base-assert-is-accessor-array' );\nvar iteratorSymbol = require( '@stdlib/symbol-iterator' );\nvar accessorGetter = require( '@stdlib/array-base-accessor-getter' );\nvar getter = require( '@stdlib/array-base-getter' );\nvar dtype = require( '@stdlib/array-dtype' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator which iterates over elements in an array-like object according to specified stride parameters.\n*\n* @param {NonNegativeInteger} N - number of values to iterate\n* @param {Collection} src - input value\n* @param {integer} stride - stride length\n* @param {NonNegativeInteger} offset - starting index\n* @param {Function} [mapFcn] - function to invoke for each iterated value\n* @param {*} [thisArg] - execution context\n* @throws {TypeError} first argument must be a nonnegative integer\n* @throws {TypeError} second argument must be an array-like object\n* @throws {TypeError} third argument must be an integer\n* @throws {TypeError} fourth argument must be a nonnegative integer\n* @throws {TypeError} fifth argument must be a function\n* @returns {Iterator} iterator\n*\n* @example\n* var values = [ 1, 2, 3, 4, 5, 6, 7, 8 ];\n*\n* var N = 4;\n* var stride = -2;\n* var offset = 6;\n*\n* var iter = stridedarray2iterator( N, values, stride, offset );\n*\n* var v = iter.next().value;\n* // returns 7\n*\n* v = iter.next().value;\n* // returns 5\n*\n* v = iter.next().value;\n* // returns 3\n*\n* // ...\n*/\nfunction stridedarray2iterator( N, src, stride, offset ) {\n\tvar thisArg;\n\tvar iter;\n\tvar FLG;\n\tvar fcn;\n\tvar idx;\n\tvar get;\n\tvar dt;\n\tvar i;\n\tif ( !isNonNegativeInteger( N ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t}\n\tif ( !isCollection( src ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be an array-like object. Value: `%s`.', src ) );\n\t}\n\tif ( !isInteger( stride ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Third argument must be an integer. Value: `%s`.', stride ) );\n\t}\n\tif ( !isNonNegativeInteger( offset ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%s`.', offset ) );\n\t}\n\tif ( arguments.length > 4 ) {\n\t\tfcn = arguments[ 4 ];\n\t\tif ( !isFunction( fcn ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Fifth argument must be a function. Value: `%s`.', fcn ) );\n\t\t}\n\t\tthisArg = arguments[ 5 ];\n\t}\n\tidx = offset;\n\ti = -1;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tif ( fcn ) {\n\t\tsetReadOnly( iter, 'next', next1 );\n\t} else {\n\t\tsetReadOnly( iter, 'next', next2 );\n\t}\n\tsetReadOnly( iter, 'return', end );\n\n\t// If an environment supports `Symbol.iterator`, make the iterator iterable:\n\tif ( iteratorSymbol ) {\n\t\tsetReadOnly( iter, iteratorSymbol, factory );\n\t}\n\t// Resolve an accessor for retrieving array elements (e.g., to accommodate `Complex64Array`, etc):\n\tdt = dtype( src );\n\tif ( isAccessorArray( src ) ) {\n\t\tget = accessorGetter( dt );\n\t} else {\n\t\tget = getter( dt );\n\t}\n\treturn iter;\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next1() {\n\t\tvar v;\n\t\ti += 1;\n\t\tif ( FLG || i >= N ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tv = fcn.call( thisArg, get( src, idx ), idx, i, src );\n\t\tidx += stride;\n\t\treturn {\n\t\t\t'value': v,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Returns an iterator protocol-compliant object containing the next iterated value.\n\t*\n\t* @private\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction next2() {\n\t\tvar v;\n\t\ti += 1;\n\t\tif ( FLG || i >= N ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tv = get( src, idx );\n\t\tidx += stride;\n\t\treturn {\n\t\t\t'value': v,\n\t\t\t'done': false\n\t\t};\n\t}\n\n\t/**\n\t* Finishes an iterator.\n\t*\n\t* @private\n\t* @param {*} [value] - value to return\n\t* @returns {Object} iterator protocol-compliant object\n\t*/\n\tfunction end( value ) {\n\t\tFLG = true;\n\t\tif ( arguments.length ) {\n\t\t\treturn {\n\t\t\t\t'value': value,\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'done': true\n\t\t};\n\t}\n\n\t/**\n\t* Returns a new iterator.\n\t*\n\t* @private\n\t* @returns {Iterator} iterator\n\t*/\n\tfunction factory() {\n\t\tif ( fcn ) {\n\t\t\treturn stridedarray2iterator( N, src, stride, offset, fcn, thisArg ); // eslint-disable-line max-len\n\t\t}\n\t\treturn stridedarray2iterator( N, src, stride, offset );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = stridedarray2iterator;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Create an iterator from a strided array-like value.\n*\n* @module @stdlib/array-to-strided-iterator\n*\n* @example\n* var stridedarray2iterator = require( '@stdlib/array-to-strided-iterator' );\n*\n* var values = [ 1, 2, 3, 4, 5, 6, 7, 8 ];\n*\n* var N = 4;\n* var stride = -2;\n* var offset = 6;\n*\n* var iter = stridedarray2iterator( N, values, stride, offset );\n*\n* var v = iter.next().value;\n* // returns 7\n*\n* v = iter.next().value;\n* // returns 5\n*\n* v = iter.next().value;\n* // returns 3\n*\n* // ...\n*/\n\n//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AM,SAAUS,CAAI,EAG5BpB,GACJN,EAAaiB,EAAMX,EAAgBqB,CAAQ,EAG5CL,EAAKb,EAAOI,CAAI,EACXR,EAAiBQ,CAAI,EACzBQ,EAAMd,EAAgBe,CAAG,EAEzBD,EAAMb,EAAQc,CAAG,EAEXL,EAQP,SAASO,GAAQ,CAChB,IAAII,EAEJ,OADAL,GAAK,EACAL,GAAOK,GAAKX,EACT,CACN,KAAQ,EACT,GAEDgB,EAAIT,EAAI,KAAMH,EAASK,EAAKR,EAAKO,CAAI,EAAGA,EAAKG,EAAGV,CAAI,EACpDO,GAAON,EACA,CACN,MAASc,EACT,KAAQ,EACT,EACD,CAQA,SAASH,GAAQ,CAChB,IAAIG,EAEJ,OADAL,GAAK,EACAL,GAAOK,GAAKX,EACT,CACN,KAAQ,EACT,GAEDgB,EAAIP,EAAKR,EAAKO,CAAI,EAClBA,GAAON,EACA,CACN,MAASc,EACT,KAAQ,EACT,EACD,CASA,SAASF,EAAKG,EAAQ,CAErB,OADAX,EAAM,GACD,UAAU,OACP,CACN,MAASW,EACT,KAAQ,EACT,EAEM,CACN,KAAQ,EACT,CACD,CAQA,SAASF,GAAU,CAClB,OAAKR,EACGR,EAAuBC,EAAGC,EAAKC,EAAQC,EAAQI,EAAKH,CAAQ,EAE7DL,EAAuBC,EAAGC,EAAKC,EAAQC,CAAO,CACtD,CACD,CAKAhB,EAAO,QAAUY,IC7JjB,IAAImB,EAAO,IAKX,OAAO,QAAUA", + "names": ["require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isFunction", "isCollection", "isNonNegativeInteger", "isInteger", "isAccessorArray", "iteratorSymbol", "accessorGetter", "getter", "dtype", "format", "stridedarray2iterator", "N", "src", "stride", "offset", "thisArg", "iter", "FLG", "fcn", "idx", "get", "dt", "i", "next1", "next2", "end", "factory", "v", "value", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 9637b27..655b228 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 ///