Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var processRtlCSS = function (cssContent, mapContent, sourceFileName, targetFileName, autoprefixer, autoprefixerBrowsers) {
if (mapContent !== true) {
mapContent = { prev: mapContent };
}
var result, css, map;
try {
var config = configLoader.load(null, path.dirname(sourceFileName), { options: { minify: false } });
result = rtlcss.configure(config).process(cssContent, {
map: mapContent,
from: sourceFileName,
to: targetFileName
});
css = result.css;
map = result.map.toJSON();
} catch (e) {
// Return same css and map back so the upstream compilers can continue.
return {
Success: false,
Remarks: "RTLCSS: Exception occured: " + e.message,
css: cssContent,
map: mapContent