Function isJSONPropertyPath
-
Parameters
- value: unknown
Value to evaluate.
Returns value is JSONPropertyPath
Whether the value is a non-empty property path that can be represented losslessly through ordinary JSON serialization.
- value: unknown
Value to evaluate.
Whether the value is a non-empty property path that can be represented losslessly through ordinary JSON serialization.
Determines whether a value is a JSONPropertyPath.
A JSON property path is either:
Symbol segments are rejected because symbols cannot be represented by JSON. Non-finite numbers are also rejected because
JSON.stringifyconvertsNaN,Infinity, and-Infinitytonull. Sparse arrays are rejected because missing elements are likewise serialized asnull.Numeric values do not need to be integers or valid array indexes. This function validates lossless JSON representation only; array-index constraints remain dependent on the value traversed by a path-aware operation.
-0is accepted because JSON normalizes it to0, which is equivalent under the package's property-key comparison semantics.