Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@terencesun/githubdb

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@terencesun/githubdb - npm Package Compare versions

Comparing version 1.0.3 to 1.0.6

3

lib/src/db.js

@@ -66,2 +66,5 @@ "use strict";

_a.sent();
return [4, this.github.checkCreate()];
case 2:
_a.sent();
return [2];

@@ -68,0 +71,0 @@ }

@@ -128,2 +128,38 @@ "use strict";

};
Github.prototype.checkCreate = function () {
var _this = this;
var timmer;
var lock = false;
var count = 0;
return new Promise(function (resolve, reject) {
timmer = setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
var repoRet, repoPathRet;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!!lock) return [3, 3];
lock = true;
count += 1;
return [4, this.isRepoExist()];
case 1:
repoRet = _a.sent();
return [4, this.isRepoPathExist()];
case 2:
repoPathRet = _a.sent();
if (repoRet && repoPathRet) {
clearInterval(timmer);
resolve(true);
}
lock = false;
_a.label = 3;
case 3:
if (count > 5) {
reject(false);
}
return [2];
}
});
}); }, 1000);
});
};
Github.prototype.createRepo = function () {

@@ -130,0 +166,0 @@ return __awaiter(this, void 0, void 0, function () {

@@ -11,2 +11,3 @@ import type { GithubOptions, GithubRepoPathCtx, GithubRepoUpdateInfo, GithubInter } from "./interface";

isRepoPathExist(): Promise<boolean>;
checkCreate(): Promise<boolean>;
createRepo(): Promise<void>;

@@ -13,0 +14,0 @@ createPath(): Promise<void>;

@@ -36,2 +36,3 @@ import type { OctokitOptions } from "@octokit/core/dist-types/types";

connect(): Promise<void>;
checkCreate(): Promise<boolean>;
getRepoFileCtx(): Promise<GithubRepoPathCtx>;

@@ -38,0 +39,0 @@ updateFile(ctx: string, sha: string): Promise<GithubRepoUpdateInfo>;

2

package.json
{
"name": "@terencesun/githubdb",
"version": "1.0.3",
"version": "1.0.6",
"description": "operate with github like mongodb for nodejs",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc