diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 2b06665..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-08-01T02:31:43.500Z diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 334eb59..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: | diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..99b7c71 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import itercusumabs2 from '../docs/types/index'; +export = itercusumabs2; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..37d1c2d --- /dev/null +++ b/dist/index.js @@ -0,0 +1,5 @@ +"use strict";var d=function(u,r){return function(){return r||u((r={exports:{}}).exports,r),r.exports}};var v=d(function(g,s){ +var i=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),m=require('@stdlib/assert-is-iterator-like/dist'),q=require('@stdlib/assert-is-function/dist'),n=require('@stdlib/symbol-iterator/dist'),p=require('@stdlib/stats-incr-sumabs2/dist'),x=require('@stdlib/error-tools-fmtprodmsg/dist');function o(u){var r,t,a;if(!m(u))throw new TypeError(x('1Kb3w',u));return a=p(),r={},i(r,"next",f),i(r,"return",c),n&&q(u[n])&&i(r,n,l),r;function f(){var e;return t?{done:!0}:(e=u.next(),e.done?(t=!0,e):(typeof e.value=="number"?e=a(e.value):e=a(NaN),{value:e,done:!1}))}function c(e){return t=!0,arguments.length?{value:e,done:!0}:{done:!0}}function l(){return o(u[n]())}}s.exports=o +});var y=v();module.exports=y; +/** @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..c80e7d6 --- /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) 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// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar isIteratorLike = require( '@stdlib/assert-is-iterator-like' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar iteratorSymbol = require( '@stdlib/symbol-iterator' );\nvar incrsumabs2 = require( '@stdlib/stats-incr-sumabs2' );\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Returns an iterator which iteratively computes a cumulative sum of squared absolute values.\n*\n* @param {Iterator} iterator - input iterator\n* @throws {TypeError} must provide an iterator\n* @returns {Iterator} iterator\n*\n* @example\n* var runif = require( '@stdlib/random-iter-uniform' );\n*\n* var rand = runif( -10.0, 10.0, {\n* 'iter': 100\n* });\n*\n* var it = itercusumabs2( rand );\n*\n* var v = it.next().value;\n* // returns \n*\n* v = it.next().value;\n* // returns \n*\n* v = it.next().value;\n* // returns \n*\n* // ...\n*/\nfunction itercusumabs2( iterator ) {\n\tvar iter;\n\tvar FLG;\n\tvar acc;\n\tif ( !isIteratorLike( iterator ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Must provide an iterator. Value: `%s`.', iterator ) );\n\t}\n\tacc = incrsumabs2();\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 && isFunction( iterator[ 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\tvar v;\n\t\tif ( FLG ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\tv = iterator.next();\n\t\tif ( v.done ) {\n\t\t\tFLG = true;\n\t\t\treturn v;\n\t\t}\n\t\tif ( typeof v.value === 'number' ) {\n\t\t\tv = acc( v.value );\n\t\t} else {\n\t\t\tv = acc( NaN );\n\t\t}\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\treturn itercusumabs2( iterator[ iteratorSymbol ]() );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = itercusumabs2;\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 iteratively computes a cumulative sum of squared absolute values.\n*\n* @module @stdlib/stats-iter-cusumabs2\n*\n* @example\n* var runif = require( '@stdlib/random-iter-uniform' );\n* var itercusumabs2 = require( '@stdlib/stats-iter-cusumabs2' );\n*\n* var rand = runif( -10.0, 10.0, {\n* 'iter': 100\n* });\n*\n* var it = itercusumabs2( rand );\n*\n* var v = it.next().value;\n* // returns \n*\n* v = it.next().value;\n* // returns \n*\n* v = it.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,EAAc,QAAS,uDAAwD,EAC/EC,EAAiB,QAAS,iCAAkC,EAC5DC,EAAa,QAAS,4BAA6B,EACnDC,EAAiB,QAAS,yBAA0B,EACpDC,EAAc,QAAS,4BAA6B,EACpDC,EAAS,QAAS,uBAAwB,EAgC9C,SAASC,EAAeC,EAAW,CAClC,IAAIC,EACAC,EACAC,EACJ,GAAK,CAACT,EAAgBM,CAAS,EAC9B,MAAM,IAAI,UAAWF,EAAQ,2DAA4DE,CAAS,CAAE,EAErG,OAAAG,EAAMN,EAAY,EAGlBI,EAAO,CAAC,EACRR,EAAaQ,EAAM,OAAQG,CAAK,EAChCX,EAAaQ,EAAM,SAAUI,CAAI,EAG5BT,GAAkBD,EAAYK,EAAUJ,CAAe,CAAE,GAC7DH,EAAaQ,EAAML,EAAgBU,CAAQ,EAErCL,EAQP,SAASG,GAAO,CACf,IAAIG,EACJ,OAAKL,EACG,CACN,KAAQ,EACT,GAEDK,EAAIP,EAAS,KAAK,EACbO,EAAE,MACNL,EAAM,GACCK,IAEH,OAAOA,EAAE,OAAU,SACvBA,EAAIJ,EAAKI,EAAE,KAAM,EAEjBA,EAAIJ,EAAK,GAAI,EAEP,CACN,MAASI,EACT,KAAQ,EACT,GACD,CASA,SAASF,EAAKG,EAAQ,CAErB,OADAN,EAAM,GACD,UAAU,OACP,CACN,MAASM,EACT,KAAQ,EACT,EAEM,CACN,KAAQ,EACT,CACD,CAQA,SAASF,GAAU,CAClB,OAAOP,EAAeC,EAAUJ,CAAe,EAAE,CAAE,CACpD,CACD,CAKAJ,EAAO,QAAUO,IC7FjB,IAAIU,EAAO,IAKX,OAAO,QAAUA", + "names": ["require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isIteratorLike", "isFunction", "iteratorSymbol", "incrsumabs2", "format", "itercusumabs2", "iterator", "iter", "FLG", "acc", "next", "end", "factory", "v", "value", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index d2957b4..b0f6998 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 ///