Urara-Blog/node_modules/.pnpm-store/v3/files/78/37def1b75b4c862da5a3e60217a1ac3c75b601b09200b63c1172982ff049f2e9d9f326f7551e75bd9b11758c3a080ba60575aa09e1140708134412a916ddc3
2022-08-14 01:14:53 +08:00

9 lines
225 B
Text

const MIN_SIZE = 16 * 1024;
export function adoptBuffer(buffer = null, size) {
if (buffer === null || buffer.length < size) {
return new Uint32Array(Math.max(size + 1024, MIN_SIZE));
}
return buffer;
};