UNPKG

938 BJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6exports.safeParse = exports.cssObjectToAst = void 0;
7const postcss_1 = __importDefault(require("postcss"));
8const postcss_nested_1 = __importDefault(require("postcss-nested"));
9const postcssJS = require('postcss-js');
10const safeParser = require('postcss-safe-parser');
11const postcssConfig = { parser: postcssJS };
12const processor = postcss_1.default([postcss_nested_1.default()]);
13function cssObjectToAst(cssObject, sourceFile = '') {
14 return processor.process(cssObject, { from: sourceFile, ...postcssConfig });
15}
16exports.cssObjectToAst = cssObjectToAst;
17function safeParse(css, options = { from: 'style.css' }) {
18 return safeParser(css, options);
19}
20exports.safeParse = safeParse;
21//# sourceMappingURL=parser.js.map
\No newline at end of file