Package Exports
- path-is-root
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (path-is-root) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
path-is-root
check if a path is root
Install
npm install --save path-is-root
Usage
import isRoot from 'path-is-root'
test('should be root path in Unix', assert => {
assert.is(isRoot('/'), true)
})
test('should be not root path in Unix', assert => {
assert.is(isRoot('/x'), false)
})
test('should be root path in Win', assert => {
assert.is(isRoot('C:/'), true)
})
test('should be not root path in Win', assert => {
assert.is(isRoot('C:/x'), false)
})
API
isRoot(path)
Returns a boolean of whether the path is root