@mintlify/common 1.0.362 → 1.0.363

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -203,6 +203,21 @@ const genericStringRegex = /^(\w+)<(.*)>$/;
203
203
  export const parseTypeString = (typeString) => {
204
204
  const lowerTypeString = typeString.toLowerCase();
205
205
  const simpleSchemaType = typeStringToSchemaType[lowerTypeString];
206
+ if (lowerTypeString.includes('|')) {
207
+ const [left, right] = lowerTypeString.split('|');
208
+ if (left && right) {
209
+ const leftSchema = parseTypeString(left.trim());
210
+ const rightSchema = parseTypeString(right.trim());
211
+ if (leftSchema.schema.type === 'array' &&
212
+ rightSchema.schema.type === leftSchema.deepestSchema.type) {
213
+ return Object.assign({}, leftSchema);
214
+ }
215
+ if (rightSchema.schema.type === 'array' &&
216
+ leftSchema.schema.type === rightSchema.deepestSchema.type) {
217
+ return Object.assign({}, rightSchema);
218
+ }
219
+ }
220
+ }
206
221
  // catch all standard type strings
207
222
  if (simpleSchemaType) {
208
223
  return generateSchemaWithTypeString(simpleSchemaType);