Function setValueAtLocator

  • Sets value within a given object at the position specified by locator. Locator may only contain "object property" and "array index" items.

    Example:

    setValueAtLocator({'name': 'John'}, '$.lastName', 'Doe') == {'name': 'John', 'lastName': 'Doe'}
    

    More examples in tests.

    Parameters

    • obj: any
    • locator: string
    • value: any

    Returns any