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

@otokton/common

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

@otokton/common - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

dist/schema/jsonschema/user.d.ts

3

dist/databases/abstract-mongo.d.ts

@@ -8,5 +8,6 @@ import { Db } from 'mongodb';

get db(): Db;
connect(): void;
connect(schema?: JsonSchemaMongo[]): void;
connectUser(): void;
createCollection(schema: JsonSchemaMongo[]): void;
fillCollection(): void;
}
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var mongodb_1 = require("mongodb");
var user_1 = __importDefault(require("../schema/jsonschema/user"));
var AbstractMongoDatabase = /** @class */ (function () {

@@ -16,3 +20,3 @@ function AbstractMongoDatabase(uri) {

});
AbstractMongoDatabase.prototype.connect = function () {
AbstractMongoDatabase.prototype.connect = function (schema) {
var _this = this;

@@ -24,5 +28,18 @@ this._client

_this._db = connection.db();
if (schema)
_this.createCollection(schema);
})
.catch(function (err) { return console.error(err); });
};
AbstractMongoDatabase.prototype.connectUser = function () {
var _this = this;
this._client
.connect()
.then(function (connection) {
console.log('Database connection established');
_this._db = connection.db();
_this.createCollection([user_1.default]);
})
.catch(function (err) { return console.error(err); });
};
AbstractMongoDatabase.prototype.createCollection = function (schema) {

@@ -29,0 +46,0 @@ var _this = this;

{
"name": "@otokton/common",
"version": "0.1.3",
"version": "0.1.4",
"private": false,

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

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