securityos/node_modules/postcss-syntax/index.js

27 lines
495 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
"use strict";
const stringify = require("./stringify");
const parse = require("./parse");
const defaultConfig = {
postcss: "css",
stylus: "css",
babel: "jsx",
xml: "html",
};
function initSyntax (syntax) {
syntax.stringify = stringify.bind(syntax);
syntax.parse = parse.bind(syntax);
return syntax;
}
function syntax (config) {
return initSyntax({
config: Object.assign({}, defaultConfig, config),
});
}
initSyntax(syntax);
syntax.config = defaultConfig;
module.exports = syntax;