• JMap.Util.isJMapId

    Validates if the value passed is either a string uuid (for instance, "f3af01ab-4042-4ccf-be04-33dc96228ce7"), or a numeric ID (integer, can be negative) If the allowStringNumber param is true, the string "123" will be considered as a valid numeric ID. allowStringNumber is false by default

    Parameters

    • id: any

      The JMap Id to validate

    • Optional allowStringNumber: boolean

      Optional parameter. false by default.

    Returns boolean

    Example

    JMap.Util.isJMapId(1)
    // true

    JMap.Util.isJMapId("1")
    // false

    JMap.Util.isJMapId("1", true)
    // true

    JMap.Util.isJMapId("f3af01ab-4042-4ccf-be04-33dc96228ce7")
    // true