Skip to content

Commit 5fc2705

Browse files
committed
convert items to be an object
1 parent 3c95ebb commit 5fc2705

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Convertor.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ class Convertor {
9393
}
9494
}
9595

96+
const convertItemArrays = () => {
97+
if (Array.isArray(schema.items)) {
98+
const obj = {}
99+
for (const item of schema.items) {
100+
Object.assign(obj, item)
101+
}
102+
schema.items = obj
103+
}
104+
}
105+
96106
const convertDefaultValues = () => {
97107
if (schema.type === 'boolean') {
98108
if (schema.default === 'true' || schema.default === 'false') {
@@ -139,6 +149,7 @@ class Convertor {
139149

140150
convertNull()
141151
convertTypeArrays()
152+
convertItemArrays()
142153
bannedWordsRemoval()
143154
convertDefaultValues()
144155
defaultValuesForOfProperties()

0 commit comments

Comments
 (0)