Function getRoot

  • Computes the root this path, like getRoot('c:\files') === c:\, getRoot('files:///files/path') === files:///, or getRoot('\\server\shares\path') === \\server\shares

    Parameters

    • path: string
    • sep: string = '/'

    Returns string