I need my component to accept both objects and null values, as Vue.js considers null as an object. However, I want the validation to fail if the value is undefined.
Here's what I've attempted using vue-property-decorator:
@Prop({ required: true, type: Object, validator: v => typeof v === 'object' })
@Prop({ required: true, validator: v => typeof v === 'object' })
// This resulted in an error:
//> Expected Object, got Null.
@Prop({ validator: v => typeof v === 'object' })
// Allows undefined values to pass through, rendering the validator ineffective for my needs
Is there a way to allow objects (including null) as a property while ensuring that the developer receives a warning if the value is undefined (such as when the prop is not specified)?