From 85fb7584d0bbb71c47bb6ffb32c4858b8eb3a125 Mon Sep 17 00:00:00 2001 From: r00gm Date: Tue, 12 Nov 2024 16:26:33 +0100 Subject: [PATCH] only prefix arrays --- .../__snapshots__/RunDataSchema.test.ts.snap | 12 ++++++------ packages/editor-ui/src/composables/useDataSchema.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/editor-ui/src/components/__snapshots__/RunDataSchema.test.ts.snap b/packages/editor-ui/src/components/__snapshots__/RunDataSchema.test.ts.snap index 7c0520715b..539a9c7c3a 100644 --- a/packages/editor-ui/src/components/__snapshots__/RunDataSchema.test.ts.snap +++ b/packages/editor-ui/src/components/__snapshots__/RunDataSchema.test.ts.snap @@ -894,7 +894,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
renders schema with spaces and dots 1`] = ` - 0[test] + test @@ -963,7 +963,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
renders schema with spaces and dots 1`] = ` - test[more to think about] + more to think about @@ -1037,7 +1037,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
renders schema with spaces and dots 1`] = ` - 0[test.how] + test.how diff --git a/packages/editor-ui/src/composables/useDataSchema.ts b/packages/editor-ui/src/composables/useDataSchema.ts index 7bc6d19abc..b661c98d87 100644 --- a/packages/editor-ui/src/composables/useDataSchema.ts +++ b/packages/editor-ui/src/composables/useDataSchema.ts @@ -297,7 +297,7 @@ export const useFlattenSchema = () => { return items.concat( schema.value .map((item) => { - const itemPrefix = ['array', 'object'].includes(schema.type) ? schema.key : ''; + const itemPrefix = schema.type === 'array' ? schema.key : ''; return flattenSchema({ schema: item, node,