@microsoft/paris
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -174,3 +174,3 @@ import { ModelBase } from "../config/model.base"; | ||
} | ||
if (entityFieldRawData && !(entityFieldRawData instanceof ModelBase)) { | ||
if (entityFieldRawData !== undefined && entityFieldRawData !== null && !(entityFieldRawData instanceof ModelBase)) { | ||
var fieldData$ = this.getSubModel(entityField, entityFieldRawData, options); | ||
@@ -177,0 +177,0 @@ if (fieldData$) |
{ | ||
"name": "@microsoft/paris", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Library for the implementation of Domain Driven Design in Angular/TypeScript apps", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -6,2 +6,3 @@ import {Entity} from "../../lib/config/decorators/entity.decorator"; | ||
export const todoStatusValues = [ | ||
{ id: 0, name: 'Pending' }, | ||
{ id: 1, name: "Open" }, | ||
@@ -8,0 +9,0 @@ { id: 2, name: "In progress" }, |
@@ -17,2 +17,3 @@ import {Observable, of} from 'rxjs'; | ||
import {EntityField} from "../../lib/config/decorators/entity-field.decorator"; | ||
import {TodoStatus} from "../mock/todo-status.entity"; | ||
@@ -100,2 +101,16 @@ describe('Modeler', () => { | ||
}); | ||
it("assigns a sub-model that has id === 0 from values", done => { | ||
const todoRawData = { | ||
id: 6, | ||
text: 'Pending...', | ||
time: 1534433193347, | ||
status: 0 | ||
}; | ||
paris.modeler.modelEntity(todoRawData, todoEntityConfig).subscribe(todoItem => { | ||
expect(todoItem.status).toBeInstanceOf(TodoStatus); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
@@ -102,0 +117,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
239610
4894