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

typeodm

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typeodm - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

2

package.json
{
"name": "typeodm",
"version": "0.0.12",
"version": "0.0.13",
"description": "ODM for MongoDB used Typescript",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -49,4 +49,7 @@ 'use strict';

return documentPromise.then(function (document) {
if (!document && documentId) throw new Error('Document ' + schema.name + ' with given id ' + documentId + ' was not found');
if (!document && documentConditions) throw new Error('Document ' + schema.name + ' with given conditions ' + JSON.stringify(documentConditions) + ' was not found');
if (!document) document = schema.create();
//if (!document && documentId)
//throw new Error('Document ' + schema.name + ' with given id ' + documentId + ' was not found');
//if (!document && documentConditions)
//throw new Error('Document ' + schema.name + ' with given conditions ' + JSON.stringify(documentConditions) + ' was not found');
return Promise.all(Object.keys(object).filter(function (key) {

@@ -53,0 +56,0 @@ return schema.hasFieldOrRelationWithPropertyName(key);

@@ -13,4 +13,2 @@ "use strict";

var _exceptionNoDocumentWithSuchIdException = require("../exception/NoDocumentWithSuchIdException");
/**

@@ -51,3 +49,4 @@ * Helps to remove a document and all its relations by given cascade operations.

return this.connection.driver.findOneById(schema.name, documentId).then(function (dbObject) {
if (!dbObject) throw new _exceptionNoDocumentWithSuchIdException.NoDocumentWithSuchIdException(documentId, schema.name);
if (!dbObject) return Promise.resolve();
//throw new NoDocumentWithSuchIdException(documentId, schema.name);
// iterate throw each key in the document and find relations to compute removals of

@@ -119,3 +118,4 @@ var promises = Object.keys(dbObject).map(function (originalDocumentProperty) {

return this.connection.driver.findOneById(schema.name, documentId).then(function (dbObject) {
if (!dbObject) throw new _exceptionNoDocumentWithSuchIdException.NoDocumentWithSuchIdException(documentId, schema.name);
if (!dbObject) return Promise.resolve();
// throw new NoDocumentWithSuchIdException(documentId, schema.name);
// iterate throw each key in the db document and find relations to compute removals of

@@ -122,0 +122,0 @@ var promises = Object.keys(dbObject).map(function (originalDocumentProperty) {

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