source: frontend/node_modules/css-tree/lib/common/adopt-buffer.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 364 bytes
Line 
1var MIN_SIZE = 16 * 1024;
2var SafeUint32Array = typeof Uint32Array !== 'undefined' ? Uint32Array : Array; // fallback on Array when TypedArray is not supported
3
4module.exports = function adoptBuffer(buffer, size) {
5 if (buffer === null || buffer.length < size) {
6 return new SafeUint32Array(Math.max(size + 1024, MIN_SIZE));
7 }
8
9 return buffer;
10};
Note: See TracBrowser for help on using the repository browser.