The value or array of values to match against the decorated property value.
Optionalopt: Partial<ValidatorOptions>Optional configuration.
The property decorator function.
The most simple use case is to compare to a number.
class Header {
   @Match(0xFE)
   @Uint8
   magic: number,
}
The @Match decorator can also be used to match arrays.
class Header {
   @Match([0xBE, 0xEF])
   @Count(2)
   @Uint8
   magic: number[],
}
Or to check the value is one of the value from an array passed as a parameter.
class Header {
   @Match([1, 8, 16])
   @Uint8
   magic: number,
}
Or an ASCII string.
class Header {
   @Match('.PNG')
   @Count(4)
   @Ascii
   magic: string,
}
@Matchdecorator validates that the value of the decorated property matches a specified value.This is commonly used to enforce "magic numbers" or other fixed values in binary formats that help verify file structure or integrity.