1.0.1 • Published 6 years ago
set-in-ts v1.0.1
set-in-ts
Type-safe setIn
implementation to write nested fields. Returns undefined
if undefined
or null
is encountered when traversing path.
import { setIn } from 'set-in-ts';
setIn({ x: { y: { z: 1 } } }, ['x', 'y', 'z'], 2); // === {x: { y: { z: 2 } } }