From c84b9a3a4e6e1f8f6e617b07fd3dac5df93e30c9 Mon Sep 17 00:00:00 2001 From: Raymond Cook Date: Wed, 5 Feb 2025 10:59:45 -0500 Subject: [PATCH] Add 'writable' descriptor check to isReadOnlyProperty --- src/helpers/isReadOnlyProperty.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/isReadOnlyProperty.ts b/src/helpers/isReadOnlyProperty.ts index 3da59563..a2fcbf39 100644 --- a/src/helpers/isReadOnlyProperty.ts +++ b/src/helpers/isReadOnlyProperty.ts @@ -6,5 +6,5 @@ export function isReadOnlyProperty( const prototype = Object.getPrototypeOf(objectInstance); const propertyDescriptor = Object.getOwnPropertyDescriptor(prototype, propertyKey); - return !(typeof propertyDescriptor === 'undefined' || propertyDescriptor.set); + return !(typeof propertyDescriptor === 'undefined' || propertyDescriptor.writable || propertyDescriptor.set); }