Permalink
Browse files

fix(UnitOfWork): fix typings

  • Loading branch information...
Rawphs
Rawphs committed Apr 8, 2018
1 parent 4c68853 commit d094679ec884480886fb052f5315f413fb9c3cf6
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/UnitOfWork.ts
@@ -1012,10 +1012,17 @@ export class UnitOfWork {
* @returns {UnitOfWork}
*/
public clear(...entities: Array<EntityInterface | ProxyInterface>): UnitOfWork {
(entities.length ? entities : this.newObjects).forEach(created => this.clearEntityState(created));
(entities.length ? entities : this.deletedObjects).forEach(deleted => this.clearEntityState(deleted));
(entities.length ? entities : this.cleanObjects).forEach(clean => this.clearEntityState(clean));
(entities.length ? entities : this.relationshipsChangedObjects).forEach(changed => this.clearEntityState(changed));
(<Array<EntityInterface | ProxyInterface>>(entities.length ? entities : this.newObjects))
.forEach((created: EntityProxy) => this.clearEntityState(created));
(<Array<EntityInterface | ProxyInterface>>(entities.length ? entities : this.deletedObjects))
.forEach(deleted => this.clearEntityState(deleted));
(<Array<EntityInterface | ProxyInterface>>(entities.length ? entities : this.cleanObjects))
.forEach(clean => this.clearEntityState(clean));
(<Array<EntityInterface | ProxyInterface>>(entities.length ? entities : this.relationshipsChangedObjects))
.forEach(changed => this.clearEntityState(changed));
if (entities.length) {
this.relationshipsChangedObjects.remove(...entities);

0 comments on commit d094679

Please sign in to comment.