mirror of
https://github.com/anatolykopyl/status.git
synced 2026-03-26 12:54:46 +00:00
Initial commit
This commit is contained in:
21
node_modules/is-path-inside/index.js
generated
vendored
Normal file
21
node_modules/is-path-inside/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
|
||||
module.exports = (childPath, parentPath) => {
|
||||
childPath = path.resolve(childPath);
|
||||
parentPath = path.resolve(parentPath);
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
childPath = childPath.toLowerCase();
|
||||
parentPath = parentPath.toLowerCase();
|
||||
}
|
||||
|
||||
if (childPath === parentPath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
childPath += path.sep;
|
||||
parentPath += path.sep;
|
||||
|
||||
return childPath.startsWith(parentPath);
|
||||
};
|
||||
Reference in New Issue
Block a user