@maverick-js/compiler
Advanced tools
Comparing version 0.26.4 to 0.26.5
@@ -86,2 +86,44 @@ import { resolveConfigPaths, escapeQuotes, TS_NODE } from './chunks/chunk-BIOVNH5X.js'; | ||
export { createJSONPlugin, createVSCodePlugin }; | ||
// src/analyze/meta/walk.ts | ||
var propKeys = /* @__PURE__ */ new Set(["props", "events", "cssvars", "cssparts", "slots"]); | ||
function walkComponentDocs(component, callback) { | ||
var _a, _b; | ||
if (component.docs) { | ||
const newDocs = callback(component.docs); | ||
if (newDocs) | ||
component.docs = newDocs; | ||
} | ||
const keys = Object.keys(component); | ||
for (const key of keys) { | ||
if (key === "members") { | ||
if ((_a = component.members) == null ? void 0 : _a.props) { | ||
for (const prop of component.members.props) { | ||
if (prop.docs) { | ||
const newDocs = callback(prop.docs); | ||
if (newDocs) | ||
prop.docs = newDocs; | ||
} | ||
} | ||
} | ||
if ((_b = component.members) == null ? void 0 : _b.methods) { | ||
for (const method of component.members.methods) { | ||
if (method.docs) { | ||
const newDocs = callback(method.docs); | ||
if (newDocs) | ||
method.docs = newDocs; | ||
} | ||
} | ||
} | ||
} else if (propKeys.has(key)) { | ||
for (const prop of component[key]) { | ||
if (typeof prop.docs === "string") { | ||
const newDocs = callback(prop.docs); | ||
if (newDocs) | ||
prop.docs = newDocs; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
export { createJSONPlugin, createVSCodePlugin, walkComponentDocs }; |
@@ -5,1 +5,2 @@ export * from './meta/component'; | ||
export * from './plugins/vscode-plugin'; | ||
export * from './meta/walk'; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.26.4", | ||
"version": "0.26.5", | ||
"type": "module", | ||
@@ -8,0 +8,0 @@ "types": "dist/types/index.d.ts", |
Sorry, the diff of this file is not supported yet
281776
68
7504