From 5bd82c31cd87771d0e529c84536fccffde6ab3fd Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 19 Aug 2023 00:03:32 +0000 Subject: [PATCH] Auto-generated commit --- .github/workflows/productionize.yml | 21 +++------------------ .github/workflows/publish.yml | 4 ++-- .github/workflows/test.yml | 2 +- .github/workflows/test_bundles.yml | 6 +++--- .github/workflows/test_coverage.yml | 2 +- .github/workflows/test_install.yml | 2 +- CONTRIBUTORS | 20 +++++++++++++------- dist/index.d.ts | 3 +++ dist/index.js | 7 +++++++ dist/index.js.map | 7 +++++++ docs/types/index.d.ts | 2 +- test/test.js | 2 +- 12 files changed, 43 insertions(+), 35 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 f56d473..474004b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -197,7 +197,7 @@ jobs: # Publish package to npm: - name: 'Publish package to npm' - uses: JS-DevTools/npm-publish@v1 + uses: JS-DevTools/npm-publish@v2 with: token: ${{ secrets.NPM_TOKEN }} access: public @@ -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 2304b3e..9f5e5ba 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 2895a2e..aa4b4a9 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/CONTRIBUTORS b/CONTRIBUTORS index 34dfa68..93c4bde 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3,31 +3,37 @@ # Contributors listed in alphabetical order. Ali Salesi +Amit Jimiwal Athan Reines Brendan Graetz Bruno Fenzl Christopher Dambamuromo +Dan Rose Dominik Moritz +Dorrin Sotoudeh Frank Kovacs -Harshita Kalani <95532771+HarshitaKalani@users.noreply.github.com> -James +Harshita Kalani +James Gelok Jithin KS Joey Reed -Jordan-Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com> +Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com> Joris Labie Justin Dennison -Marcus +Marcus Fantham Matt Cochrane Milan Raj Momtchil Momtchev +Naresh Jagadeesan +Nithin Katta <88046362+nithinkatta@users.noreply.github.com> Ognjen Jevremović Philipp Burckhardt -Pranav <85227306+Pranavchiku@users.noreply.github.com> +Pranav Goswami Ricky Reusser +Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com> Ryan Seal Seyyed Parsa Neshaei Shraddheya Shendre Stephannie Jiménez Gacha -dorrin-sot <59933477+dorrin-sot@users.noreply.github.com> +Yernar Yergaziyev orimiles5 <97595296+orimiles5@users.noreply.github.com> -rei2hu +rei2hu diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..c6e2553 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import iterBarlettHannPulse from '../docs/types/index'; +export = iterBarlettHannPulse; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..02ee91b --- /dev/null +++ b/dist/index.js @@ -0,0 +1,7 @@ +"use strict";var v=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var p=v(function(S,l){ +var P=require('@stdlib/assert-is-plain-object/dist'),a=require('@stdlib/assert-has-own-property/dist'),E=require('@stdlib/assert-is-positive-number/dist').isPrimitive,x=require('@stdlib/assert-is-integer/dist').isPrimitive,s=require('@stdlib/assert-is-positive-integer/dist').isPrimitive,T=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,n=require('@stdlib/error-tools-fmtprodmsg/dist');function A(e,r){return P(r)?a(r,"duration")&&(e.duration=r.duration,!s(r.duration))?new TypeError(n('0tB3P',"duration",r.duration)):a(r,"period")&&(e.period=r.period,!s(r.period))?new TypeError(n('0tB3P',"period",r.period)):a(r,"amplitude")&&(e.amplitude=r.amplitude,!E(r.amplitude))?new TypeError(n('0tB4D',"amplitude",r.amplitude)):a(r,"offset")&&(e.offset=r.offset,!x(r.offset))?new TypeError(n('0tB8M',"offset",r.offset)):a(r,"iter")&&(e.iter=r.iter,!T(r.iter))?new TypeError(n('0tB2t',"iter",r.iter)):null:new TypeError(n('0tB2V',r));}l.exports=A +});var c=v(function(V,q){ +var d=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),m=require('@stdlib/symbol-iterator/dist'),I=require('@stdlib/math-base-special-abs/dist'),N=require('@stdlib/math-base-special-cospi/dist'),g=require('@stdlib/error-tools-fmtprodmsg/dist'),R=p(),j=.62,H=.48,B=.38;function F(e,r,t){return r-=1,t*(j-H*I(e/r-.5)-B*N(2/r*e))}function b(e){var r,t,f,u,i,o;if(r={duration:-1,period:100,amplitude:1,offset:0,iter:1e308},arguments.length&&(u=R(r,e),u))throw u;if(r.duration===-1&&(r.duration=r.period),r.duration>r.period)throw new RangeError(g('0tB8K',"duration",r.duration));if(r.duration<=2)throw new RangeError(g('0tB8L',"duration",r.duration));return i=(r.period-r.offset)%r.period,i<0&&(i+=r.period),i-=1,o=0,t={},d(t,"next",w),d(t,"return",O),m&&d(t,m,h),t;function w(){return o+=1,f||o>r.iter?{done:!0}:(i=(i+1)%r.period,{value:i\n*\n* v = iter.next().value;\n* // returns \n*\n* v = iter.next().value;\n* // returns \n*\n* // ...\n*/\nfunction iterBartlettHannPulse( options ) {\n\tvar opts;\n\tvar iter;\n\tvar FLG;\n\tvar err;\n\tvar t;\n\tvar i;\n\n\topts = {\n\t\t'duration': -1,\n\t\t'period': 100,\n\t\t'amplitude': 1.0,\n\t\t'offset': 0,\n\t\t'iter': 1e308\n\t};\n\tif ( arguments.length ) {\n\t\terr = validate( opts, options );\n\t\tif ( err ) {\n\t\t\tthrow err;\n\t\t}\n\t}\n\tif ( opts.duration === -1 ) {\n\t\topts.duration = opts.period;\n\t}\n\tif ( opts.duration > opts.period ) {\n\t\tthrow new RangeError( format( 'invalid option. `%s` option must be less than or equal to the period. Option: `%u`.', 'duration', opts.duration ) );\n\t}\n\tif ( opts.duration <= 2 ) {\n\t\tthrow new RangeError( format( 'invalid option. `%s` option must be greater than 2. Option: `%s`.', 'duration', opts.duration ) );\n\t}\n\tt = ( opts.period-opts.offset ) % opts.period;\n\tif ( t < 0 ) {\n\t\tt += opts.period;\n\t}\n\tt -= 1;\n\ti = 0;\n\n\t// Create an iterator protocol-compliant object:\n\titer = {};\n\tsetReadOnly( iter, 'next', next );\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\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 next() {\n\t\ti += 1;\n\t\tif ( FLG || i > opts.iter ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tt = (t+1) % opts.period;\n\t\treturn {\n\t\t\t'value': ( t < opts.duration ) ? bartlettHann( t, opts.duration, opts.amplitude ) : 0.0,\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\treturn iterBartlettHannPulse( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterBartlettHannPulse;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 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 which generates a Bartlett-Hann pulse waveform.\n*\n* @module @stdlib/simulate-iter-bartlett-hann-pulse\n*\n* @example\n* var iterBartlettHannPulse = require( '@stdlib/simulate-iter-bartlett-hann-pulse' );\n*\n* var opts = {\n* 'period': 10\n* };\n*\n* var iter = iterBartlettHannPulse( opts );\n*\n* var v = iter.next().value;\n* // returns \n*\n* v = iter.next().value;\n* // returns \n*\n* v = iter.next().value;\n* // returns \n*\n* // ...\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,EAAgB,QAAS,gCAAiC,EAC1DC,EAAa,QAAS,iCAAkC,EACxDC,EAAmB,QAAS,mCAAoC,EAAE,YAClEC,EAAY,QAAS,2BAA4B,EAAE,YACnDC,EAAoB,QAAS,oCAAqC,EAAE,YACpEC,EAAuB,QAAS,uCAAwC,EAAE,YAC1EC,EAAS,QAAS,uBAAwB,EA4B9C,SAASC,EAAUC,EAAMC,EAAU,CAClC,OAAMT,EAAeS,CAAQ,EAGxBR,EAAYQ,EAAS,UAAW,IACpCD,EAAK,SAAWC,EAAQ,SACnB,CAACL,EAAmBK,EAAQ,QAAS,GAClC,IAAI,UAAWH,EAAQ,wEAAyE,WAAYG,EAAQ,QAAS,CAAE,EAGnIR,EAAYQ,EAAS,QAAS,IAClCD,EAAK,OAASC,EAAQ,OACjB,CAACL,EAAmBK,EAAQ,MAAO,GAChC,IAAI,UAAWH,EAAQ,wEAAyE,SAAUG,EAAQ,MAAO,CAAE,EAG/HR,EAAYQ,EAAS,WAAY,IACrCD,EAAK,UAAYC,EAAQ,UACpB,CAACP,EAAkBO,EAAQ,SAAU,GAClC,IAAI,UAAWH,EAAQ,uEAAwE,YAAaG,EAAQ,SAAU,CAAE,EAGpIR,EAAYQ,EAAS,Q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AE,EAEhI,OAAAL,GAAMK,EAAK,OAAOA,EAAK,QAAWA,EAAK,OAClCL,EAAI,IACRA,GAAKK,EAAK,QAEXL,GAAK,EACLS,EAAI,EAGJH,EAAO,CAAC,EACRhB,EAAagB,EAAM,OAAQI,CAAK,EAChCpB,EAAagB,EAAM,SAAUK,CAAI,EAG5BpB,GACJD,EAAagB,EAAMf,EAAgBqB,CAAQ,EAErCN,EAQP,SAASI,GAAO,CAEf,OADAD,GAAK,EACAF,GAAOE,EAAIJ,EAAK,KACb,CACN,KAAQ,EACT,GAEDL,GAAKA,EAAE,GAAKK,EAAK,OACV,CACN,MAAWL,EAAIK,EAAK,SAAaN,EAAcC,EAAGK,EAAK,SAAUA,EAAK,SAAU,EAAI,EACpF,KAAQ,EACT,EACD,CASA,SAASM,EAAKE,EAAQ,CAErB,OADAN,EAAM,GACD,UAAU,OACP,CACN,MAASM,EACT,KAAQ,EACT,EAEM,CACN,KAAQ,EACT,CACD,CAQA,SAASD,GAAU,CAClB,OAAOT,EAAuBE,CAAK,CACpC,CACD,CAKAhB,EAAO,QAAUc,IC/IjB,IAAIW,EAAO,IAKX,OAAO,QAAUA", + "names": ["require_validate", "__commonJSMin", "exports", "module", "isPlainObject", "hasOwnProp", "isPositiveNumber", "isInteger", "isPositiveInteger", "isNonNegativeInteger", "format", "validate", "opts", "options", "require_main", "__commonJSMin", "exports", "module", "setReadOnly", "iteratorSymbol", "abs", "cospi", "format", "validate", "A0", "A1", "A2", "bartlettHann", "t", "T", "A", "iterBartlettHannPulse", "options", "opts", "iter", "FLG", "err", "i", "next", "end", "factory", "value", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index a2b0fbe..92f73b1 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /// diff --git a/test/test.js b/test/test.js index 3ebdc7a..9726534 100644 --- a/test/test.js +++ b/test/test.js @@ -41,7 +41,7 @@ function bartlettHann( t, A, T ) { tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.equal( typeof iterBartlettHannPulse, 'function', 'main export is a function' ); + t.strictEqual( typeof iterBartlettHannPulse, 'function', 'main export is a function' ); t.end(); });