githubEdit

contains-path

Return true if a file path contains the given path.

Install

Install with npmarrow-up-right

$ npm i contains-path --save

Usage

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:

Running tests

Install dev dependencies:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issuearrow-up-right

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cliarrow-up-right on July 07, 2015.

Last updated