How to use the shallowEqual function from @babel/types
Find comprehensive JavaScript @babel/types.shallowEqual code examples handpicked from public code repositorys.
240 241 242 243 244 245 246 247 248 249
const binding = bindings[key]; const referencePaths = binding.referencePaths.map(p => p.parentPath); for (const referencePath of referencePaths) { if (types.isMemberExpression(referencePath.node) && referencePath.node.object.name === objectName && (referencePath.node.property.name === variableKey || referencePath.node.property.value === variableKey)) { if (referencePath.parentPath.isAssignmentExpression() && types.shallowEqual(referencePath.parent.left, referencePath.node)) { // 排除a['b'] = 'xxx'的情况 continue; } if (types.isLiteral(variableValue)) {
2
1
1
+ 82 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)