Skip to content

Commit 8eded61

Browse files
committed
changes style prop to Partial<StyleProps>
for better forward compatibility support when we add new properties with safe default values
1 parent 917fd44 commit 8eded61

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"rollup-jest": "^3.1.0",
8686
"storybook": "^8.3.3",
8787
"ts-jest": "29.1.2",
88-
"typescript": "5.5.4"
88+
"typescript": "5.6.3"
8989
},
9090
"files": [
9191
"dist"

src/DataRenderer.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ export interface ExpandableRenderProps extends CommonRenderProps {
4545
}
4646

4747
function quoteString(value: string, quoted = false) {
48-
if (!value || quoted) {
49-
return `"${value}"`;
50-
}
51-
52-
return value;
48+
return !value || quoted ? `"${value}"` : value;
5349
}
5450

5551
function ExpandableObject({

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import styles from './styles.module.css';
44

55
export interface Props extends React.AriaAttributes {
66
data: Object | Array<any>;
7-
style?: StyleProps;
7+
style?: Partial<StyleProps>;
88
shouldExpandNode?: (level: number, value: any, field?: string) => boolean;
99
clickToExpandNode?: boolean;
1010
}
@@ -68,7 +68,7 @@ export const JsonView = ({
6868
>
6969
<DataRender
7070
value={data}
71-
style={style}
71+
style={{ ...defaultStyles, ...style }}
7272
lastElement
7373
level={0}
7474
shouldExpandNode={shouldExpandNode}

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10680,7 +10680,7 @@ __metadata:
1068010680
rollup-jest: ^3.1.0
1068110681
storybook: ^8.3.3
1068210682
ts-jest: 29.1.2
10683-
typescript: 5.5.4
10683+
typescript: 5.6.3
1068410684
peerDependencies:
1068510685
react: ^18.0.0
1068610686
languageName: unknown
@@ -12325,13 +12325,13 @@ __metadata:
1232512325
languageName: node
1232612326
linkType: hard
1232712327

12328-
"typescript@npm:5.5.4":
12329-
version: 5.5.4
12330-
resolution: "typescript@npm:5.5.4"
12328+
"typescript@npm:5.6.3":
12329+
version: 5.6.3
12330+
resolution: "typescript@npm:5.6.3"
1233112331
bin:
1233212332
tsc: bin/tsc
1233312333
tsserver: bin/tsserver
12334-
checksum: b309040f3a1cd91c68a5a58af6b9fdd4e849b8c42d837b2c2e73f9a4f96a98c4f1ed398a9aab576ee0a4748f5690cf594e6b99dbe61de7839da748c41e6d6ca8
12334+
checksum: ba302f8822777ebefb28b554105f3e074466b671e7444ec6b75dadc008a62f46f373d9e57ceced1c433756d06c8b7dc569a7eefdf3a9573122a49205ff99021a
1233512335
languageName: node
1233612336
linkType: hard
1233712337

@@ -12345,13 +12345,13 @@ __metadata:
1234512345
languageName: node
1234612346
linkType: hard
1234712347

12348-
"typescript@patch:typescript@5.5.4#~builtin<compat/typescript>":
12349-
version: 5.5.4
12350-
resolution: "typescript@patch:typescript@npm%3A5.5.4#~builtin<compat/typescript>::version=5.5.4&hash=f3b441"
12348+
"typescript@patch:typescript@5.6.3#~builtin<compat/typescript>":
12349+
version: 5.6.3
12350+
resolution: "typescript@patch:typescript@npm%3A5.6.3#~builtin<compat/typescript>::version=5.6.3&hash=f3b441"
1235112351
bin:
1235212352
tsc: bin/tsc
1235312353
tsserver: bin/tsserver
12354-
checksum: fc52962f31a5bcb716d4213bef516885e4f01f30cea797a831205fc9ef12b405a40561c40eae3127ab85ba1548e7df49df2bcdee6b84a94bfbe3a0d7eff16b14
12354+
checksum: ade87bce2363ee963eed0e4ca8a312ea02c81873ebd53609bc3f6dc0a57f6e61ad7e3fb8cbb7f7ab8b5081cbee801b023f7c4823ee70b1c447eae050e6c7622b
1235512355
languageName: node
1235612356
linkType: hard
1235712357

0 commit comments

Comments
 (0)