Path helpers for Nextcloud https://npmjs.org/@nextcloud/paths
Перейти к файлу
dependabot[bot] 15cf888da1
Merge pull request #696 from nextcloud-libraries/dependabot/npm_and_yarn/typescript-5.6.2
2024-09-14 01:51:58 +00:00
.github ci: Add REUSE check 2024-07-17 11:57:04 +02:00
LICENSES ci: Add REUSE check 2024-07-17 11:57:04 +02:00
lib
test fix: Correctly setup Typescript root to emit declarations 2024-07-25 11:59:48 +02:00
.gitignore
AUTHORS.md
CHANGELOG.md chore: Prepare v2.2.1 2024-07-25 12:02:43 +02:00
LICENSE
README.md docs: Add REUSE badge 2024-07-17 11:57:44 +02:00
REUSE.toml fix: Correctly setup Typescript root to emit declarations 2024-07-25 11:59:48 +02:00
package-lock.json chore(deps-dev): Bump typescript from 5.5.4 to 5.6.2 2024-09-14 01:50:06 +00:00
package.json chore(deps-dev): Bump typescript from 5.5.4 to 5.6.2 2024-09-14 01:50:06 +00:00
tsconfig.json fix: Correctly setup Typescript root to emit declarations 2024-07-25 11:59:48 +02:00
vite.config.ts
vitest.config.ts fix: Correctly setup Typescript root to emit declarations 2024-07-25 11:59:48 +02:00

README.md

@nextcloud/paths

REUSE status npm Documentation

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'