Path helpers for Nextcloud https://npmjs.org/@nextcloud/paths
73ec625622
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 4.0.0 to 5.0.0.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](
|
||
---|---|---|
.github | ||
LICENSES | ||
lib | ||
test | ||
.gitignore | ||
AUTHORS.md | ||
CHANGELOG.md | ||
LICENSE | ||
README.md | ||
REUSE.toml | ||
package-lock.json | ||
package.json | ||
tsconfig.json | ||
vite.config.ts | ||
vitest.config.ts |
README.md
@nextcloud/paths
Path helpers for Nextcloud apps.
Installation
npm i -S @nextcloud/paths
Usage
import { basename, dirname, encodePath, isSamePath, joinPaths } from '@nextcloud/paths'
basename('/my/file.txt')
// -> 'file.txt'
dirname('/my/file.txt')
// -> '/my'
encodePath('/my/other file.txt')
// -> '/my/other%20file'
isSamePath('/my/file.txt', 'my/file.txt')
// -> true
joinPaths('/my', 'folder', 'file.txt')
// -> '/my/folder/file.txt'