Skip to content

Commit

Permalink
cast to string, as Symbol is not predicted in that usecase
Browse files Browse the repository at this point in the history
  • Loading branch information
Siemienik committed Nov 20, 2023
1 parent 65c4f95 commit d821a8b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/xlsx-renderer/src/ViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@ export const createVmProxyHandler = ()=> {

return {
get(target: any, p: PropertyKey): any {
if (typeof p !== 'string' && typeof p !== 'number') {
return;
}
return p in data ? data[p] : target[p]
return p in data ? data[p as string] : target[p]
},
set(target: unknown, p: PropertyKey, value: unknown): boolean {
if (typeof p !== 'string' && typeof p !== 'number') {
return false;
}
data[p] = value
set(target: any, p: PropertyKey, value: unknown): boolean {
data[p as string] = value

return true
},
Expand Down

0 comments on commit d821a8b

Please sign in to comment.