more lint

This commit is contained in:
Olivier Gagnon
2022-05-25 15:40:57 -04:00
parent c1650e332b
commit ca2e22506b
9 changed files with 26 additions and 23 deletions
+4 -4
View File
@@ -7,10 +7,10 @@
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function clearObject(obj: unknown): void {
if (typeof obj !== "object" || obj === null || obj === undefined) return;
for (const key of Object.getOwnPropertyNames(obj)) {
if (obj.hasOwnProperty(key)) {
// tslint:disable-next-line:no-dynamic-delete
delete (obj as any)[key];
const o = obj as Record<string, unknown>;
for (const key of Object.getOwnPropertyNames(o)) {
if (o.hasOwnProperty(key)) {
delete o[key];
}
}
}