Skip to main content

Function: setDottedValue()

function setDottedValue(
input,
path,
value): GatewayJsonObject;

Defined in: src/ai-gateway/nested-values.ts:228

Return an immutable JSON clone with one dotted-path value set or replaced.

Parameters​

ParameterType
inputGatewayJsonObject
pathstring
valueGatewayJsonValue

Returns​

GatewayJsonObject

Example​

import { setDottedValue } from '@cdot65/prisma-airs-sdk';

const original = { retry: { attempts: 2 } };
const updated = setDottedValue(original, 'retry.attempts', 5);
// original.retry.attempts === 2; updated.retry.attempts === 5