is-dir-like-path
v2.0.0
Published
Check if a given string looks like a directory path
Maintainers
Readme
is-dir-like-path
Check if a given string looks like a directory path
const isDirLikePath = require('is-dir-like-path');
isDirLikePath('foo'); //=> false
isDirLikePath('foo/'); //=> trueInstallation
npm install is-dir-like-pathAPI
const isDirLikePath = require('is-dir-like-path');isDirLikePath(str)
str: string (path)
Return: boolean
It returns true if the last character of a given string is equal to path.sep.
// On POSIX
isDirLikePath('dir\\'); //=> false
// On Windows
isDirLikePath('dir\\'); //=> trueisDirLikePath.posix(str)
str: string (path)
Return: boolean
Always interact in a posix compatible way.
isDirLikePath.posix('dir\\'); //=> falseisDirLikePath.win32(str)
str: string (path)
Return: boolean
isDirLikePath.win32('dir\\'); //=> trueAlways interact in a win32 compatible way.
License
ISC License © 2018 Shinnosuke Watanabe
