UNPKG

@lwc/style-compiler

Version:

Transform style sheet to be consumed by the LWC engine

27 lines 843 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function findNode(container, predicate) { return container && container.nodes && container.nodes.find(predicate); } exports.findNode = findNode; function replaceNodeWith(oldNode, ...newNodes) { if (newNodes.length) { const { parent } = oldNode; if (!parent) { throw new Error(`Impossible to replace root node.`); } newNodes.forEach(node => { parent.insertBefore(oldNode, node); }); oldNode.remove(); } } exports.replaceNodeWith = replaceNodeWith; function trimNodeWhitespaces(node) { if (node && node.spaces) { node.spaces.before = ''; node.spaces.after = ''; } } exports.trimNodeWhitespaces = trimNodeWhitespaces; //# sourceMappingURL=selector-parser.js.map