• Preparing search index...
  • The search index is not available
Documentation
  • Documentation
  • @sequelize/core
  • decorators-legacy
  • ValidateAttribute

Function ValidateAttribute

  • ValidateAttribute(options): PropertyOrGetterDescriptor
  • Used to register a function that will be called when an attribute is being validated.

    Parameters

    • options: ColumnValidateOptions

    Returns PropertyOrGetterDescriptor

    Example

    class User extends Model {
    @Attribute(DataTypes.STRING)
    @ValidateAttribute({
    myCustomValidator: () => {
    // this function will run when this attribute is validated.
    },
    })
    declare name: string;
    }

    See also ModelValidator.

    • Defined in packages/core/src/decorators/legacy/validation.ts:29

Settings

Member Visibility

Theme

Documentation
  • Loading...

Generated using TypeDoc