@shopify/prettier-plugin-liquid
Version:
Prettier Liquid/HTML plugin by Shopify
39 lines • 1.67 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.preprocess = void 0;
const AST = __importStar(require("@shopify/liquid-html-parser"));
const preprocess_1 = require("./preprocess");
// This is super hard to type check so I'll just magically assume
// everything works.
function preprocess(ast, options) {
const augmentationPipeline = preprocess_1.AUGMENTATION_PIPELINE.map((fn) => fn.bind(null, options));
for (const augmentation of augmentationPipeline) {
AST.walk(ast, augmentation);
}
return ast;
}
exports.preprocess = preprocess;
//# sourceMappingURL=print-preprocess.js.map