Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@tagoro9/git

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tagoro9/git - npm Package Compare versions

Comparing version
1.0.1
to
1.1.0
+2
-0
lib/index.d.ts

@@ -0,3 +1,5 @@

import gitUrlParse = require("git-url-parse");
export declare const git: {
getCurrentBranchName(): Promise<string>;
getRemote(name: string): Promise<gitUrlParse.GitUrl>;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const gitUrlParse = require("git-url-parse");
const simpleGit = require("simple-git/promise");

@@ -20,3 +21,14 @@ const GitError_1 = require("./GitError");

},
getRemote(name) {
const git = getGit();
return git.getRemotes(true).then((remotes) => {
const origin = remotes.find((remote) => remote.name === name);
const firstRemote = remotes[0];
if (!origin && !firstRemote) {
throw new GitError_1.GitError(`Could not find a remote with name "${name}"`, types_1.GitErrorType.REMOTE_NOT_FOUND);
}
return gitUrlParse((origin || firstRemote).refs.fetch);
});
},
};
//# sourceMappingURL=index.js.map
+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,gDAAiD;AAGjD,yCAAsC;AACtC,mCAAuC;AAKvC,SAAS,MAAM;IACb,OAAO,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAOD,SAAS,gBAAgB,CAAC,CAAQ;IAChC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,EAAE;QAC3C,MAAM,IAAI,mBAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,oBAAY,CAAC,cAAc,CAAC,CAAC;KAC5D;IACD,MAAM,CAAC,CAAC;AACV,CAAC;AAEY,QAAA,GAAG,GAAG;IAIjB,oBAAoB;QAClB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;Q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Y,CAAC,gBAAgB,CAC9B,CAAC;aACH;YAED,OAAO,WAAW,CAAC,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}

@@ -1,3 +0,2 @@

import { Commit } from "conventional-commits-parser";
export interface Remote {
export interface GitRemote {
name: string;

@@ -9,21 +8,5 @@ refs: {

}
export interface GitLogLine {
author_email: string;
author_name: string;
date: string;
hash: string;
message: string;
}
export interface GitLog {
all: ReadonlyArray<GitLogLine>;
latest: GitLogLine;
total: number;
}
export interface BranchInfo {
commits: Commit[];
issues: Commit.Reference[];
name: string;
}
export declare enum GitErrorType {
NOT_A_GIT_REPO = 0
NOT_A_GIT_REPO = 0,
REMOTE_NOT_FOUND = 1
}

@@ -6,3 +6,4 @@ "use strict";

GitErrorType[GitErrorType["NOT_A_GIT_REPO"] = 0] = "NOT_A_GIT_REPO";
GitErrorType[GitErrorType["REMOTE_NOT_FOUND"] = 1] = "REMOTE_NOT_FOUND";
})(GitErrorType = exports.GitErrorType || (exports.GitErrorType = {}));
//# sourceMappingURL=types.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AA8BA,IAAY,YAEX;AAFD,WAAY,YAAY;IACtB,mEAAc,CAAA;AAChB,CAAC,EAFW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAEvB"}
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AAQA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mEAAc,CAAA;IACd,uEAAgB,CAAA;AAClB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
{
"name": "@tagoro9/git",
"version": "1.0.1",
"version": "1.1.0",
"description": "Helper functions to interact with local git repositories",

@@ -21,2 +21,3 @@ "main": "lib/index.js",

"@types/conventional-commits-parser": "^3.0.0",
"@types/git-url-parse": "^9.0.0",
"@types/jest": "^25.1.4",

@@ -79,4 +80,5 @@ "@typescript-eslint/eslint-plugin": "^2.24.0",

"conventional-commits-parser": "^3.0.8",
"git-url-parse": "^11.1.2",
"simple-git": "^1.132.0"
}
}