New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mikro-orm

Package Overview
Dependencies
Maintainers
1
Versions
3500
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mikro-orm - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

4

dist/BaseEntity.js

@@ -41,3 +41,3 @@ "use strict";

Object.keys(data).forEach(prop => {
if (props[prop].reference === ReferenceType.MANY_TO_ONE && data[prop]) {
if (props[prop] && props[prop].reference === ReferenceType.MANY_TO_ONE && data[prop]) {
if (data[prop] instanceof BaseEntity) {

@@ -54,3 +54,3 @@ return this[prop] = data[prop];

}
const isCollection = [ReferenceType.ONE_TO_MANY, ReferenceType.MANY_TO_MANY].includes(props[prop].reference);
const isCollection = props[prop] && [ReferenceType.ONE_TO_MANY, ReferenceType.MANY_TO_MANY].includes(props[prop].reference);
if (isCollection && Utils_1.Utils.isArray(data[prop])) {

@@ -57,0 +57,0 @@ const items = data[prop].map((item) => {

@@ -53,3 +53,3 @@ import { getMetadataStorage, getEntityManager } from './MikroORM';

Object.keys(data).forEach(prop => {
if (props[prop].reference === ReferenceType.MANY_TO_ONE && data[prop]) {
if (props[prop] && props[prop].reference === ReferenceType.MANY_TO_ONE && data[prop]) {
if (data[prop] instanceof BaseEntity) {

@@ -70,3 +70,3 @@ return this[prop] = data[prop];

const isCollection = [ReferenceType.ONE_TO_MANY, ReferenceType.MANY_TO_MANY].includes(props[prop].reference);
const isCollection = props[prop] && [ReferenceType.ONE_TO_MANY, ReferenceType.MANY_TO_MANY].includes(props[prop].reference);

@@ -73,0 +73,0 @@ if (isCollection && Utils.isArray(data[prop])) {

{
"name": "mikro-orm",
"version": "0.6.0",
"version": "0.6.1",
"description": "Simple typescript mongo ORM for node.js based on data-mapper, unit-of-work and identity-map patterns",

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

@@ -43,4 +43,5 @@ import { ObjectID } from 'bson';

expect(book.author).toBe(jon);
book.assign({ title: 'Better Book 1', author: god });
book.assign({ title: 'Better Book 1', author: god, notExisting: true });
expect(book.author).toBe(god);
expect(book.notExisting).toBe(true);
await orm.em.persist(god);

@@ -47,0 +48,0 @@ book.assign({ title: 'Better Book 2', author: god.id });

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