From 020cdff7d5bfea2c461a6203de423a69f062653a Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 4 Aug 2024 19:51:49 -0400 Subject: [PATCH] map2tree --- packages/map2tree/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/map2tree/src/index.ts b/packages/map2tree/src/index.ts index 322379e5..53338110 100644 --- a/packages/map2tree/src/index.ts +++ b/packages/map2tree/src/index.ts @@ -45,9 +45,9 @@ export function map2tree( root: unknown, options: { key?: string; pushMethod?: 'push' | 'unshift' } = {}, tree: Node = { name: options.key || 'state', children: [] }, - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type ): Node | {} { - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type if (!isPlainObject(root) && root && !(root as { toJS: () => {} }).toJS) { return {}; } @@ -60,13 +60,13 @@ export function map2tree( } mapValues( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type root && (root as { toJS: () => {} }).toJS - ? // eslint-disable-next-line @typescript-eslint/ban-types + ? // eslint-disable-next-line @typescript-eslint/no-empty-object-type (root as { toJS: () => {} }).toJS() - : // eslint-disable-next-line @typescript-eslint/ban-types + : // eslint-disable-next-line @typescript-eslint/no-empty-object-type (root as {}), - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-empty-object-type (maybeImmutable: { toJS?: () => {} }, key) => { const value = maybeImmutable && maybeImmutable.toJS