main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
758 bytes
|
Line | |
---|
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 = require('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 | declare function isPathInside(childPath: string, parentPath: string): boolean;
|
---|
26 |
|
---|
27 | export = isPathInside;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.