@tagoro9/git
Advanced tools
| import { GitErrorType } from "./types"; | ||
| export declare class GitError extends Error { | ||
| readonly code: GitErrorType; | ||
| constructor(message: string, code: GitErrorType); | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| class GitError extends Error { | ||
| constructor(message, code) { | ||
| super(message); | ||
| Object.setPrototypeOf(this, new.target.prototype); | ||
| this.code = code; | ||
| } | ||
| } | ||
| exports.GitError = GitError; | ||
| //# sourceMappingURL=GitError.js.map |
| {"version":3,"file":"GitError.js","sourceRoot":"","sources":["../src/GitError.ts"],"names":[],"mappings":";;AAMA,MAAa,QAAS,SAAQ,KAAK;IAGjC,YAAY,OAAe,EAAE,IAAkB;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AARD,4BAQC"} |
| export declare const git: { | ||
| getCurrentBranchName(): Promise<string>; | ||
| }; |
+21
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const simpleGit = require("simple-git/promise"); | ||
| const GitError_1 = require("./GitError"); | ||
| const types_1 = require("./types"); | ||
| function getGit() { | ||
| return simpleGit().silent(true); | ||
| } | ||
| function mapAndThrowError(e) { | ||
| if (e.message.match(/not a git repository/)) { | ||
| throw new GitError_1.GitError(e.message, types_1.GitErrorType.NOT_A_GIT_REPO); | ||
| } | ||
| throw e; | ||
| } | ||
| exports.git = { | ||
| getCurrentBranchName() { | ||
| const git = getGit(); | ||
| return git.revparse(["--abbrev-ref", "HEAD"]).catch(mapAndThrowError); | ||
| }, | ||
| }; | ||
| //# sourceMappingURL=index.js.map |
| {"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;QACrB,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACxE,CAAC;CACF,CAAC"} |
| import { Commit } from "conventional-commits-parser"; | ||
| export interface Remote { | ||
| name: string; | ||
| refs: { | ||
| fetch: string; | ||
| push: string; | ||
| }; | ||
| } | ||
| 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 | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| var GitErrorType; | ||
| (function (GitErrorType) { | ||
| GitErrorType[GitErrorType["NOT_A_GIT_REPO"] = 0] = "NOT_A_GIT_REPO"; | ||
| })(GitErrorType = exports.GitErrorType || (exports.GitErrorType = {})); | ||
| //# sourceMappingURL=types.js.map |
| {"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"} |
+3
-2
| { | ||
| "name": "@tagoro9/git", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Helper functions to interact with local git repositories", | ||
@@ -46,4 +46,4 @@ "main": "lib/index.js", | ||
| "scripts": { | ||
| "build": "tsc -p ./tsconfig.build.json && yarn fix-paths", | ||
| "clean": "rimraf lib", | ||
| "build": "tsc -p ./tsconfig.build.json && yarn fix-paths", | ||
| "fix-paths": "tscpaths -p tsconfig.build.json -s ./src -o ./lib", | ||
@@ -53,2 +53,3 @@ "git:commit-msg": "commitlint -E HUSKY_GIT_PARAMS", | ||
| "lint": "eslint ./src --ext .ts", | ||
| "prepare": "yarn build", | ||
| "test": "jest", | ||
@@ -55,0 +56,0 @@ "watch": "yarn clean && tsc-watch -w -p ./tsconfig.build.json --onSuccess \"yarn fix-paths\"" |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
5595
138.49%11
450%72
Infinity%