Is it possible to use the simple schema package to validate data that can potentially be multiple types.
For example, if we have an object, and are checking to see if it's an admin by both checking a unique name is apart of the admins, and if there
const user1 = {
name: 'Mr Is Admin',
isAdmin: true }
below is some pseudo code of what I hope it could do
const isAdmin = new SimpleSchema({
isAdmin: array, boolean
code: {
type: [] || boolean
}
};
The reason I'm asking about it specifically supporting multiple types is that the application I'm working on has users cast votes in a meeting, and they can respond in multiple ways depending on the type of question
interface MeetingQuestionVoteUpdate {
vote?: boolean | [] | null;
}
Essentially. Would I be able to use simpl-schema to validate votes, given it could be different types?