diff --git a/src/StringFilr.ts b/src/StringFilr.ts index 7a1afb4..699a61b 100644 --- a/src/StringFilr.ts +++ b/src/StringFilr.ts @@ -90,7 +90,7 @@ export class StringFilr implements IStringFilr { public get(keyRaw: string): T | ILibrary { let key: string; - if (this.cache.hasOwnProperty(keyRaw)) { + if ({}.hasOwnProperty.call(this.cache, keyRaw)) { return this.cache[keyRaw]; } @@ -98,7 +98,7 @@ export class StringFilr implements IStringFilr { ? keyRaw.replace(this.normal, "") : keyRaw; - if (this.cache.hasOwnProperty(key)) { + if ({}.hasOwnProperty.call(this.cache, key)) { return this.cache[key]; } @@ -126,7 +126,7 @@ export class StringFilr implements IStringFilr { for (let i = 0; i < keys.length; i += 1) { const key: string = keys[i]; - if (current.hasOwnProperty(key)) { + if ({}.hasOwnProperty.call(current, key)) { keys.splice(i, 1); return this.followClass(keys, (current as ILibrary)[key]); }