@rbxts/set-nested
v1.0.0
Published
change.
Readme
@rbxts/set-nested ✨
A type safe function that accepts an object, a path, and a value to
change.
Immutably changes the value and returns a new object.
const a = {
b: {
c: {
d: 3,
}
}
}
// remap
Remap.set(
a,
"b",
Remap.set(
a.b,
"c",
Remap.set(
a.b.c,
"d",
5
)
)
)
// setNested
setNested(a, "b", "c", "d", 5); // fully type safe !!