|
|
||||
|---|---|---|---|---|
| .. | ||||
| LICENSE | 11e3a9652a | 7 anni fa | ||
| README.md | 11e3a9652a | 7 anni fa | ||
| index.js | 11e3a9652a | 7 anni fa | ||
| package.json | 11e3a9652a | 7 anni fa | ||
Return true if a file path contains the given path.
Install with npm
$ npm i contains-path --save
var contains = require('contains-path');
true
All of the following return true:
containsPath('./a/b/c', 'a');
containsPath('./a/b/c', 'a/b');
containsPath('./b/a/b/c', 'a/b');
containsPath('/a/b/c', '/a/b');
containsPath('/a/b/c', 'a/b');
containsPath('a', 'a');
containsPath('a/b/c', 'a');
//=> true
false
All of the following return false:
containsPath('abc', 'a');
containsPath('abc', 'a.md');
containsPath('./b/a/b/c', './a/b');
containsPath('./b/a/b/c', './a');
containsPath('./b/a/b/c', '/a/b');
containsPath('/b/a/b/c', '/a/b');
//=> false
true if the given string or array ends with suffix using strict equality for… moretrue if the path appears to be relative.true if a file path ends with the given string/suffix.Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on July 07, 2015.