"use strict";

const ignore = require('ignore');

const ignoreArr1 = ['src', '!src\\components', 'src\\Accessibility'];
const ignoreArr2 = ['src\\', '!node_modules\\'];
const ignoreArr3 = ['*'];

const {
  windowsModificationFile
} = require('../../../../lib/loaderUtils/windowsModification');

const files = ['D:\\MyWork\\React Build\\desk_client_app\\jsapps\\supportapp\\src\\components\\Accessibility\\Accessibility.module.css', 'D:\\MyWork\\React Build\\desk_client_app\\jsapps\\supportapp\\src\\components\\Avatar\\Avatar.module.css', 'D:/MyWork/React Build/desk_client_app/jsapps/supportapp/src/components/Accessibility/Accessibility.module.css', 'D:/MyWork/React Build/desk_client_app/jsapps/supportapp/src/components/Accessibility/AccessibilityNavigation.module.css', 'desk_client_app\\jsapps\\supportapp\\src\\components\\Test.module.css', 'desk_client_app\\jsapps\\supportapp\\src\\components\\Accessibility\\Accessibility.module.css', 'desk_client_app/jsapps/supportapp/src/components/Accessibility/Accessibility.module.css', 'src\\components\\Accessibility\\Accessibility.module.css', 'src/components/Accessibility/Accessibility.module.css', 'Accessibility.module.css', ''];
const ignore1 = ignore().add(ignoreArr1);
const ignore2 = ignore().add(ignoreArr2);
const ignore3 = ignore().add(ignoreArr3);
files.forEach(file => {
  // console.log(file);
  const rootDir = 'supportapp';
  const regex = `^(.+?)${rootDir}?\\\\`;
  const newFilename = windowsModificationFile(file).replace(new RegExp(regex, 'gi'), '');
  console.log(newFilename);

  if (newFilename.trim() !== '') {
    console.log(ignore1.ignores(newFilename));
    console.log(ignore2.ignores(newFilename));
    console.log(ignore3.ignores(newFilename));
    console.log('--------------------------------------------------------------------');
  }
});