Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports.transform = function(src, filename, options) {
if (typeof src === "object") {
// handle RN >= 0.46
({ src, filename, options } = src);
}
if (filename.endsWith(".svg") || filename.endsWith(".svgx")) {
var config = resolveConfig.sync(resolveConfigDir(filename));
var svgrConfig = config
? Object.assign({}, defaultsvgrConfig, config)
: defaultsvgrConfig;
var jsCode = svgr.sync(src, svgrConfig);
return upstreamTransformer.transform({
src: fixRenderingBugs(jsCode),
filename,
options
});
}
return upstreamTransformer.transform({ src, filename, options });
};