Function normalizePropertyPath

  • Converts a property path to its canonical readonly property-key array representation.

    Dotted strings are split on . while property-key arrays are returned unchanged. Exact array property-keys should be used for symbols, numeric array indexes, empty-string keys, and property names containing literal periods.

    Parameters

    • path: PropertyPath

      Property path to normalize.

    • OptionalerrorMessage: string

      Optional custom error message.

    Returns readonly PropertyKey[]

    The path as a readonly property-key array.

    If path is not a valid PropertyPath.