@zip.js/zip.js
    Preparing search index...

    Function isZipFile

    • Returns true if the data looks like a zip file, i.e. if ZipReader#getEntries called on the same data with the same options would locate the archive structure instead of throwing ERR_EOCDR_NOT_FOUND or the ERR_AMBIGUOUS_ARCHIVE error caused by appended data.

      Parameters

      Returns Promise<boolean>

      A promise resolving to true if the data looks like a zip file.

      The probe runs the same search as ZipReader: it locates the end of central directory record with the end-anchored backward scan and verifies that a central directory record is stored where it points, without parsing the entries. true therefore means the data is a plausible zip container, not that every entry can be read: a truncated or otherwise damaged central directory is only detected by calling ZipReader#getEntries. Formats built on zip, e.g. office documents or Java archives, return true.

      Like the ZipReader constructor, a ReadableStream or an object providing only a readable property is buffered entirely in memory before probing, which defeats the purpose of a cheap probe; prefer a seekable Reader input.