From 3da9918d852e9ea73411e81928c5f2a4a467d1ae Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 23 Sep 2023 21:40:30 +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 | 7 +++++++ dist/index.js.map | 7 +++++++ docs/types/index.d.ts | 2 +- package.json | 18 ++++++++--------- 10 files changed, 75 insertions(+), 28 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 3132d3d..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-08-01T04:54:31.892Z 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 87c43ef..0bf5937 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!

+
+ # reviveError [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] @@ -203,8 +214,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. [npm-image]: http://img.shields.io/npm/v/@stdlib/error-reviver.svg [npm-url]: https://npmjs.org/package/@stdlib/error-reviver -[test-image]: https://github.com/stdlib-js/error-reviver/actions/workflows/test.yml/badge.svg?branch=main -[test-url]: https://github.com/stdlib-js/error-reviver/actions/workflows/test.yml?query=branch:main +[test-image]: https://github.com/stdlib-js/error-reviver/actions/workflows/test.yml/badge.svg?branch=v0.1.0 +[test-url]: https://github.com/stdlib-js/error-reviver/actions/workflows/test.yml?query=branch:v0.1.0 [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/error-reviver/main.svg [coverage-url]: https://codecov.io/github/stdlib-js/error-reviver?branch=main diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..51c40cf --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +/// +import reviveError from '../docs/types/index'; +export = reviveError; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..6824ffe --- /dev/null +++ b/dist/index.js @@ -0,0 +1,7 @@ +"use strict";var c=function(n,r){return function(){return r||n((r={exports:{}}).exports,r),r.exports}};var y=c(function(S,f){ +var g={Error:Error,TypeError:TypeError,SyntaxError:SyntaxError,ReferenceError:ReferenceError,URIError:URIError,EvalError:EvalError,RangeError:RangeError};f.exports=g +});var v=c(function(q,p){ +var k=require('@stdlib/utils-keys/dist'),a=require('@stdlib/assert-is-string/dist').isPrimitive,R=y();function m(n,r){var E,o,s,t,e,i;if(r&&r.type&&a(r.message)&&(o=R[r.type],o)){for(t=new o(r.message),s=k(r),i=0;i\n*/\nfunction reviveError( key, value ) {\n\tvar hasStack;\n\tvar ctor;\n\tvar keys;\n\tvar err;\n\tvar k;\n\tvar i;\n\tif (\n\t\tvalue &&\n\t\tvalue.type &&\n\t\tisString( value.message )\n\t) {\n\t\tctor = ctors[ value.type ];\n\t\tif ( ctor ) {\n\t\t\terr = new ctor( value.message );\n\t\t\tkeys = objectKeys( value );\n\t\t\tfor ( i = 0; i < keys.length; i++ ) {\n\t\t\t\tk = keys[ i ];\n\t\t\t\tif (\n\t\t\t\t\tk === 'type' ||\n\t\t\t\t\tk === 'message' ||\n\t\t\t\t\tk === 'name' // read-only for built-ins\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( k === 'stack' ) {\n\t\t\t\t\tif ( !isString( value[k] ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\thasStack = true;\n\t\t\t\t}\n\t\t\t\terr[ k ] = value[ k ];\n\t\t\t}\n\t\t\tif ( !hasStack && isString( err.stack ) ) {\n\t\t\t\terr.stack = '';\n\t\t\t}\n\t\t\treturn err;\n\t\t}\n\t}\n\treturn value;\n}\n\n\n// EXPORTS //\n\nmodule.exports = reviveError;\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* Revive a JSON-serialized error object.\n*\n* @module @stdlib/error-reviver\n*\n* @example\n* var parseJSON = require( '@stdlib/utils-parse-json' );\n* var reviver = require( '@stdlib/error-reviver' );\n*\n* var str = '{\"type\":\"TypeError\",\"message\":\"beep\"}';\n* var err = parseJSON( str, reviver );\n* // returns \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,EAAQ,CACX,MAAS,MACT,UAAa,UACb,YAAe,YACf,eAAkB,eAClB,SAAY,SACZ,UAAa,UACb,WAAc,UACf,EAKAD,EAAO,QAAUC,ICnCjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAa,QAAS,oBAAqB,EAC3CC,EAAW,QAAS,0BAA2B,EAAE,YACjDC,EAAQ,IAmBZ,SAASC,EAAaC,EAAKC,EAAQ,CAClC,IAAIC,EACAC,EACAC,EACAC,EACAC,EACA,EACJ,GACCL,GACAA,EAAM,MACNJ,EAAUI,EAAM,OAAQ,IAExBE,EAAOL,EAAOG,EAAM,IAAK,EACpBE,GAAO,CAGX,IAFAE,EAAM,IAAIF,EAAMF,EAAM,OAAQ,EAC9BG,EAAOR,EAAYK,CAAM,EACnB,EAAI,EAAG,EAAIG,EAAK,OAAQ,IAE7B,GADAE,EAAIF,EAAM,CAAE,EAEX,EAAAE,IAAM,QACNA,IAAM,WACNA,IAAM,QAIP,IAAKA,IAAM,QAAU,CACpB,GAAK,CAACT,EAAUI,EAAMK,CAAC,CAAE,EACxB,SAEDJ,EAAW,EACZ,CACAG,EAAKC,CAAE,EAAIL,EAAOK,CAAE,EAErB,MAAK,CAACJ,GAAYL,EAAUQ,EAAI,KAAM,IACrCA,EAAI,MAAQ,IAENA,CACR,CAED,OAAOJ,CACR,CAKAN,EAAO,QAAUI,ICpDjB,IAAIQ,EAAO,IAKX,OAAO,QAAUA", + "names": ["require_ctors", "__commonJSMin", "exports", "module", "CTORS", "require_main", "__commonJSMin", "exports", "module", "objectKeys", "isString", "ctors", "reviveError", "key", "value", "hasStack", "ctor", "keys", "err", "k", "main"] +} diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index bc70143..e91bb91 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 /** * Revives a JSON-serialized error object. diff --git a/package.json b/package.json index 9d037cc..4d6fbe1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stdlib/error-reviver", - "version": "0.0.7", + "version": "0.1.0", "description": "Revive a JSON-serialized error object.", "license": "Apache-2.0", "author": { @@ -37,16 +37,16 @@ "url": "https://github.com/stdlib-js/stdlib/issues" }, "dependencies": { - "@stdlib/assert-is-string": "^0.0.8", - "@stdlib/utils-keys": "^0.0.7" + "@stdlib/assert-is-string": "^0.1.0", + "@stdlib/utils-keys": "^0.1.0" }, "devDependencies": { - "@stdlib/assert-is-function": "^0.0.8", - "@stdlib/assert-is-plain-object": "^0.0.7", - "@stdlib/bench": "^0.0.12", - "@stdlib/error-to-json": "^0.0.7", - "@stdlib/utils-copy": "^0.0.7", - "@stdlib/utils-parse-json": "^0.0.8", + "@stdlib/assert-is-function": "^0.1.0", + "@stdlib/assert-is-plain-object": "^0.1.0", + "@stdlib/bench": "^0.1.0", + "@stdlib/error-to-json": "^0.1.0", + "@stdlib/utils-copy": "^0.1.0", + "@stdlib/utils-parse-json": "^0.1.0", "tape": "git+https://github.com/kgryte/tape.git#fix/globby", "istanbul": "^0.4.1", "tap-min": "git+https://github.com/Planeshifter/tap-min.git"