Skip to content

Commit 99fad46

Browse files
committed
fix: Error too many function arguments.
1 parent 13e53cc commit 99fad46

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/woff-to-otf.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,21 @@ function woff_to_otf(buffer) {
107107
// , new ArrayBuffer(padding)
108108
// );
109109
out.push(
110-
...p.parseByteList(tableEntry.length)
111-
, ...Array(padding).fill(0) // new ArrayBuffer(padding)
110+
p.parseByteList(tableEntry.length)
111+
, Array(padding).fill(0) // new ArrayBuffer(padding)
112112
);
113113
}
114+
const outFlat = out.flat();
114115

115116
// const result = new Uint8Array(buffers.reduce((accum, buffer)=>accum+buffer.byteLength, 0));
116117
// buffers.reduce((offset, buffer)=>{
117118
// result.set(buffer, offset)
118119
// return offset + buffer.byteLength
119120
// }, 0)
120121
// return result.buffer;
121-
const outArray = new Uint8Array(out.length);
122-
for (let i=0,l=out.length; i<l; i++)
123-
outArray[i] = out[i];
122+
const outArray = new Uint8Array(outFlat.length);
123+
for (let i=0,l=outFlat.length; i<l; i++)
124+
outArray[i] = outFlat[i];
124125
return outArray.buffer;
125126
}
126127

0 commit comments

Comments
 (0)