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