only prefix arrays

This commit is contained in:
r00gm 2024-11-12 16:26:33 +01:00
parent 20cd0ebefb
commit 85fb7584d0
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View file

@ -894,7 +894,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
<div <div
class="pill" class="pill"
data-depth="1" data-depth="1"
data-name="0[test]" data-name="test"
data-nest-level="3" data-nest-level="3"
data-node-type="n8n-nodes-base.set" data-node-type="n8n-nodes-base.set"
data-path="['hello world'][0].test" data-path="['hello world'][0].test"
@ -932,7 +932,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
<span> <span>
<!--v-if--> <!--v-if-->
0[test] test
</span> </span>
</span> </span>
@ -963,7 +963,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
<div <div
class="pill" class="pill"
data-depth="1" data-depth="1"
data-name="test[more to think about]" data-name="more to think about"
data-nest-level="4" data-nest-level="4"
data-node-type="n8n-nodes-base.set" data-node-type="n8n-nodes-base.set"
data-path="['hello world'][0].test['more to think about']" data-path="['hello world'][0].test['more to think about']"
@ -1001,7 +1001,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
<span> <span>
<!--v-if--> <!--v-if-->
test[more to think about] more to think about
</span> </span>
</span> </span>
@ -1037,7 +1037,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
<div <div
class="pill" class="pill"
data-depth="1" data-depth="1"
data-name="0[test.how]" data-name="test.how"
data-nest-level="3" data-nest-level="3"
data-node-type="n8n-nodes-base.set" data-node-type="n8n-nodes-base.set"
data-path="['hello world'][0]['test.how']" data-path="['hello world'][0]['test.how']"
@ -1075,7 +1075,7 @@ exports[`RunDataSchema.vue > renders schema with spaces and dots 1`] = `
<span> <span>
<!--v-if--> <!--v-if-->
0[test.how] test.how
</span> </span>
</span> </span>

View file

@ -297,7 +297,7 @@ export const useFlattenSchema = () => {
return items.concat( return items.concat(
schema.value schema.value
.map((item) => { .map((item) => {
const itemPrefix = ['array', 'object'].includes(schema.type) ? schema.key : ''; const itemPrefix = schema.type === 'array' ? schema.key : '';
return flattenSchema({ return flattenSchema({
schema: item, schema: item,
node, node,