index.js 319 B

1234567891011121314
  1. 'use strict';
  2. const path = require('path');
  3. const pathIsInside = require('path-is-inside');
  4. module.exports = (childPath, parentPath) => {
  5. childPath = path.resolve(childPath);
  6. parentPath = path.resolve(parentPath);
  7. if (childPath === parentPath) {
  8. return false;
  9. }
  10. return pathIsInside(childPath, parentPath);
  11. };