~/bend-docscommunity

src/lsp/path.bend checks

raw source on the hub · import 0x582b4b0fdf3dafdeecc8c3bfddc5e4db/src/lsp/path.bend as Path

lsp/path: just enough path arithmetic to follow a relative import.

1 import
import Base

Definitions

def push source · line 5 · raw

@+seg:String -> @+acc:List<&2, String> -> List<&2, String>

a segment lands on the stack (reversed): .. pops, . and `` do nothing

def norm source · line 10 · raw

@segs:List<&2, String> -> @acc:List<&2, String> -> List<&2, String>

every segment pushed, in order

def join source · line 18 · raw

@dir:String -> @rel:String -> String

dir and rel as one absolute path, its . and .. resolved

def dir source · line 22 · raw

@path:String -> String

the directory of a file's path