Skip to content

0.13.0 ​

The compound-file reader now accepts irregularities that real writers produce, as long as accepting them cannot change stream content. These are a byte-order mark other than 0xFFFE, trailing bytes or a final sector trimmed of padding, uninitialized v3 stream-size high bits, mini-FAT header count drift, a malformed chain terminator after every advertised byte, and stale, dangling or cyclic directory links. Each one is reported in warnings, and { strict: true } restores rejection. Stream bytes are never truncated, zero-filled or invented: a stream whose allocation cannot supply its advertised size still throws. Format detection and the path reader apply the same read-only relaxations and validate only the requested stream, so unrelated damage no longer hides WordDocument, Workbook or PowerPoint Document. In-place stream edits and resizing remain strict.

Directory entries expose id, path, parentId, color, stateBits, created and modified. Sibling and child links refer to id, not to positions in entries. getStream now prefers a root stream over a same-named stream inside an embedded storage, and falls back to a case-insensitive match. The new getStreamByPath, getStreamById and findEntry resolve nested storages case-insensitively and accept property-set names without their control prefix. Document models expose the same members as detached copies.

buildCompoundFile writes v3 containers with nested storages, per-entry CLSIDs, state bits and timestamps, and name-ordered balanced sibling trees. listCompoundFile returns editable nodes, so entries can be added, deleted or moved by rebuilding. repairCompoundFile rewrites a leniently readable file canonically. It keeps names and metadata, discards stale slots, and either throws on an unreadable stream or, with dropUnreadable, omits it and lists it in dropped. buildOle2 and the PPT writer layout are unchanged.

salvagePptText recovers read-only slide text from damaged decks. It tries three modes in order: the exact active model, then a scan for the newest save record (for a wrong Current User offset), then a slide-container scan that may include superseded saves. It reports the mode used and refuses encrypted documents.

Behaviour changes: inputs that previously threw may now parse with warnings, and getStream resolves root streams first. ZIP and MHT containers remain out of scope.

Released under the Apache-2.0 License.