Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
591 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | # is-path-inside [![Build Status](https://travis-ci.org/sindresorhus/is-path-inside.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-inside)
|
---|
| 2 |
|
---|
| 3 | > Check if a path is inside another path
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | ## Install
|
---|
| 7 |
|
---|
| 8 | ```
|
---|
| 9 | $ npm install is-path-inside
|
---|
| 10 | ```
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | ## Usage
|
---|
| 14 |
|
---|
| 15 | ```js
|
---|
| 16 | const isPathInside = require('is-path-inside');
|
---|
| 17 |
|
---|
| 18 | isPathInside('a/b/c', 'a/b');
|
---|
| 19 | //=> true
|
---|
| 20 |
|
---|
| 21 | isPathInside('a/b/c', 'x/y');
|
---|
| 22 | //=> false
|
---|
| 23 |
|
---|
| 24 | isPathInside('a/b/c', 'a/b/c');
|
---|
| 25 | //=> false
|
---|
| 26 |
|
---|
| 27 | isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus');
|
---|
| 28 | //=> true
|
---|
| 29 | ```
|
---|
| 30 |
|
---|
| 31 |
|
---|
| 32 | ## License
|
---|
| 33 |
|
---|
| 34 | MIT © [Sindre Sorhus](https://sindresorhus.com)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.