Files
NapCatQQ/.pnpm-store/v3/files/d9/6a9e605129153a48750b7b817e14e3d78c9f11e6b2e7ec690b610dd1a4e3d4a7d2d71f32941d9fe0b679e489922d855218a6139a1d8a429adbc7284155f697
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

15 lines
404 B
Plaintext

/**
* Returns the name of the prop given the JSXAttribute object.
*/
export default function propName(prop = {}) {
if (!prop.type || prop.type !== 'JSXAttribute') {
throw new Error('The prop must be a JSXAttribute collected by the AST parser.');
}
if (prop.name.type === 'JSXNamespacedName') {
return `${prop.name.namespace.name}:${prop.name.name.name}`;
}
return prop.name.name;
}