You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to check if a target is string | undefined?
I have the current structure:
// value := [string, string, string?]check(value,'value').exists();check(value,'value').is.an.array();check(value.length,'value').is.not.empty();check(value[0],'value[0]').exists();check(value[0],'value[0]').is.a.string();check(value[1],'value[1]').exists();check(value[1],'value[1]').is.a.string();// Maybe with .optional ?check(value[2],'value[2]').is.optional.a.string();
Currently when I use check(value[2], 'value[2]').is.a.string();
I get Check failed: value[2] (undefined) was not a String,
but I want to check if it is a string or undefined
The text was updated successfully, but these errors were encountered:
Is there a way to check if a
target
isstring | undefined
?I have the current structure:
Currently when I use
check(value[2], 'value[2]').is.a.string();
I get
Check failed: value[2] (undefined) was not a String
,but I want to check if it is a
string
orundefined
The text was updated successfully, but these errors were encountered: