@microsoft/paris
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -79,10 +79,3 @@ import { ModelBase } from "../config/model.base"; | ||
propertyEntityValues.forEach(function (propertyEntityValue) { return Object.assign(modelData, propertyEntityValue); }); | ||
var model; | ||
try { | ||
model = new entity.entityConstructor(modelData, rawData); | ||
} | ||
catch (e) { | ||
getModelDataError.message = getModelDataError.message + " Error: " + e.message; | ||
throw getModelDataError; | ||
} | ||
var model = instantiateModel(); | ||
_this.setModelLinks(model); | ||
@@ -93,5 +86,8 @@ return model; | ||
else { | ||
var model = void 0; | ||
model$ = of(instantiateModel()); | ||
} | ||
return entity.readonly ? model$.pipe(map(function (model) { return Object.freeze(model); })) : model$; | ||
function instantiateModel() { | ||
try { | ||
model = new entity.entityConstructor(modelData, rawData); | ||
var model = new entity.entityConstructor(modelData, rawData); | ||
if (Object.isFrozen(model) || Object.isSealed(model)) | ||
@@ -102,2 +98,3 @@ console.warn("Can't assign data to " + entity.singularName + ", since it's frozen or sealed."); | ||
model._init(modelData, rawData); | ||
return model; | ||
} | ||
@@ -108,5 +105,3 @@ catch (e) { | ||
} | ||
model$ = of(model); | ||
} | ||
return entity.readonly ? model$.pipe(map(function (model) { return Object.freeze(model); })) : model$; | ||
}; | ||
@@ -113,0 +108,0 @@ Modeler.prototype.validateFieldData = function (entityField, rawData) { |
{ | ||
"name": "@microsoft/paris", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Library for the implementation of Domain Driven Design with TypeScript + RxJS", | ||
@@ -5,0 +5,0 @@ "repository": { |
251242
5139