debian-mirror-gitlab/spec/frontend/__helpers__/yaml_transformer.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
332 B
JavaScript
Raw Normal View History

2022-06-21 17:19:12 +05:30
/* 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);
2023-03-04 22:38:38 +05:30
return { code: `module.exports = ${json}` };
2022-06-21 17:19:12 +05:30
},
};