@stryke/path
Version:
A package containing various utilities that expand the functionality of NodeJs's built-in `path` module
28 lines (26 loc) • 724 B
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
//#region src/delimiter.ts
/**
* The platform-specific file delimiter.
*
* Equals to `";"` in windows and `":"` in all other platforms.
*/
const delimiter = process?.platform === "win32" ? ";" : ":";
const platforms = {
posix: void 0,
win32: void 0
};
const mix = (del = delimiter) => {
return new Proxy({}, { get(_, prop) {
if (prop === "delimiter") return del;
if (prop === "posix") return posix;
if (prop === "win32") return win32;
return platforms[prop];
} });
};
const posix = /* @__PURE__ */ mix(":");
const win32 = /* @__PURE__ */ mix(";");
//#endregion
exports.delimiter = delimiter;
exports.posix = posix;
exports.win32 = win32;