Check if a field (/variable) is empty or invalid, based on its type.
If the type isn't passed as a parameter, it will be auto-detected.
A field is "empty" when it carries no usable value; the check is intentionally
fail-closed: when in doubt (wrong runtime type, unexpected exception) it returns true.
The supported fieldType values:
string: not a string, or only whitespace.
number: not a finite number (NaN/±Infinity/non-numbers included), or 0.
positiveNumber: not a finite number, or <= 0.
integer: not an integer, or 0.
positiveInteger: not an integer, or <= 0.
boolean: not a boolean — both true and false are valid, non-empty values.
object: an empty array/Set/plain object, or an invalid Date.
date: not a strict, calendar-valid YYYY-MM-DD string (see ISODateString).
datetime: not a complete ISO 8601 date-time string (see ISOString); a date-only
string such as 2026-05-22 is considered empty here — use date for that.
email / phone / url / domain: not a string, or not valid for the format.
Check if a field (/variable) is empty or invalid, based on its type. If the type isn't passed as a parameter, it will be auto-detected.
A field is "empty" when it carries no usable value; the check is intentionally fail-closed: when in doubt (wrong runtime type, unexpected exception) it returns
true. The supportedfieldTypevalues:string: not a string, or only whitespace.number: not a finite number (NaN/±Infinity/non-numbers included), or0.positiveNumber: not a finite number, or<= 0.integer: not an integer, or0.positiveInteger: not an integer, or<= 0.boolean: not a boolean — bothtrueandfalseare valid, non-empty values.object: an empty array/Set/plain object, or an invalidDate.date: not a strict, calendar-validYYYY-MM-DDstring (seeISODateString).datetime: not a complete ISO 8601 date-time string (seeISOString); a date-only string such as2026-05-22is considered empty here — usedatefor that.email/phone/url/domain: not a string, or not valid for the format.