Module: utilities

A set of utilities functions.
Version:
  • 1.0.0
Author:
  • Essam A. El-Sherif
Source:

Methods

(static) extractSubobjectByKeys(originalDict, keysList) → {Object}

Extract a sub-Object from the original Object with keys specified in keysList.
Parameters:
Name Type Description
originalDict Object The original Object to extract from.
keysList Array A list of keys to include in the sub-Object.
Source:
Returns:
- A sub-Object containing only the specified keys.
Type
Object

(static) isValidObject(variable, allowedKeys) → {boolean}

Check if the variable is an Object and if all its keys are in the allowed keys.
Parameters:
Name Type Description
variable Object The variable to check.
allowedKeys Array A list of allowed keys.
Source:
Returns:
- True if variable is an Object and all keys are in allowedKeys, false otherwise.
Type
boolean

(static) updateObject(original, updates, excludeKeys)

Update the original Object with values from the updates Object, excluding keys specified in excludeKeys.
Parameters:
Name Type Description
original Object The original Object to update.
updates Object The Object with update values.
excludeKeys Array A list of keys to exclude from updating.
Source: