@mintlify/common
Version:
Commonly shared code within Mintlify
15 lines (14 loc) • 758 B
JavaScript
export const isMdxJsEsm = (node) => node.type === 'mdxjsEsm';
export function estreeIsProgram(node) {
var _a;
return ((_a = node.data) === null || _a === void 0 ? void 0 : _a.estree) != null;
}
export const isImportDeclaration = (bodyChild) => bodyChild.type === 'ImportDeclaration';
export const isExport = (type) => [
'ExportAllDeclaration', // export * from source
'ExportDefaultDeclaration', // export default declaration
'ExportNamedDeclaration', // export { ... } from "source"
].includes(type);
export const isExportNode = (bodyChild) => isExport(bodyChild.type);
export const isMdxJsxFlowElement = (node) => node.type === 'mdxJsxFlowElement';
export const createUniqueVariableName = (variableName, id) => `${variableName}_${id}`;