Regenerating node_modules
This commit is contained in:
parent
09b4a82c83
commit
c96f84308a
5488 changed files with 487362 additions and 60779 deletions
33
node_modules/contains-path/index.js
generated
vendored
Normal file
33
node_modules/contains-path/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
|
||||
function containsPath(fp, segment) {
|
||||
if (typeof fp !== 'string' || typeof segment !== 'string') {
|
||||
throw new TypeError('contains-path expects file paths to be a string.');
|
||||
}
|
||||
|
||||
var prefix = '(^|\\/)';
|
||||
if (segment.indexOf('./') === 0 || segment.charAt(0) === '/') {
|
||||
prefix = '^';
|
||||
}
|
||||
|
||||
var re = new RegExp(prefix + normalize(segment).join('\\/') + '($|\\/)');
|
||||
fp = normalize(fp).join('/');
|
||||
return re.test(fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize slashes
|
||||
*/
|
||||
|
||||
function normalize(str) {
|
||||
str = path.normalize(str);
|
||||
return str.split(/[\\\/]+/);
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose `containsPath`
|
||||
*/
|
||||
|
||||
module.exports = containsPath;
|
||||
Loading…
Add table
Add a link
Reference in a new issue