1 | /**
|
2 | Check if a path is inside another path.
|
3 |
|
4 | Note that relative paths are resolved against `process.cwd()` to make them absolute.
|
5 |
|
6 | _Important:_ This package is meant for use with path manipulation. It does not check if the paths exist nor does it resolve symlinks. You should not use this as a security mechanism to guard against access to certain places on the file system.
|
7 |
|
8 | @example
|
9 | ```
|
10 | import isPathInside from 'is-path-inside';
|
11 |
|
12 | isPathInside('a/b/c', 'a/b');
|
13 | //=> true
|
14 |
|
15 | isPathInside('a/b/c', 'x/y');
|
16 | //=> false
|
17 |
|
18 | isPathInside('a/b/c', 'a/b/c');
|
19 | //=> false
|
20 |
|
21 | isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus');
|
22 | //=> true
|
23 | ```
|
24 | */
|
25 | export default function isPathInside(childPath: string, parentPath: string): boolean;
|