Closed kungfooman closed 9 months ago
I'm running into an issue in transformers.js with validateType, because there are multiple ways to make an "object":
validateType
const value = Object.create(null); validateType(value, {type: 'object', optional: true}, "loc", "name", true);
So far I can't find a good way to represent Object.create(null) as type... but replacing value instanceof Object with typeof value === 'object' should work anyway.
Object.create(null)
value instanceof Object
typeof value === 'object'
I also need to add some tests for this.
TS Playground
I'm running into an issue in transformers.js with
validateType
, because there are multiple ways to make an "object":So far I can't find a good way to represent
Object.create(null)
as type... but replacingvalue instanceof Object
withtypeof value === 'object'
should work anyway.I also need to add some tests for this.
TS Playground