From 6a8ab006ed5351ecda3ff9ba4ce8d0f004c5c0e2 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Thu, 21 Oct 2021 13:31:09 -0400 Subject: [PATCH] Fix build --- packages/react-base16-styling/src/types.ts | 2 +- .../react-json-tree/src/createStylingFromTheme.ts | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/react-base16-styling/src/types.ts b/packages/react-base16-styling/src/types.ts index 0c221ca1..e4a489ee 100644 --- a/packages/react-base16-styling/src/types.ts +++ b/packages/react-base16-styling/src/types.ts @@ -28,5 +28,5 @@ export type Theme = string | Base16Theme | StylingConfig; export type StylingFunction = ( keys: (string | false | undefined) | (string | false | undefined)[], - ...rest: any[] + ...rest: unknown[] ) => Styling; diff --git a/packages/react-json-tree/src/createStylingFromTheme.ts b/packages/react-json-tree/src/createStylingFromTheme.ts index 46b3119c..492d7fd3 100644 --- a/packages/react-json-tree/src/createStylingFromTheme.ts +++ b/packages/react-json-tree/src/createStylingFromTheme.ts @@ -55,7 +55,7 @@ const getDefaultThemeStyling = (theme: Base16Theme): StylingConfig => { backgroundColor: colors.BACKGROUND_COLOR, }, - value: ({ style }, nodeType, keyPath: (string | number)[]) => ({ + value: ({ style }, nodeType, keyPath) => ({ style: { ...style, paddingTop: '0.25em', @@ -64,7 +64,7 @@ const getDefaultThemeStyling = (theme: Base16Theme): StylingConfig => { WebkitUserSelect: 'text', MozUserSelect: 'text', wordWrap: 'break-word', - paddingLeft: keyPath.length > 1 ? '2.125em' : '1.25em', + paddingLeft: (keyPath as unknown[]).length > 1 ? '2.125em' : '1.25em', textIndent: '-0.5em', wordBreak: 'break-all', }, @@ -136,18 +136,12 @@ const getDefaultThemeStyling = (theme: Base16Theme): StylingConfig => { left: '-0.4em', }, - nestedNode: ( - { style }, - keyPath: (string | number)[], - nodeType, - expanded, - expandable - ) => ({ + nestedNode: ({ style }, keyPath, nodeType, expanded, expandable) => ({ style: { ...style, position: 'relative', paddingTop: '0.25em', - marginLeft: keyPath.length > 1 ? '0.875em' : 0, + marginLeft: (keyPath as unknown[]).length > 1 ? '0.875em' : 0, paddingLeft: !expandable ? '1.125em' : 0, }, }),