Skip to content

Commit d6ddbe3

Browse files
committed
Send along options to stringify in tuple schema
1 parent 859ef10 commit d6ddbe3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.changeset/strange-wolves-explain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@compai/css-gui': patch
3+
---
4+
5+
Send along options to stringify in tuple schema

packages/gui/src/components/schemas/tuple.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ export function tupleSchema<T>({
3737
? [itemSchema.defaultValue]
3838
: labels.map(() => itemSchema.defaultValue)
3939

40-
function stringify(value: T[]) {
40+
function stringify(value: T[], ...args: any[]) {
4141
return (
42-
value?.map((item) => itemSchema.stringify(item)).join(separator) ?? null
42+
value
43+
?.map((item) => itemSchema.stringify(item, ...args))
44+
.join(separator) ?? null
4345
)
4446
}
4547

0 commit comments

Comments
 (0)