Skip to main content
Go to Latest
variable overwriteReadonlyProp
import { overwriteReadonlyProp } from "https://deno.land/x/tsafe@v1.3.0/lab/overwriteReadonlyProp.ts";

Assign a value to a property even if the object is freezed or if the property is not writable Throw if the assignation fail ( for example if the property is non configurable write: false )

type

<T extends { [key: string]: any; }, K extends keyof T>(
obj: T,
propertyName: K,
value: T[K],
) => T[K]