keys/required

Checking structs have the right keys

Source:
Since:
  • 0.1.0

Methods

(inner) isKeyPresent(skv_to_check) → {boolean}

Source:

check we have a key in the struct

Parameters:
Name Type Description
skv_to_check struct
Returns:
Type
boolean

(inner) isValidObject(value) → {boolean}

Source:

check we have a valid object

Parameters:
Name Type Description
value anything
Returns:
Type
boolean

(inner) requiredKeys(skv_to_check, arr_required_keys) → {struct}

Source:

If a key isn't present in the struct then return is with a success false

Parameters:
Name Type Description
skv_to_check struct
arr_required_keys array

Array of strings to check

Returns:

In json api format any missing keys

Type
struct