- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
export namespace Ext {
export function isEmpty(obj: any): boolean {
return (typeof obj === "undefined" || obj === null || obj === "");
}
export function setReadonly(flag: boolean, ...args: any[]): void {
args.length > 0 ? (flag ? args.forEach(arg => !isEmpty(arg) ? arg.setDisabled(false) : null) :
args.forEach(arg => !isEmpty(arg) ? arg.setDisabled(true) : null)) : null;
}
export function filterInt(value) {
if (isStrToInt(value))
return Number(value);
return NaN;
}
export function isStrToInt(value: string): boolean {
return /^(-|\+)?(\d+|Infinity)$/.test(value) ? true : false;
}
}