I am working with a type that can accept either a string or a number as options, defined like this:
type Result = string | number
type ValueData = {
data: Result
}
const valueDataSchema = new mongoose.Schema({
data: {
type: Result
}
});
My question is, is this implementation legal?