MCPcopy Create free account
hub / github.com/FormidableLabs/babel-plugin-transform-define / UnaryExpression

Function UnaryExpression

lib/index.js:111–125  ·  view source on GitHub ↗
(nodePath, state)

Source from the content-addressed store, hash-verified

109
110 // typeof window
111 UnaryExpression(nodePath, state) {
112 if (nodePath.node.operator !== "typeof") { return; }
113
114 const { opts } = state;
115 const keys = Object.keys(opts);
116 const typeofValues = {};
117
118 keys.forEach((key) => {
119 if (key.substring(0, TYPEOF_PREFIX.length) === TYPEOF_PREFIX) {
120 typeofValues[key.substring(TYPEOF_PREFIX.length)] = opts[key];
121 }
122 });
123
124 processNode(typeofValues, nodePath, t.valueToNode, unaryExpressionComparator);
125 }
126
127 }
128 };

Callers

nothing calls this directly

Calls 1

processNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…