4.0.0 • Published 3 years ago

is-path-inside v4.0.0

Weekly downloads
20,449,623
License
MIT
Repository
github
Last release
3 years ago

is-path-inside

Check if a path is inside another path

Install

$ npm install is-path-inside

Usage

import isPathInside from 'is-path-inside';

isPathInside('a/b/c', 'a/b');
//=> true

isPathInside('a/b/c', 'x/y');
//=> false

isPathInside('a/b/c', 'a/b/c');
//=> false

isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus');
//=> true

API

isPathInside(childPath, parentPath)

Note that relative paths are resolved against process.cwd() to make them absolute.

Important: This package is meant for use with path manipulation. It does not check if the paths exist nor does it resolve symlinks. You should not use this as a security mechanism to guard against access to certain places on the file system.

childPath

Type: string

The path that should be inside parentPath.

parentPath

Type: string

The path that should contain childPath.


eslintdelis-path-in-cwdis-installed-globallycuc-gafarchetype-library@effective/prettier-eslintcordova-androidcomponennentteasy-select-rnvuedragdropuploadimagesreact-native-bluetooth2killi8n-react-native-fast-image@cashremit/cr-streamline-iconsairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxfdeneme323112@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationdiscord-music-botsreact-native-covid-sdk@l1nyanm1ng/react-picture-viewer@saeon/quick-formcthpb-plugin-socialmysql-formatreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutilsukor-remasterdyx-reactlevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-testunblock-block-save-variables@infinitebrahmanuniverse/nolb-is-pcclibyarntestopea-bootstraapluminos-ui-coresklif-ui-kitsklif-apits-handy@everything-registry/sub-chunk-1934jawwy-sdkjawwy_gamification_release@314oner_npm/universal-components-library@deepakorg/test@deepak757/testreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uimachinebeemrcapsreact-native-jawwy_sampleswiftallydavidbeckahm45datum-utilitydate-to-block-ethdegeamunited28delete-clidk_2018_1_1demdemsirdevdwi0712dohundogandev-simple-toastdesign-system-fitbank-450dipchaincypress-spellcheckcpm-8course-vue-tplconstellation-frontendcreate-node-ts-esm-jestcpdek1cpdek2cpdek3cpdek4cpdek5cpm-12cpm-13cpm-14cpm-15cpm-16cpm-17cpm-18
4.0.0

3 years ago

3.0.3

3 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

10 years ago

0.1.0

10 years ago