Comparing version 1.3.1 to 1.4.0
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -21,7 +12,6 @@ return new (P || (P = Promise))(function (resolve, reject) { | ||
const mongodb_1 = require("mongodb"); | ||
const injection_js_1 = require("injection-js"); | ||
const retry = require("retry"); | ||
const events_1 = require("events"); | ||
const util_1 = require("./util"); | ||
let Database = class Database extends events_1.EventEmitter { | ||
class Database extends events_1.EventEmitter { | ||
constructor() { | ||
@@ -56,8 +46,4 @@ super(); | ||
} | ||
}; | ||
Database = __decorate([ | ||
injection_js_1.Injectable(), | ||
__metadata("design:paramtypes", []) | ||
], Database); | ||
} | ||
exports.Database = Database; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZGIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHFDQUFxRjtBQUNyRiwrQ0FBMEM7QUFDMUMsK0JBQStCO0FBQy9CLG1DQUFzQztBQUN0QyxpQ0FBK0I7QUFHL0IsSUFBYSxRQUFRLEdBQXJCLGNBQXNCLFNBQVEscUJBQVk7SUFLeEM7UU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GRiKTtcbiAgICAgIH0gY2F0Y2goZSkge1xuICAgICAgICBpZiAob3BlcmF0aW9uLnJldHJ5KGUpKSByZXR1cm47XG4gICAgICAgIGNvbnNvbGUuZXJyb3IoJ01vbmdvOiBDb25uZWN0aW9uIGVycm9yJywgZSk7XG4gICAgICAgIHRoaXMuZW1pdCgnZXJyb3InLCBlKTtcbiAgICAgICAgdGhpcy5jb25uZWN0aW9uLnJlamVjdChlKTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxuXG59XG4iXX0= |
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -23,5 +14,3 @@ return new (P || (P = Promise))(function (resolve, reject) { | ||
const types_1 = require("./types"); | ||
const db_1 = require("./db"); | ||
const injection_js_1 = require("injection-js"); | ||
let MongoRepository = class MongoRepository { | ||
class MongoRepository { | ||
constructor(db) { | ||
@@ -188,8 +177,4 @@ this.db = db; | ||
} | ||
}; | ||
MongoRepository = __decorate([ | ||
injection_js_1.Injectable(), | ||
__metadata("design:paramtypes", [db_1.Database]) | ||
], MongoRepository); | ||
} | ||
exports.MongoRepository = MongoRepository; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3NpdG9yeS5qcyIsInNvdXJjZVJv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cGxhY2U6IGJvb2xlYW4pOiBUIHtcbiAgICBpZihkb2N1bWVudCAmJiAoZG9jdW1lbnQuaWQgfHwgZG9jdW1lbnQuX2lkKSkge1xuICAgICAgaWYocmVwbGFjZSkge1xuICAgICAgICBkb2N1bWVudC5faWQgPSBuZXcgT2JqZWN0SUQoZG9jdW1lbnQuaWQpO1xuICAgICAgICBkZWxldGUgZG9jdW1lbnQuaWQ7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkb2N1bWVudC5pZCA9IGRvY3VtZW50Ll9pZC50b1N0cmluZygpO1xuICAgICAgICBkZWxldGUgZG9jdW1lbnQuX2lkO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gZG9jdW1lbnQ7XG4gIH1cblxuICBwcml2YXRlIGFzeW5jIGludm9rZUV2ZW50cyh0eXBlOiBzdHJpbmcsIGZuczogc3RyaW5nW10sIGRvY3VtZW50OiBhbnkpOiBQcm9taXNlPFQ+IHtcbiAgICBmb3IoY29uc3QgZm4gb2YgZm5zKSB7XG4gICAgICBjb25zdCBldmVudHMgPSBSZWZsZWN0LmdldE1ldGFkYXRhKGAke3R5cGV9XyR7Zm59YCwgdGhpcykgfHwgW107XG4gICAgICBmb3IoY29uc3QgZXZlbnQgb2YgZXZlbnRzKSB7XG4gICAgICAgIGRvY3VtZW50ID0gZXZlbnQuYmluZCh0aGlzKShkb2N1bWVudCk7XG4gICAgICAgIGlmICh0eXBlb2YgZG9jdW1lbnQudGhlbiA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgIGRvY3VtZW50ID0gYXdhaXQgZG9jdW1lbnQ7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgXG4gICAgcmV0dXJuIGRvY3VtZW50O1xuICB9XG5cbn1cbiJdfQ== |
{ | ||
"name": "mongtype", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Mongo Repository for Node written in TypeScript", | ||
@@ -34,2 +34,3 @@ "main": "dist/index.js", | ||
"injection-js": "^2.0.1", | ||
"inversify": "^4.3.0", | ||
"mongodb": "^2.2.25", | ||
@@ -36,0 +37,0 @@ "reflect-metadata": "^0.1.10", |
import { UpdateWriteOpResult, ObjectID, MongoClient, Db, Collection } from 'mongodb'; | ||
import { Injectable } from 'injection-js'; | ||
import * as retry from 'retry'; | ||
@@ -7,3 +6,2 @@ import { EventEmitter } from 'events'; | ||
@Injectable() | ||
export class Database extends EventEmitter { | ||
@@ -10,0 +8,0 @@ |
@@ -7,5 +7,3 @@ import 'reflect-metadata'; | ||
import { Database } from './db'; | ||
import { Injectable } from 'injection-js'; | ||
@Injectable() | ||
export class MongoRepository<T> { | ||
@@ -12,0 +10,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25
52203
5
664
+ Addedinversify@^4.3.0
+ Addedinversify@4.14.0(transitive)