Class GTINValidator

GTIN validator.

Hierarchy

  • AbstractNumericIdentificationKeyValidator
    • GTINValidator

Constructors

Accessors

  • get length(): number
  • Returns number

Methods

  • Zero expand a zero-suppressed GTIN-12.

    Parameters

    • zeroSuppressedGTIN12: string

      Zero-suppressed GTIN-12.

    Returns string

    GTIN-12.

  • Validate any GTIN, optionally against a level.

    Parameters

    • gtin: string

      GTIN.

    • gtinLevel: GTINLevel = GTINLevel.Any

      Level at which GTIN is to be validated.

    Returns void

  • Validate a GTIN-14.

    Parameters

    • gtin14: string

      GTIN-14.

    Returns void

  • Pad an identification key on the left with zeroes for validation purposes. This is done to align an identification key with a position offset for any error message that may be thrown by the reference validator.

    Parameters

    • identificationKey: string

      Identification key.

    • validation: undefined | IdentificationKeyValidation

      Identification key validation parameters.

    Returns string

    Padded identification key.

  • Parameters

    • partialIdentificationKey: string
    • OptionalpositionOffset: number

    Returns void

  • Parameters

    Returns void