Text
Modify
ReplaceMultipleStrings

Name

replaceMultipleStrings

Description

Takes an object (strings) and a modifier and replaces the string placeholders $(...)$ according to the key in the strings object.

Example

index.ts

import { replaceString } from '@aigur/client';
//...
flow.node(replaceString, () => ({
strings: {
name: 'John',
age: 90
}
modifier: 'Hello $(name)$, happy $(age)$th birthday',
})) // --> {text: 'Hello John, happy 90th birthday'}

Input

Property Type Required Description Default Value
strings object (Record<string, string>) Yes The strings to be incorporated into the Modifier.
modifier string Yes A string that includes the substring $(key)$. The node will replace the substring with the value of the corresponding key in the strings object.

Output

Property Type
text string