MCPcopy Create free account
hub / github.com/rollup/plugins / hasDefineEsmProperty

Function hasDefineEsmProperty

packages/commonjs/src/ast-utils.js:134–146  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

132}
133
134export function hasDefineEsmProperty(node) {
135 return node.properties.some((property) => {
136 if (
137 property.type === 'Property' &&
138 property.key.type === 'Identifier' &&
139 property.key.name === '__esModule' &&
140 isTruthy(property.value)
141 ) {
142 return true;
143 }
144 return false;
145 });
146}

Callers

nothing calls this directly

Calls 1

isTruthyFunction · 0.85

Tested by

no test coverage detected