Function getRelativePath

    • Given a base path and a file path this method will return a relative path if the file path includes the base path otherwise the full absolute file path is returned.

      Parameters

      • Optionaloptions: { basepath?: string; filepath: string }

        Options

        • Optionalbasepath?: string

          The base path to create a relative path from filepath; default is CWD.

        • filepath: string

          The path to solve from basepath.

      Returns string

      A relative path based on basePath and filePath. (Unix)