Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
transform(content, id) {
if (!ext.test(id)) return null;
if (!filter(id)) return null;
let data = loadMethod(content);
if (typeof options.transform === 'function') {
const result = options.transform(data);
// eslint-disable-next-line no-undefined
if (result !== undefined) {
data = result;
}
}
const keys = Object.keys(data).filter((key) => key === makeLegalIdentifier(key));
const code = `var data = ${toSource(data)};\n\n`;
const exports = ['export default data;']
.concat(keys.map((key) => `export var ${key} = data.${key};`))
.join('\n');
return {
code: code + exports,
map: { mappings: '' }
};
}
};
transform (yaml, id) {
if (!ext.test(id)) return null;
if (!filter(id)) return null;
let data = YAML.load(yaml);
if (typeof options.transform === 'function') {
const result = options.transform(data);
if (result !== undefined) data = result;
}
const keys = Object.keys(data).filter(
key => key === makeLegalIdentifier(key)
);
const code = `var data = ${toSource(data)};\n\n`;
const exports = ['export default data;']
.concat(keys.map(key => `export var ${key} = data.${key};`))
.join('\n');
return {
code: code + exports,
map: { mappings: '' }
};
}
};
transform(code, id) {
if (!filter(id)) return null;
const ext = extname(id);
if (!(ext in parsers)) return null;
let rows = parsers[ext](code);
if (options.processRow) {
rows = rows.map((row) => options.processRow(row, id) || row);
}
return {
code: `export default ${toSource(rows)};`,
map: { mappings: '' }
};
}
};
function objectToString(object) {
return toSource(object || {}, null, 0)
}
function objectToString(object) {
return toSource(object || {}, null, 0)
}
const css = ReactDOMServer.renderToStaticMarkup(getStyleElement({ nonce }));
return `
<title>${name === 'Build Tracker' ? name : `${name} : Build Tracker`}</title>
<style nonce="${nonce}">html,body{height:100%;overflow-y:hidden;}#root{display:flex;height:100%;}</style>
${css}
<div id="root">${html}</div>
<div id="menuPortal"></div>
<div id="tooltipPortal"></div>
<div id="snackbarPortal"></div>
${scripts.map(script => ``).join('')}
`;
}