replaceOptionValue()
Popii / replaceOptionValue
Function: replaceOptionValue()
Section titled “Function: replaceOptionValue()”replaceOptionValue(
content,pluginName,optionKey,oldValue,newValue):string
Defined in: migrations.ts:142
Replaces a scalar option value within a named plugin call.
Parameters
Section titled “Parameters”content
Section titled “content”string
pluginName
Section titled “pluginName”string
optionKey
Section titled “optionKey”string
oldValue
Section titled “oldValue”string
newValue
Section titled “newValue”string
Returns
Section titled “Returns”string
Example
Section titled “Example”// Changes `provider: "openai"` to `provider: "anthropic"` in popiiAiPlugin({...})replaceOptionValue(content, "popiiAiPlugin", "provider", '"openai"', '"anthropic"')