Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
319 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | '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 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.