@d3x0r/sack-gui
Version:
SACK abstraction library exposed to JS to provide low level system services.
11 lines (7 loc) • 314 B
JavaScript
// Usage:
// import {isTopLevel} from "sack.vfs/isTopLevel"
// isTopLevel( import.meta.url)
import path from 'path';
import { fileURLToPath } from 'url'
const nodePath = path.resolve(process.argv[1]);
export const isTopLevel = ((testPath)=>(nodePath === path.resolve(fileURLToPath(testPath))));