Back to Top

libraries > Utils.js

Utils

Miscellaneous utils for Mesa scripts

removeKeysPrefix(payload, prefix)

Remove prefix from keys

Parameters

Name Type Description
payload Object
prefix string

Returns

Object

wrapOutput(payload, key)

Wrap output with a parent key

Parameters

Name Type Description
payload Object
key string

Returns

Object

dateIsBeforeOffset(date, syncDelayMs)

Check date vs current time with an offset applied

Parameters

Name Type Description
date Object
syncDelayMs int

Returns

Object

removeNullEntries(payload)

Remove payload entries with null values

Parameters

Name Type Description
payload

Returns

Object