Cleans a boolean. The strings 'false', '0', 'no' and 'off' (case insensitive) cast to false.
Value to clean
Value converted to boolean
Cleans a string representing a HTML color.
Accept only colors that can be used in HTML input[type=color]
fields: #[A-Fa-f0-9]{6}
(a subset of valid CSS colors)
Value to clean
Cleaned color or null
Cleans a string representing a day in format YYYY(-)MM(-)DD
.
Value to clean
Valid day in the YYYY-MM-DD
format (dashes added if absent) or null
Cleans a string representing an email address.
Value to clean
Cleaned email address or null
Cleans a string representing a floating point number. Invalid values are converted to 0.
Value to clean
Floating point number
Cleans a string representing an integer. Invalid values are converted to 0.
Value to clean
Integer number
Cleans a string representing a MongoDB ObjectId.
Value to clean
Valid MongoDB ObjectId or null
Cleans a password so it matches requirements.
Unicode characters in passwords are not allowed, as there could be problems with homographs, different encodings, etc; a discussion on why can be read here: http://unicode.org/pipermail/unicode/2015-October/002883.html
Value to clean
Cleaned, valid password or null
Cleans a string:
Value to clean
Dictionary with options
Cleaned string
Cleans a time and date representation, either a UNIX timestamp or a ISO 8601 full date.
The optional parameter timezone is used as default value when passing a ISO 8601-formatted string that does not include a TZ specifier. If not specified, it will default to the system's timezone
Value to clean, either a UNIX timestamp or a ISO 8601 full date
Optional timezone for ISO 8601-formatted strings that don't include a TZ specifier; if empty, uses system default.
Valid Date object or null
Cleans a string representing a timezone identifier, according to the "tz database".
Value to clean
Valid string representing a timezone identifier or null
Clean a string representing a valid HTTP or HTTPS URL.
Value to clean
Valid string representing a HTTP/S URL or null
Generated using TypeDoc
Input cleanup utilities