light-bolt11-decoder
Version:
<a href="https://nbd.wtf"><img align="right" height="196" src="https://user-images.githubusercontent.com/1653275/194609043-0add674b-dd40-41ed-986c-ab4a2e053092.png" /></a>
24 lines (20 loc) • 674 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _detectors = require("../../utils/detectors");
var _default = t => (path, state) => {
if ((0, _detectors.isStyled)(t)(path.node.tag, state) || (0, _detectors.isHelper)(t)(path.node.tag, state)) {
const {
tag: callee,
quasi: {
quasis,
expressions
}
} = path.node;
const values = t.arrayExpression(quasis.filter(quasi => quasi.value.cooked !== undefined).map(quasi => t.stringLiteral(quasi.value.cooked)));
path.replaceWith(t.callExpression(callee, [values, ...expressions]));
}
};
exports.default = _default;
;