aswi2020vldc-gitlab/templetes/node_modules/is-path-inside/index.js @ 9b6ff40e
1 | 3a515b92 | cagy | 'use strict'; |
---|---|---|---|
2 | const path = require('path'); |
||
3 | const pathIsInside = require('path-is-inside'); |
||
4 | |||
5 | module.exports = (childPath, parentPath) => { |
||
6 | childPath = path.resolve(childPath); |
||
7 | parentPath = path.resolve(parentPath); |
||
8 | |||
9 | if (childPath === parentPath) { |
||
10 | return false; |
||
11 | }
|
||
12 | |||
13 | return pathIsInside(childPath, parentPath); |
||
14 | };
|