mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-22 01:53:24 +01:00
.. | ||
index.d.ts | ||
index.js | ||
LICENSE | ||
package.json | ||
README.md |
is-subdir
Return whether a directory is a subdirectory of another directory
Cross-platform. Works correctly on Windows, where directory paths can start with disk drive letters in different casings. Like c:\foo
and C:\foo\bar
.
Returns true
when the directories match. The isSubdir.strict()
variant only returns true if the second parameter is a strict subdir of the first and not the same.
Installation
<npm|yarn|pnpm> add is-subdir
Usage
'use strict'
const path = require('path')
const isSubdir = require('is-subdir')
console.log(isSubdir(process.cwd(), path.resolve('node_modules')))
//> true
console.log(isSubdir.strict('node_modules/tape', '../tape'))
//> false