Skip to content

Commit

Permalink
fix(core): fixed typing in core utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcourtice committed Mar 23, 2021
1 parent 4345a65 commit 7073fc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/utilities.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export function lockObject<T extends object>(input: T, exclusions: (keyof T)[]): T {
return new Proxy(input, {
get(target, prop: keyof T) {
if (exclusions.includes(prop)) {
throw new Error(`Access to property '${prop}' is denied`);
get(target, prop) {
if (exclusions.includes(prop as keyof T)) {
throw new Error(`Access to property '${prop as string}' is denied`);
}

const value = target[prop];
const value = target[prop as keyof T];

if (typeof value === 'function') {
return (...args: any[]) => Reflect.apply(value, target, args);
Expand Down

1 comment on commit 7073fc1

@vercel
Copy link

@vercel vercel bot commented on 7073fc1 Mar 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.