Function castValueToType

  • Casts value to type

    Parameters

    • value: string

      String value to cast

    • type: TypeOfValidTypes

      Type to cast to as string of 'number', 'boolean', 'object', 'string', 'null', 'delete', 'undefined'

    • suppressExceptions: boolean = false

      If true, do not throw exceptions, just return value as string Example: castValueToType('1', 'number'); // returns 1

    Returns ValidTypes