UNPKG

lacona-osx

Version:

Lacona Extensions for OSX, tied into the global-context hosted API

25 lines (21 loc) 491 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.subPaths = subPaths; var _path = require('path'); function subPaths(dir) { const paths = []; let oldPath; while (true) { const base = (0, _path.basename)(dir); const newPath = oldPath ? (0, _path.join)(base, oldPath) : base; oldPath = newPath; paths.push(newPath); dir = (0, _path.dirname)(dir); if (dir === '/' || dir === '.') { break; } } return paths; }