Closed adipascu closed 5 years ago
Thank you for the great library! I have a usecase with symbols that is not currently working, here is some sample code:
const ono = require('ono'); const SOME_PROP = Symbol('symbol-name'); // const SOME_PROP = 'string-key'; // (string keys work correctly) function fun() { try { throw new Error('original error'); } catch (e) { throw ono(e, { [SOME_PROP]: true }, 'wrapped with [SOME_PROP]'); } } try { fun(); } catch (e) { console.log(`Has prop: ${e[SOME_PROP] || false}`); }
Good catch! I never even thought about supporting symbol props, but that totally makes sense.
We just released Ono v5.0, which fixes this issue. Thanks for reporting it!
Here are the release notes
Thank you for the great library! I have a usecase with symbols that is not currently working, here is some sample code: