printer-notifications/node_modules/svelte-preprocess/dist/transformers/replace.js
2023-11-13 16:10:04 -05:00

17 lines
454 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformer = void 0;
const transformer = async ({ content, options, }) => {
let newContent = content;
if (options == null) {
return { code: content };
}
for (const [regex, replacer] of options) {
newContent = newContent.replace(regex, replacer);
}
return {
code: newContent,
};
};
exports.transformer = transformer;