printer-notifications/node_modules/svelte-preprocess/dist/transformers/replace.js

17 lines
454 B
JavaScript
Raw Normal View History

2023-11-13 21:10:04 +00:00
"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;