debian-mirror-gitlab/spec/frontend/__helpers__/yaml_transformer.js
2023-03-04 22:38:38 +05:30

11 lines
332 B
JavaScript

/* eslint-disable import/no-commonjs */
const JsYaml = require('js-yaml');
// This will transform YAML files to JSON strings
module.exports = {
process: (sourceContent) => {
const jsonContent = JsYaml.load(sourceContent);
const json = JSON.stringify(jsonContent);
return { code: `module.exports = ${json}` };
},
};