export function getAbsoluteUrl({ path, getSassFileGlobPattern, glob }, url, includePaths = []) {
  const { dir, base } = path.parse(url);
  const baseGlobPattern = getSassFileGlobPattern(base);
  includePaths.some((includePath) => {
    glob.sync(path.resolve(includePath, dir, baseGlobPattern));
    return false;
  });
}

export default function getAbsoluteUrlFactory() {
  return getAbsoluteUrl.bind(null);
}

import globModule from 'glob';
import pathModule from 'path';

import getSassFileGlobPatternModule from './get-sass-file-glob-pattern';

export function getAbsoluteUrl({ path, getSassFileGlobPattern, glob }, url, includePaths = []) {
  const { dir, base } = path.parse(url);
  const baseGlobPattern = getSassFileGlobPattern(base);
  includePaths.some((includePath) => {
    glob.sync(path.resolve(includePath, dir, baseGlobPattern));
    return false;
  });
}

export default getAbsoluteUrl.bind(null, {
  path: pathModule,
  getSassFileGlobPattern: getSassFileGlobPatternModule,
  glob: globModule,
});

Implement the simplified testable module pattern.
Implement the simplified testable module pattern.

Read more about the pattern here: https://markus.oberlehner.net/blog/2017/02/the-testable-module-pattern/
