@mintlify/common 1.0.861 → 1.0.862

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.
@@ -10,7 +10,7 @@ function isElement(node, key = 'type', element = 'element') {
10
10
  }
11
11
  function addCodeBlocks(tree) {
12
12
  visit(tree, (node, i, parent) => {
13
- var _a, _b;
13
+ var _a, _b, _c;
14
14
  if (parent == null || i == null || !isElement(node) || !isElement(node, 'tagName', 'pre')) {
15
15
  return;
16
16
  }
@@ -19,16 +19,18 @@ function addCodeBlocks(tree) {
19
19
  return;
20
20
  const isFlowElement = isElement(parent, 'type', flowElementType);
21
21
  const parentName = isFlowElement ? parent.name : undefined;
22
- let properties = code.type === 'element' ? Object.entries(code.properties) : [];
22
+ let properties = Object.entries(code.properties);
23
23
  let meta;
24
24
  if (parentName && exampleNames.includes(parentName)) {
25
25
  const parentType = parentName.slice(0, -7);
26
26
  meta = parseMetaString(parentType);
27
27
  if (!((_a = code.data) === null || _a === void 0 ? void 0 : _a.meta)) {
28
- code.data = Object.assign(Object.assign({}, code.data), { meta: i === 0 ? parentType : `${parentType} ${i + 1}` });
28
+ const data = (_b = code.data) !== null && _b !== void 0 ? _b : {};
29
+ data.meta = i === 0 ? parentType : `${parentType} ${i + 1}`;
30
+ code.data = data;
29
31
  }
30
32
  }
31
- if (((_b = code.data) === null || _b === void 0 ? void 0 : _b.meta) && typeof code.data.meta === 'string') {
33
+ if (((_c = code.data) === null || _c === void 0 ? void 0 : _c.meta) && typeof code.data.meta === 'string') {
32
34
  meta = parseMetaString(code.data.meta);
33
35
  }
34
36
  const attributes = buildMetaAttributes(meta !== null && meta !== void 0 ? meta : {});