@mintlify/common 1.0.1294 → 1.0.1295

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.
@@ -1,6 +1,6 @@
1
1
  import type { ImportDeclaration, ExportAllDeclaration, ExportDefaultDeclaration, ExportNamedDeclaration, Program } from 'estree-jsx';
2
2
  import { MdxFlowExpression, MdxjsEsm, MdxJsxAttribute, MdxJsxExpressionAttribute, MdxTextExpression } from 'mdast-util-mdx';
3
- import type { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
3
+ import type { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx-jsx';
4
4
  import type { Node } from 'unist';
5
5
  import type { MdxNodeBodyChildType } from '../types/mdx/index.js';
6
6
  export declare const isMdxJsEsm: (node: Node) => node is MdxjsEsm;
@@ -14,6 +14,7 @@ export declare const isImportDeclaration: (bodyChild: MdxNodeBodyChildType) => b
14
14
  export declare const isExport: (type: string) => boolean;
15
15
  export declare const isExportNode: (bodyChild: MdxNodeBodyChildType) => bodyChild is ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration;
16
16
  export declare const isMdxJsxFlowElement: (node: Node) => node is MdxJsxFlowElement;
17
+ export declare const isMdxJsxElement: (node: unknown) => node is MdxJsxFlowElement | MdxJsxTextElement;
17
18
  export declare const isMdxJsxFragment: (node: Node) => node is MdxJsxFlowElement;
18
19
  export declare const createUniqueVariableName: (variableName: string, id: number) => string;
19
20
  export declare const getObjectExpressionStringProperty: (key: string, attribute: MdxJsxAttribute | MdxJsxExpressionAttribute | undefined) => string | undefined;
package/dist/mdx/utils.js CHANGED
@@ -12,6 +12,9 @@ export const isExport = (type) => [
12
12
  ].includes(type);
13
13
  export const isExportNode = (bodyChild) => isExport(bodyChild.type);
14
14
  export const isMdxJsxFlowElement = (node) => node.type === 'mdxJsxFlowElement';
15
+ export const isMdxJsxElement = (node) => node instanceof Object &&
16
+ 'type' in node &&
17
+ (node.type === 'mdxJsxFlowElement' || node.type === 'mdxJsxTextElement');
15
18
  export const isMdxJsxFragment = (node) => isMdxJsxFlowElement(node) && node.name == null;
16
19
  export const createUniqueVariableName = (variableName, id) => `${variableName}_${id}`;
17
20
  export const getObjectExpressionStringProperty = (key, attribute) => {