From 9ffdbeb5cd682d7cb96000fc5d94adbf143d34d9 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 23 Sep 2023 14:57:03 +0000 Subject: [PATCH] Release v0.1.0 --- .editorconfig | 5 +++++ .github/.keepalive | 1 - .github/workflows/productionize.yml | 15 --------------- CITATION.cff | 30 +++++++++++++++++++++++++++++ README.md | 15 +++++++++++++-- dist/index.d.ts | 3 +++ dist/index.js | 5 +++++ dist/index.js.map | 7 +++++++ docs/types/index.d.ts | 2 +- package.json | 20 +++++++++---------- 10 files changed, 74 insertions(+), 29 deletions(-) delete mode 100644 .github/.keepalive create mode 100644 CITATION.cff create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map diff --git a/.editorconfig b/.editorconfig index 0fd4d6c..13e9c39 100644 --- a/.editorconfig +++ b/.editorconfig @@ -179,3 +179,8 @@ indent_size = 2 [*.gypi] indent_style = space indent_size = 2 + +# Set properties for citation files: +[*.{cff,cff.txt}] +indent_style = space +indent_size = 2 diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 06d747a..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-08-01T03:58:36.720Z 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/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..2ec6fff --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,30 @@ +cff-version: 1.2.0 +title: stdlib +message: >- + If you use this software, please cite it using the + metadata from this file. + +type: software + +authors: + - name: The Stdlib Authors + url: https://github.com/stdlib-js/stdlib/graphs/contributors + +repository-code: https://github.com/stdlib-js/stdlib +url: https://stdlib.io + +abstract: | + Standard library for JavaScript and Node.js. + +keywords: + - JavaScript + - Node.js + - TypeScript + - standard library + - scientific computing + - numerical computing + - statistical computing + +license: Apache-2.0 AND BSL-1.0 + +date-released: 2016 diff --git a/README.md b/README.md index c5bc639..74321a7 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,17 @@ limitations under the License. --> + +
+ + About stdlib... + +

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

+

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

+

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

+

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

+
+ # iterStep [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] @@ -258,8 +269,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. [npm-image]: http://img.shields.io/npm/v/@stdlib/iter-step.svg [npm-url]: https://npmjs.org/package/@stdlib/iter-step -[test-image]: https://github.com/stdlib-js/iter-step/actions/workflows/test.yml/badge.svg?branch=main -[test-url]: https://github.com/stdlib-js/iter-step/actions/workflows/test.yml?query=branch:main +[test-image]: https://github.com/stdlib-js/iter-step/actions/workflows/test.yml/badge.svg?branch=v0.1.0 +[test-url]: https://github.com/stdlib-js/iter-step/actions/workflows/test.yml?query=branch:v0.1.0 [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/iter-step/main.svg [coverage-url]: https://codecov.io/github/stdlib-js/iter-step?branch=main diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..178e6f2 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import iterStep from '../docs/types/index'; +export = iterStep; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..3c4ce15 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,5 @@ +"use strict";var w=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var d=w(function(x,l){ +var a=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),s=require('@stdlib/assert-is-number/dist').isPrimitive,m=require('@stdlib/math-base-assert-is-nan/dist'),y=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,f=require('@stdlib/symbol-iterator/dist'),o=require('@stdlib/error-tools-fmtprodmsg/dist'),T=1e308;function g(r,e,t){var n,v,i,u;if(!s(r)||m(r))throw new TypeError(o('0Pt49',r));if(!s(e)||m(e))throw new TypeError(o('0Pt4A',e));if(arguments.length>2){if(!y(t))throw new TypeError(o('0Pt2m',t));i=t}else i=T;return u=-1,n={},a(n,"next",b),a(n,"return",q),f&&a(n,f,h),n;function b(){return u+=1,v||u>=i?{done:!0}:{value:r+u*e,done:!1}}function q(p){return v=!0,arguments.length?{value:p,done:!0}:{done:!0}}function h(){return g(r,e,i)}}l.exports=g +});var E=d();module.exports=E; +/** @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..cc1e3f5 --- /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 isNumber = require( '@stdlib/assert-is-number' ).isPrimitive;\nvar isnan = require( '@stdlib/math-base-assert-is-nan' );\nvar isNonNegativeInteger = require( '@stdlib/assert-is-nonnegative-integer' ).isPrimitive;\nvar iteratorSymbol = require( '@stdlib/symbol-iterator' );\nvar format = require( '@stdlib/string-format' );\n\n\n// VARIABLES //\n\nvar DEFAULT_LENGTH = 1e308;\n\n\n// MAIN //\n\n/**\n* Returns an iterator which returns a sequence of numbers according to a specified increment.\n*\n* @param {number} start - starting value (inclusive)\n* @param {number} increment - increment\n* @param {number} [N=1e308] - number of values\n* @throws {TypeError} first argument must be a number\n* @throws {TypeError} second argument must be a number\n* @throws {TypeError} third argument must be a nonnegative integer\n* @returns {Iterator} iterator\n*\n* @example\n* var iter = iterStep( 0, 2, 10 );\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 2\n*\n* v = iter.next().value;\n* // returns 4\n*\n* // ...\n*/\nfunction iterStep( start, increment, N ) {\n\tvar iter;\n\tvar FLG;\n\tvar n;\n\tvar i;\n\n\tif ( !isNumber( start ) || isnan( start ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. First argument must be a number. Value: `%s`.', start ) );\n\t}\n\tif ( !isNumber( increment ) || isnan( increment ) ) {\n\t\tthrow new TypeError( format( 'invalid argument. Second argument must be a number. Value: `%s`.', increment ) );\n\t}\n\tif ( arguments.length > 2 ) {\n\t\tif ( !isNonNegativeInteger( N ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%s`.', N ) );\n\t\t}\n\t\tn = N;\n\t} else {\n\t\tn = DEFAULT_LENGTH;\n\t}\n\ti = -1;\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 >= n ) {\n\t\t\treturn {\n\t\t\t\t'done': true\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t'value': start + (i*increment),\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 iterStep( start, increment, n );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = iterStep;\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 returns a sequence of numbers according to a specified increment.\n*\n* @module @stdlib/iter-step\n*\n* @example\n* var iterStep = require( '@stdlib/iter-step' );\n*\n* var iter = iterStep( 0, 2, 10 );\n*\n* var v = iter.next().value;\n* // returns 0\n*\n* v = iter.next().value;\n* // returns 2\n*\n* v = iter.next().value;\n* // returns 4\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,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAQ,QAAS,iCAAkC,EACnDC,EAAuB,QAAS,uCAAwC,EAAE,YAC1EC,EAAiB,QAAS,yBAA0B,EACpDC,EAAS,QAAS,uBAAwB,EAK1CC,EAAiB,MA8BrB,SAASC,EAAUC,EAAOC,EAAWC,EAAI,CACxC,IAAIC,EACAC,EACAC,EACAC,EAEJ,GAAK,CAACb,EAAUO,CAAM,GAAKN,EAAOM,CAAM,EACvC,MAAM,IAAI,UAAWH,EAAQ,kEAAmEG,CAAM,CAAE,EAEzG,GAAK,CAACP,EAAUQ,CAAU,GAAKP,EAAOO,CAAU,EAC/C,MAAM,IAAI,UAAWJ,EAAQ,mEAAoEI,CAAU,CAAE,EAE9G,GAAK,UAAU,OAAS,EAAI,CAC3B,GAAK,CAACN,EAAsBO,CAAE,EAC7B,MAAM,IAAI,UAAWL,EAAQ,+EAAgFK,CAAE,CAAE,EAElHG,EAAIH,CACL,MACCG,EAAIP,EAEL,OAAAQ,EAAI,GAGJH,EAAO,CAAC,EACRX,EAAaW,EAAM,OAAQI,CAAK,EAChCf,EAAaW,EAAM,SAAUK,CAAI,EAG5BZ,GACJJ,EAAaW,EAAMP,EAAgBa,CAAQ,EAErCN,EAQP,SAASI,GAAO,CAEf,OADAD,GAAK,EACAF,GAAOE,GAAKD,EACT,CACN,KAAQ,EACT,EAEM,CACN,MAASL,EAASM,EAAEL,EACpB,KAAQ,EACT,CACD,CASA,SAASO,EAAKE,EAAQ,CAErB,OADAN,EAAM,GACD,UAAU,OACP,CACN,MAASM,EACT,KAAQ,EACT,EAEM,CACN,KAAQ,EACT,CACD,CAQA,SAASD,GAAU,CAClB,OAAOV,EAAUC,EAAOC,EAAWI,CAAE,CACtC,CACD,CAKAd,EAAO,QAAUQ,ICxGjB,IAAIY,EAAO,IAKX,OAAO,QAAUA", + "names": ["require_main", "__commonJSMin", "exports", "module", "setReadOnly", "isNumber", "isnan", "isNonNegativeInteger", "iteratorSymbol", "format", "DEFAULT_LENGTH", "iterStep", "start", "increment", "N", "iter", "FLG", "n", "i", "next", "end", "factory", "value", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 7a96816..ec18f2c 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -16,7 +16,7 @@ * limitations under the License. */ -// TypeScript Version: 2.0 +// TypeScript Version: 4.1 /// diff --git a/package.json b/package.json index 3a7af51..2ad0df1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stdlib/iter-step", - "version": "0.0.7", + "version": "0.1.0", "description": "Create an iterator which returns a sequence of numbers according to a specified increment.", "license": "Apache-2.0", "author": { @@ -37,17 +37,17 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/assert-is-nonnegative-integer": "^0.0.7", - "@stdlib/assert-is-number": "^0.0.7", - "@stdlib/math-base-assert-is-nan": "^0.0.8", - "@stdlib/string-format": "^0.0.3", - "@stdlib/symbol-iterator": "^0.0.7", - "@stdlib/types": "^0.0.14", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.7" + "@stdlib/assert-is-nonnegative-integer": "^0.1.0", + "@stdlib/assert-is-number": "^0.1.0", + "@stdlib/math-base-assert-is-nan": "^0.1.0", + "@stdlib/string-format": "^0.1.0", + "@stdlib/symbol-iterator": "^0.1.0", + "@stdlib/types": "^0.1.0", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0" }, "devDependencies": { - "@stdlib/assert-is-iterator-like": "^0.0.7", - "@stdlib/bench": "^0.0.12", + "@stdlib/assert-is-iterator-like": "^0.1.0", + "@stdlib/bench": "^0.1.0", "proxyquire": "^2.0.0", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1",