compileJSONPaths
Stentor API Reference / stentor-utils/src / compileJSONPaths
Function: compileJSONPaths()
Call Signatureβ
compileJSONPaths(
responseOutput,object,replaceWhenUndefined?):string
Defined in: packages/stentor-utils/src/compilers/compileJSONPaths.ts:37
Compiles all instances of a template with the provided string by looking up the JSON path within the provided object.
For example, when passed "${greeting} ${foo.name}, how are you?" and { greeting: "Hello", foo: {name: "Bob" }} will be compiled to "Hello Bob, how are you?"
Parametersβ
responseOutputβ
string
objectβ
object
replaceWhenUndefined?β
boolean
Returnsβ
string
Deprecatedβ
Use class Compiler, which handles both JSONPaths & Slots
Call Signatureβ
compileJSONPaths(
responseOutput,object,replaceWhenUndefined?):ResponseOutput
Defined in: packages/stentor-utils/src/compilers/compileJSONPaths.ts:38
Compiles all instances of a template with the provided string by looking up the JSON path within the provided object.
For example, when passed "${greeting} ${foo.name}, how are you?" and { greeting: "Hello", foo: {name: "Bob" }} will be compiled to "Hello Bob, how are you?"
Parametersβ
responseOutputβ
objectβ
object
replaceWhenUndefined?β
boolean
Returnsβ
Deprecatedβ
Use class Compiler, which handles both JSONPaths & Slots