项目原始demo,不改动
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # contains-path [![NPM version](https://badge.fury.io/js/contains-path.svg)](http://badge.fury.io/js/contains-path)
  2. > Return true if a file path contains the given path.
  3. ## Install
  4. Install with [npm](https://www.npmjs.com/)
  5. ```sh
  6. $ npm i contains-path --save
  7. ```
  8. ## Usage
  9. ```js
  10. var contains = require('contains-path');
  11. ```
  12. **true**
  13. All of the following return `true`:
  14. ```js
  15. containsPath('./a/b/c', 'a');
  16. containsPath('./a/b/c', 'a/b');
  17. containsPath('./b/a/b/c', 'a/b');
  18. containsPath('/a/b/c', '/a/b');
  19. containsPath('/a/b/c', 'a/b');
  20. containsPath('a', 'a');
  21. containsPath('a/b/c', 'a');
  22. //=> true
  23. ```
  24. **false**
  25. All of the following return `false`:
  26. ```js
  27. containsPath('abc', 'a');
  28. containsPath('abc', 'a.md');
  29. containsPath('./b/a/b/c', './a/b');
  30. containsPath('./b/a/b/c', './a');
  31. containsPath('./b/a/b/c', '/a/b');
  32. containsPath('/b/a/b/c', '/a/b');
  33. //=> false
  34. ```
  35. ## Related projects
  36. * [ends-with](https://github.com/jonschlinkert/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with)
  37. * [is-absolute](https://github.com/jonschlinkert/is-absolute): Return true if a file path is absolute.
  38. * [is-relative](https://github.com/jonschlinkert/is-relative): Returns `true` if the path appears to be relative.
  39. * [path-ends-with](https://github.com/jonschlinkert/path-ends-with): Return `true` if a file path ends with the given string/suffix.
  40. * [path-segments](https://github.com/jonschlinkert/path-segments): Get n specific segments of a file path, e.g. first 2, last 3, etc.
  41. * [parse-filepath](https://github.com/jonschlinkert/parse-filepath): Parse a filepath into an object, yielding predictable results for basename and extname.
  42. ## Running tests
  43. Install dev dependencies:
  44. ```sh
  45. $ npm i -d && npm test
  46. ```
  47. ## Contributing
  48. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/contains-path/issues/new)
  49. ## Author
  50. **Jon Schlinkert**
  51. + [github/jonschlinkert](https://github.com/jonschlinkert)
  52. + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
  53. ## License
  54. Copyright © 2015 Jon Schlinkert
  55. Released under the MIT license.
  56. ***
  57. _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 07, 2015._