build/lib/treeshaking.ts/visitNode
function isVariableStatementWithSideEffects(ts: typeof import('typescript'), node: ts.Node): boolean {
	if (!ts.isVariableStatement(node)) {
		return false;
	}
	let hasSideEffects = false;
	const visitNode = (node: ts.Node) => {
		if (hasSideEffects) {
			// no need to go on
			return;
		}
		if (ts.isCallExpression(node) || ts.isNewExpression(node)) {
			// TODO: assuming `createDecorator` and `refineServiceDecorator` calls are side-effect free
			const isSideEffectFree = /(createDecorator|refineServiceDecorator)/.test(node.expression.getText());
			if (!isSideEffectFree) {
				hasSideEffects = true;
			}
		}
		node.forEachChild(visitNode);
	};
	node.forEachChild(visitNode);
	return hasSideEffects;
}