Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const themeImporter = (themeScssPath, contents) => (url, previousResolve, done) => {
const request = urlToRequest(url);
const pathsToTry = importsToResolve(request);
const baseDirectory = path.dirname(previousResolve);
for (let i = 0; i < pathsToTry.length; i += 1) {
const potentialResolve = pathsToTry[i];
if (path.resolve(baseDirectory, potentialResolve) === themeScssPath) {
done({ contents });
return;
}
}
done();
};