Skip to content

Check

Runtime type checking utilities.

7 modules

ModuleDescription
Is ArrayCheck if a value is an array
Is EmptyCheck if a value is empty
Is NullCheck if a value is null/None
Is NumberCheck if a value is a number
Is ObjectCheck if a value is an object
Is StringCheck if a value is a string
Type OfGet the type of a value

Modules

Is Array

check.is_array

Check if a value is an array

Parameters:

NameTypeRequiredDefaultDescription
valueanyYes-Value to check

Output:

FieldTypeDescription
is_arraybooleanValue to check
lengthnumberWhether value is an array

Is Empty

check.is_empty

Check if a value is empty

Parameters:

NameTypeRequiredDefaultDescription
valueanyYes-Value to check
trim_stringsbooleanNoTrueValue to check

Output:

FieldTypeDescription
is_emptybooleanTreat whitespace-only strings as empty
typestringWhether value is empty

Is Null

check.is_null

Check if a value is null/None

Parameters:

NameTypeRequiredDefaultDescription
valueanyNo-Value to check

Output:

FieldTypeDescription
is_nullbooleanValue to check

Is Number

check.is_number

Check if a value is a number

Parameters:

NameTypeRequiredDefaultDescription
valueanyYes-Value to check
parse_stringbooleanNoFalseValue to check
integer_onlybooleanNoFalseConsider numeric strings as numbers

Output:

FieldTypeDescription
is_numberbooleanOnly accept integers
is_integerbooleanWhether value is a number
is_floatbooleanWhether value is a number

Is Object

check.is_object

Check if a value is an object

Parameters:

NameTypeRequiredDefaultDescription
valueanyYes-Value to check

Output:

FieldTypeDescription
is_objectbooleanValue to check
keysarrayWhether value is an object

Is String

check.is_string

Check if a value is a string

Parameters:

NameTypeRequiredDefaultDescription
valueanyYes-Value to check

Output:

FieldTypeDescription
is_stringbooleanValue to check
lengthnumberWhether value is a string

Type Of

check.type_of

Get the type of a value

Parameters:

NameTypeRequiredDefaultDescription
valueanyNo-Value to check

Output:

FieldTypeDescription
typestringValue to check
is_primitivebooleanType name

Released under the Apache 2.0 License.