chore: fix lint issues

This commit is contained in:
chenjiahan
2020-08-21 17:45:51 +08:00
parent 9754a80597
commit 58650aeb9b
9 changed files with 345 additions and 248 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ function assignKey(to: ObjectIndex, from: ObjectIndex, key: string) {
if (!hasOwnProperty.call(to, key) || !isObject(val)) {
to[key] = val;
} else {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
// eslint-disable-next-line no-use-before-define
to[key] = deepAssign(Object(to[key]), from[key]);
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
import { deepAssign } from './deep-assign';
export function deepClone(obj: object): object {
export function deepClone(obj: Record<string, any>): Record<string, any> {
if (Array.isArray(obj)) {
return obj.map((item) => deepClone(item));
}
+2 -1
View File
@@ -4,12 +4,13 @@ export { createNamespace } from './create';
// eslint-disable-next-line @typescript-eslint/no-empty-function
export function noop() {}
export const inBrowser = typeof window !== 'undefined'
export const inBrowser = typeof window !== 'undefined';
export function isDef(val: unknown): boolean {
return val !== undefined && val !== null;
}
// eslint-disable-next-line @typescript-eslint/ban-types
export function isFunction(val: unknown): val is Function {
return typeof val === 'function';
}