Conditions | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /* eslint-disable import/no-commonjs */ |
||
11 | function isPathInside(childPath, parentPath) { |
||
12 | const relation = path.relative(parentPath, childPath); |
||
13 | |||
14 | return Boolean( |
||
15 | relation && |
||
16 | relation !== '..' && |
||
17 | !relation.startsWith(`..${path.sep}`) && |
||
18 | relation !== path.resolve(childPath) |
||
19 | ); |
||
20 | } |
||
21 | |||
39 |