wildstar
    Preparing search index...

    Function root

    • Returns the root of a path, or empty string if not absolute

      Parameters

      • source: string

        The input path

      Returns string

      The root path, or '' if not absolute

      root('c:/foo/bar') // returns 'c:'
      root('foo/bar') // returns ''
      root('/foo/bar') // returns '/'