@types/git-up
TypeScript icon, indicating that this package has built-in type declarations

7.0.2 • Public • Published

Installation

npm install --save @types/git-up

Summary

This package contains type definitions for git-up (https://github.com/IonicaBizau/git-up).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/git-up.

index.d.ts

export = gitUp;

/**
 * A low level git url parser. Parses the `input` url.
 *
 * @param input The url as string.
 * @returns The parsed url.
 *
 * @example
 * import gitUp = require("git-up");
 *
 * console.log(gitUp("git@github.com:IonicaBizau/node-parse-url.git"));
 * // => {
 * //     protocols: []
 * //   , port: null
 * //   , resource: "github.com"
 * //   , user: "git"
 * //   , pathname: "/IonicaBizau/node-parse-url.git"
 * //   , hash: ""
 * //   , search: ""
 * //   , href: "git@github.com:IonicaBizau/node-parse-url.git"
 * //   , protocol: "ssh"
 * // }
 *
 * console.log(gitUp("https://github.com/IonicaBizau/node-parse-url.git"));
 * // => {
 * //     protocols: [ "https" ]
 * //   , port: null
 * //   , resource: "github.com"
 * //   , user: ""
 * //   , pathname: "/IonicaBizau/node-parse-url.git"
 * //   , hash: ""
 * //   , search: ""
 * //   , href: "https://github.com/IonicaBizau/node-parse-url.git"
 * //   , protocol: "https"
 * // }
 */
declare function gitUp(input: string): gitUp.ParsedUrl;

declare namespace gitUp {
    interface ParsedUrl {
        /** An array with the url protocols (usually it has one element). */
        protocols: string[];
        /** The domain port. */
        port: string;
        /** The url domain (including subdomains). */
        resource: string;
        /** The authentication user (usually for ssh urls). */
        user: string | undefined;
        /** The url pathname. */
        pathname: string;
        /** The url hash. */
        hash: string;
        /** The url querystring value. */
        search: string;
        /** The input url. */
        href: string;
        /** The git url protocol. */
        protocol: string;
        /** The oauth token (could appear in the https urls). */
        token: string;
        query: Record<string, string>;
        parse_failed: false;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.

Versions

Current Tags

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 7.0.2
    872
  • 7.0.1
    1
  • 7.0.0
    50

Package Sidebar

Install

npm i @types/git-up

Weekly Downloads

780

Version

7.0.2

License

MIT

Unpacked Size

6.27 kB

Total Files

5

Last publish

Collaborators

  • types