- const view = new DataView(values.buffer);
- return [
- view.getUint32(0) >>> 2, // drop the final 2 bits
- view.buffer,
- ];
- })()
- : [$ >>> 0 & -1 >>> 2, null];
+ const { buffer } = values;
+ return {
+ number: new DataView(buffer).getUint32(0) >>> 2,
+ buffer,
+ };
+ } else {
+ // A value was provided, so a buffer needs to be generated.
+ const number = $ & -1 >>> 2;
+ const buffer = new ArrayBuffer(4);
+ new DataView(buffer).setUint32(0, number << 2, false);
+ return { number, buffer };
+ }
+ })();