Skip to content

Commit eb9ff73

Browse files
committed
make struct constructor a default export
1 parent 2897bfb commit eb9ff73

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

struct.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const lut = le => ({
2424
})
2525
const errbuf = new RangeError("Structure larger than remaining buffer")
2626
const errval = new RangeError("Not enough values for structure")
27-
export const struct = format => {
27+
export default function struct(format) {
2828
let fns = [], size = 0, m = rechk.exec(format)
2929
if (!m) { throw new RangeError("Invalid format string") }
3030
const t = lut('<' === m[1]), lu = (n, c) => t[c](n ? parseInt(n, 10) : 1)

test/test.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import should from "should";
33
should();
44

5-
import { struct } from "../struct.mjs";
5+
import struct from "../struct.mjs";
66
describe('struct', () => {
77
let ab = new ArrayBuffer(100)
88
let u8a = new Uint8Array(ab)

0 commit comments

Comments
 (0)