sindresorhus

ensure-error

Ensures a value is a valid error by making it one if not

by sindresorhus

JavaScript

JavaScript94.4%
TypeScript5.6%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
71
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template
gmaclennan

This is a really useful module, it would be great to use it in browser/react-native code also. This PR switches to use the module for generating the error message on non-error objects, instead of Node's . Behaviour should be pretty similar, if not exactly the same for most cases. The impact of any changes would be a difference in the contents of when calling on a non-error object. The tests were not passing when running with Node v20.19.4, due to a bug in , which I assume is due to the node version. Updating to latest fixes this. I also updated and to the latest versions, and updated the github action to test on the current supported versions of Node. Also updates github action steps to latest versions.

gmaclennan · 1y ago
sindresorhus

https://github.com/tc39/proposal-error-cause We should ensure it exists.

sindresorhus · 1y ago
Structured data for AI agents

Repository: sindresorhus/ensure-error. Description: Ensures a value is a valid error by making it one if not Stars: 95, Forks: 4. Primary language: JavaScript. Languages: JavaScript (94.4%), TypeScript (5.6%). License: MIT. Latest release: v5.0.0 (1y ago). Open PRs: 0, open issues: 0. Last activity: 1y ago. Community health: 71%. Top contributors: sindresorhus, papb, BendingBender, Richienb.