blob: 05524a6c055ebd3b07a2e7f9c2b733907f9b4499 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
const {dirname, resolve} = require('path')
module.exports = function* (path) {
for (path = resolve(path); path;) {
yield path
const pp = dirname(path)
if (pp === path)
path = null
else
path = pp
}
}
|