vue-styleguidist
vue-styleguidist copied to clipboard
vue-docgen-api: Arrays and objects not detected when TypeScript type assertion is used; arrow function unwrapping breaks
Current behavior
If you define a prop as:
foo: {
type: Array,
default: () => []
}
then the arrow function is unwrapped, and the default value is returned as []
.
But if you define a prop as:
foo: {
type: Array as PropType<SomeType[]>,
default: () => []
}
then the arrow function is not unwrapped, and the default value is returned as () => []
.
Expected behavior
Arrow functions should be unwrapped even if the type isn't a simple type: Array
or type: Object
, as long as the underlying type is an array or object (i.e. type: Array as PropType<Something>
or type: Object as PropType<Something>
).
Thank you for reporting this @catrope I will. get on it ASAP