Skip to content

Commit 334d35b

Browse files
author
Valeriy Borodayev
committed
refactor: fix flow & eslint errors
1 parent d55c59e commit 334d35b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/definitions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @flow
2-
/* eslint-disable no-await-in-loop */
2+
/* eslint-disable no-await-in-loop, max-classes-per-file, import/no-cycle */
33

44
import type { ObjectId, MongooseModel, MongooseDocument } from 'mongoose';
55
import MHD, { revertChanges } from './diff';

src/diff.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ export const deepDiff = (
5858
(stack &&
5959
stack.length > 0 &&
6060
stack[stack.length - 1].lhs &&
61-
Object.getOwnPropertyDescriptor(stack[stack.length - 1].lhs, key));
61+
!!Object.getOwnPropertyDescriptor((stack[stack.length - 1].lhs: any), key));
6262

6363
const rdefined =
6464
!!rhs ||
6565
(stack &&
6666
stack.length > 0 &&
6767
stack[stack.length - 1].rhs &&
68-
Object.getOwnPropertyDescriptor(stack[stack.length - 1].rhs, key));
68+
!!Object.getOwnPropertyDescriptor((stack[stack.length - 1].rhs: any), key));
6969

7070
if (!ldefined && rdefined) {
7171
changes.push({ k: 'N', p: currentPath, r: rhs });

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export const revertArrayChange = (arr: Array<any>, index: number, change: any):
171171
export const deepClone = (obj: any): any => {
172172
if (realTypeOf(obj) === 'object') {
173173
const clone = { ...obj };
174-
// eslint-disable-next-line no-restricted-syntax
174+
// eslint-disable-next-line no-restricted-syntax, no-unused-vars
175175
for (const k in clone) {
176176
if (clone.hasOwnProperty(k)) {
177177
clone[k] = deepClone(clone[k]);

0 commit comments

Comments
 (0)