Utility class containing various static methods for common operations.

Constructors

Methods

  • Retrieves the value from an object using a case-insensitive key lookup.

    Parameters

    • obj: any

      The object to search for the key.

    • key: string

      The key to search for in the object.

    Returns any

    The value associated with the key, or null if the key is not found.

  • Cleans out the /tmp directory asynchronously.

    Returns Promise<void>

  • Marshalls the given item into a DynamoDB format. If the item is an array, it maps over each element and marshalls it recursively. If the item is an object, it marshalls the object using the marshall function with options to remove undefined values and convert class instances to maps. If the item is neither an array nor an object, it converts the item to an attribute.

    Type Parameters

    • T

    Parameters

    • item: T

      The item to be marshalled.

    • Optionalrec: boolean

    Returns any

    The marshalled item in DynamoDB format.

  • Recursively unmarshalls a DynamoDB item by converting it into a plain JavaScript object.

    Parameters

    • item: any

      The DynamoDB item to unmarshall.

    Returns any

    The unmarshalled JavaScript object.

  • Checks if the application is running in a hybridless container.

    Returns boolean

    • True if the application is running in a hybridless container, false otherwise.
  • Checks if a given value is a valid number.

    Parameters

    • number: string

      The value to be checked.

    Returns boolean

    • True if the value is a valid number, false otherwise.
  • Checks if a given string is valid.

    Parameters

    • string: string

      The string to check.

    Returns boolean

    • True if the string is valid, false otherwise.
  • Parses a string into an integer and returns null if the string is not a valid number.

    Parameters

    • Optionalstr: string

      The string to parse into an integer.

    Returns null | number

    • The parsed integer or null if the string is not a valid number.
  • Parses a JSON string and returns the resulting object. If the string is empty or cannot be parsed, null is returned.

    Parameters

    • string: undefined | string

      The JSON string to parse.

    Returns any

    • The parsed object or null if the string is empty or invalid.