Server IP : 162.213.251.212 / Your IP : 18.190.25.139 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/home/allssztx/public_html/easybuyer/node_modules/collect.js/src/methods/ |
Upload File : |
'use strict'; module.exports = function chunk(size) { const chunks = []; let index = 0; if (Array.isArray(this.items)) { do { const items = this.items.slice(index, index + size); const collection = new this.constructor(items); chunks.push(collection); index += size; } while (index < this.items.length); } else if (typeof this.items === 'object') { const keys = Object.keys(this.items); do { const keysOfChunk = keys.slice(index, index + size); const collection = new this.constructor({}); keysOfChunk.forEach(key => collection.put(key, this.items[key])); chunks.push(collection); index += size; } while (index < keys.length); } else { chunks.push(new this.constructor([this.items])); } return new this.constructor(chunks); };