Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
variable overwriteReadonlyProp
import { overwriteReadonlyProp } from "https://deno.land/x/tsafe@v1.6.6/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]