Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

123456789101112131415161718192021
  1. 'use strict';
  2. const path = require('path');
  3. module.exports = (childPath, parentPath) => {
  4. childPath = path.resolve(childPath);
  5. parentPath = path.resolve(parentPath);
  6. if (process.platform === 'win32') {
  7. childPath = childPath.toLowerCase();
  8. parentPath = parentPath.toLowerCase();
  9. }
  10. if (childPath === parentPath) {
  11. return false;
  12. }
  13. childPath += path.sep;
  14. parentPath += path.sep;
  15. return childPath.startsWith(parentPath);
  16. };