Skip to content

Commit

Permalink
Add Reflect.ownKeys return type miss match issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shashik-edgz committed Oct 28, 2021
1 parent 94860f0 commit 2ac01fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ export class Sakota<T extends object> implements ProxyHandler<T> {
* 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)) {
Expand Down

0 comments on commit 2ac01fc

Please sign in to comment.