public validate()

in src/construct.ts [356:370]


  public validate(): string[] {
    const deprecated = ['validate', 'onValidate', 'synthesize', 'onSynthesize', 'prepare', 'onPrepare'];
    for (const method of deprecated) {
      if (typeof((this.host as any)[method]) === 'function') {
        throw new Error(`the construct "${this.path}" has a "${method}()" method which is no longer supported. Use "construct.node.addValidation()" to add validations to a construct`);
      }
    }

    const errors = new Array<string>();
    for (const v of this._validations) {
      errors.push(...v.validate());
    }

    return errors;
  }