You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
427 B

4 years ago
  1. /**
  2. Check if a path is inside another path.
  3. @example
  4. ```
  5. import isPathInside = require('is-path-inside');
  6. isPathInside('a/b/c', 'a/b');
  7. //=> true
  8. isPathInside('a/b/c', 'x/y');
  9. //=> false
  10. isPathInside('a/b/c', 'a/b/c');
  11. //=> false
  12. isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus');
  13. //=> true
  14. ```
  15. */
  16. declare function isPathInside(childPath: string, parentPath: string): boolean;
  17. export = isPathInside;