The StringFilter class will ensure that the value given is a string.

Extends AbstractFilter

Methods

sanitize (value)

Inherited from AbstractFilter but overwritten in lib/filter/string.js:23

The sanitize method will cast the value to a string.

Parameters

Name Type Description
value * The value to sanitize

Returned Value

String: The sanitized string.


validate (value)

Inherited from AbstractFilter but overwritten in lib/filter/string.js:12

The validate method will check if the value given is a string or not.

Parameters

Name Type Description
value * The value to validate

Returned Value

Boolean: True if the value is a string, false otherwise.