UNPKG

bitdrive-cli

Version:

A Bitspace service that for managing Bitdrives over FUSE.

15 lines (11 loc) 344 B
const p = require('path').posix const constants = require('./constants') function normalize (path) { if (!path) return constants.mountpoint path = p.resolve(path) if (path.startsWith(constants.mountpoint)) return path throw new Error(`Path ${path} is not contained within the Bitdrive mountpoint`) } module.exports = { normalize }