UNPKG

@leismore/unknown2error

Version:

The function converts anything into an object of Error (or subclasses) class. If `error` is an object of Error (or subclasses) class, it returns the original `error` object. With any other type, it will convert it into a string first and then an Error obj

40 lines (39 loc) 1.27 kB
{ "name": "@leismore/unknown2error", "version": "1.0.0", "description": "The function converts anything into an object of Error (or subclasses) class. If `error` is an object of Error (or subclasses) class, it returns the original `error` object. With any other type, it will convert it into a string first and then an Error object will be created and returned by using the string as the message parameter.", "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { "test": "mocha ./test/test.ts", "build": "tsc" }, "repository": { "type": "git", "url": "git+https://github.com/leismore/unknown2error-function.git" }, "keywords": [ "TypeScript", "Error", "Unknown" ], "author": { "name": "Kyle Chine", "email": "kyle.chine@leismore.co", "url": "https://kyle-chine.leismore.co" }, "license": "AGPL-3.0-only", "bugs": { "url": "https://github.com/leismore/unknown2error-function/issues" }, "homepage": "https://github.com/leismore/unknown2error-function#readme", "devDependencies": { "@types/chai": "^4.3.0", "@types/mocha": "^9.1.0", "@types/node": "~16.11.26", "chai": "^4.3.6", "mocha": "^9.2.1", "ts-node": "^10.5.0", "typescript": "~4.5.5" } }