import { ValidationCondition } from "./ValidationCondition" ; export class WhenDefinedCondition < T > implements ValidationCondition < T > { constructor ( private expression ) { } shouldDoValidation ( input ) { try { return typeof this . expression ( input ) !== "undefined" ; } catch ( e ) { return false ; } } }