- Add
toJSON()method toStructsoJSON.stringify(struct)works out of the box, serializing all enumerable inherited fields. - Add
ARCHITECTURE.mddocumenting design trade-offs (property descriptors vs proxies vs instance descriptors).
- Align release publishing so npm and JSR stay version-synchronized.
- BREAKING:
Structno longer callsObject.preventExtensions()during construction. If you want non-extensible instances, callObject.preventExtensions()yourself after object construction.
- cc3b63a — Fix fromDataView: enumerable, complete comment, optional setter, readonly inference (#5)
- 6367cf8 — minor fixes
- 8149f55 — type defineArray with item method instead of element
- 338cc56 — ci: test in Node and Bun
- 703ee48 — Support static
.allocmethod and staticBYTE_LENGTHfield for fixed-sized structs
- a92e393 — infer fields with no setter as readonly
- ca94807 — Make
instanceof Structwork better when bundled
- d8ea5bd —
defineStructwill now make properties enumerable if not specified
- 345f6a4 — export bigendian module in npm build
- ccc734e — Add bigendian to main module exports
- feaf6c3 — Move
fromDataViewtofields
- 980b488 — Support native TypedArray fields
- a7abdfa — reorganize - no functional changes
- 8bd28e5 — Another fix for Node tests
- 84f20aa — fix for running tests under Node
- f2b19b8 — bigint
- 8c1bd00 — tighten up types
- 5b337ab — better typing for array types
- 9e6d578 — 0.7.1
- 1849e1b — Publish to npm
- ba74096 — 0.6.1
- e64aebd — Add 1-byte boolean field declarator
- caace83 — Struct constructor can allocate a struct if no buffer provided
- d9966ea — Document arrays better
- 9145818 — document bigendian
- 802cd20 — Add big-endian support
- 298a70e — Support dynamic-length arrays
- 9a4e60c — Add support for statically-sized array of struct
- 48a48c4 — fix property descriptor typing
- 3d626b3 — Move example to readme
- b4c4106 — wip