How to use the isJSXNamespacedName function from @babel/types
Find comprehensive JavaScript @babel/types.isJSXNamespacedName code examples handpicked from public code repositorys.
50 51 52 53 54 55 56 57 58 59
const attrPath = this.path.get(`openingElement.attributes.${index}`); if (t.isJSXAttribute(attrPath.node)) { // 使用命名空间的属性 if ( hasNamespace && t.isJSXNamespacedName(attrPath.node.name) && attrPath.node.name.namespace === ns[0] && attrPath.node.name.name === ns[1] ) { return attrPath;
13
89
4
+ 21 other calls in file
GitHub: didi/chameleon
31 32 33 34 35 36 37 38 39
if (lang === 'vue' && (['wx', 'qq', 'baidu', 'alipay', 'tt'].includes(type))) { let parentPath = path.parentPath; let attributes = parentPath.node.attributes; let idNode = attributes.find((attr) => attr.name.name === 'id'); let refNode = attributes.find((attr) => (attr.name.name === 'ref' || attr.name.name.name === 'ref')); let isDynamicRef = t.isJSXNamespacedName(refNode.name); let refNodeValue = isDynamicRef ? `{{${refNode.value.value}}}` : refNode.value.value let classNode = attributes.find((attr) => attr.name.name === 'class'); if (idNode) {
699
0
239
+ 11 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)