Binary Raw - Docs
    Preparing search index...

    Function isFormat

    • Type guard to narrow FormatMetadata to a specific format.

      Type Parameters

      Parameters

      • meta: FormatMetadata

        The format metadata to check.

      • format: F

        The expected format string.

      Returns meta is
          | Extract<
              { class: 32
              | 64; endian: "le" | "be"; format: "ELF" },
              { format: F },
          >
          | Extract<{ format: "PE"; peType: "PE32" | "PE32+" }, { format: F }>
          | Extract<{ cpuType: string; format: "MACHO" }, { format: F }>
          | Extract<{ format: "PDF"; version: string }, { format: F }>
          | Extract<{ format: "PNG"; height: number; width: number }, { format: F }>
          | Extract<{ format: "JPEG"; height: number; width: number }, { format: F }>
          | Extract<{ entries: number; format: "ZIP" }, { format: F }>
          | Extract<{ entropy: number; format: "BIN" }, { format: F }>

      True if meta matches the expected format.