Skip to content

JSONPath Tools / @jsonpath-tools/jsonpath / replaceAtPaths

Function: replaceAtPaths()

ts
function replaceAtPaths(
   value, 
   paths, 
   replacer): JSONValue | undefined;

Replaces JSON values at the given normalized paths.

Parameters

value

JSONValue

JSON value.

paths

readonly NormalizedPath[]

Normalized paths.

replacer

(value) => JSONValue | undefined

JSON value that should be used as a replacement or a function to create that value based on the replaced value.

Returns

JSONValue | undefined