[AAE-622] No implicit returns (#5157)

* enable noImplicitReturns rule

* type fixes

* fix return types

* fix return value

* fix tests

* fix visibility service

* update tests

* add missing types

* fix test
This commit is contained in:
Denys Vuika
2019-10-17 09:35:39 +01:00
committed by GitHub
parent 48aca2d30f
commit d7ab0417b8
65 changed files with 366 additions and 319 deletions

View File

@@ -59,14 +59,18 @@ export class LockService {
return node.properties['cm:lockType'] === 'WRITE_LOCK' && node.properties['cm:lockLifetime'] === 'PERSISTENT';
}
private getLockExpiryTime(node: Node): Moment {
private getLockExpiryTime(node: Node): Moment | undefined {
if (node.properties['cm:expiryDate']) {
return moment(node.properties['cm:expiryDate'], 'yyyy-MM-ddThh:mm:ssZ');
}
return undefined;
}
private isLockExpired(node: Node): boolean {
const expiryLockTime = this.getLockExpiryTime(node);
return moment().isAfter(expiryLockTime);
if (expiryLockTime) {
return moment().isAfter(expiryLockTime);
}
return false;
}
}