Mirror: The small sibling of the graphql package, slimmed down for client-side libraries.
1const plugin = ({ types: t }) => {
2 return {
3 visitor: {
4 CallExpression(path) {
5 if (
6 t.isMemberExpression(path.node.callee) &&
7 t.isIdentifier(path.node.callee.object) &&
8 t.isIdentifier(path.node.callee.property) &&
9 path.node.callee.object.name === 'Object' &&
10 path.node.callee.property.name === 'freeze'
11 ) {
12 path.replaceWith(path.node.arguments[0]);
13 }
14 },
15 },
16 };
17};
18
19export default plugin;