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

Function processNode

lib/index.js:58–64  ·  view source on GitHub ↗
(replacements, nodePath, replaceFn, comparator)

Source from the content-addressed store, hash-verified

56 */
57// eslint-disable-next-line max-params
58const processNode = (replacements, nodePath, replaceFn, comparator) => {
59 const replacementKey = find(getSortedObjectPaths(replacements),
60 (value) => comparator(nodePath, value));
61 if (has(replacements, replacementKey)) {
62 replaceAndEvaluateNode(replaceFn, nodePath, get(replacements, replacementKey));
63 }
64};
65
66/**
67 * Checks if the given identifier is an ES module import

Callers 3

MemberExpressionFunction · 0.85
IdentifierFunction · 0.85
UnaryExpressionFunction · 0.85

Calls 1

replaceAndEvaluateNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…