update tests

This commit is contained in:
2017-09-13 13:47:38 +02:00
parent c74873d02c
commit 14042151ba
5 changed files with 13 additions and 13 deletions

View File

@ -52,7 +52,7 @@ export class DbDoc<T> {
* saves this instance but not any connected items
* may lead to data inconsistencies, but is faster
*/
save() {
save () {
let saveableObject: any = {} // is not exposed to outside, so any is ok here
for (let propertyNameString of this.saveableProperties) {
saveableObject[ propertyNameString ] = this[ propertyNameString ]
@ -70,14 +70,14 @@ export class DbDoc<T> {
* also store any referenced objects to DB
* better for data consistency
*/
saveDeep(savedMapArg: Objectmap<DbDoc<any>> = null) {
saveDeep (savedMapArg: Objectmap<DbDoc<any>> = null) {
if (!savedMapArg) {
savedMapArg = new Objectmap<DbDoc<any>>()
}
savedMapArg.add(this)
this.save()
for (let propertyKey in this) {
let property = this[ propertyKey ]
let property: any = this[ propertyKey ]
if (property instanceof DbDoc && !savedMapArg.checkForObject(property)) {
property.saveDeep(savedMapArg)
}