@threadplane/a2uiFunctionv0.3.4

deleteByPointer

Returns a new model with the key at pointer removed.

Empty string and / clear the whole model. Missing parent paths leave the input model unchanged.

import { deleteByPointer } from '@threadplane/a2ui';

Declaration · overload 1

export declare function deleteByPointer(model: Record<string, unknown>, pointer: string): Record<string, unknown>;

Parameters

model · required
Record<string, unknown>
pointer · required
string

Returns

Record<string, unknown>

Examples

const next = deleteByPointer({ user: { name: 'Ada' } }, '/user/name');