• Removes a prefix from an id string if present. Useful for normalizing ids that may have parent or namespace prefixes.

    Parameters

    • id: string

      The id string to process

    • prefix: string = "parent-"

      The prefix to remove (defaults to "parent-")

    Returns string

    The id with the prefix removed, or the original id if prefix not found

    Example

    processId("parent-123") // returns "123"
    processId("parent-abc", "parent-") // returns "abc"
    processId("child-456", "parent-") // returns "child-456"