From 2ac01fc54e534dde4787d47f3e6a3012a26d3588 Mon Sep 17 00:00:00 2001 From: Shashik Date: Thu, 28 Oct 2021 11:24:29 +0530 Subject: [PATCH] Add Reflect.ownKeys return type miss match issue --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 79cf695..a53592b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -180,7 +180,9 @@ export class Sakota implements ProxyHandler { * Proxy handler trap for `Reflect.ownKeys()`. */ public ownKeys(obj: any): (string | symbol)[] { - const keys = Reflect.ownKeys(obj); + // FIXME: need to figure out why this return (string | number | symbol)[] + // which is not the same as the return type of ES2015 Reflect.ownKeys. + const keys = Reflect.ownKeys(obj) as (string | symbol)[]; if (this.diff) { for (const key in this.diff.$set) { if (!Object.prototype.hasOwnProperty.call(this.diff.$set, key)) {