GitShow/sindresorhus/ensure-error
sindresorhus

ensure-error

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

by sindresorhus
Star on GitHubForknpm

JavaScript

93 stars4 forks4 contributorsQuiet · 9mo agoSince 2017v5.0.0MIT

Meet the team

See all 4 on GitHub →
sindresorhus
sindresorhus17 contributions
papb
papb2 contributions
BendingBender
BendingBender1 contribution
Richienb
Richienb1 contribution

Languages

View on GitHub →
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

Recent fixes

View closed PRs →
gmaclennan
feat: add browser support via object-inspectMergedPR

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 · 9mo ago
sindresorhus
Support `.cause` propertyClosedIssue

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

sindresorhus · 9mo ago
Richienb
Move to GitHub ActionsMergedPR
Richienb · 5y 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: 93, Forks: 4. Primary language: JavaScript. Languages: JavaScript (94.4%), TypeScript (5.6%). License: MIT. Latest release: v5.0.0 (9mo ago). Open PRs: 0, open issues: 0. Last activity: 9mo ago. Community health: 71%. Top contributors: sindresorhus, papb, BendingBender, Richienb.

·@ofershap

Replace github.com with gitshow.dev