@adviser/cement - v0.0.0
    Preparing search index...

    Function splitPath

    • Parses a path string into a Path object with structured parts.

      Splits the path into components, identifying root, slashes, and segments. Consecutive slashes are collapsed into single separators.

      Parameters

      • path: string

        Path string to parse

      Returns Path

      Path object with structured components

      const path = splitPath('/home/user/docs');
      // Path with parts: [Root, 'home', Slash, 'user', Slash, 'docs']

      const relative = splitPath('../config/app.json');
      // Path with parts: [Up, Slash, 'config', Slash, 'app.json']