Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/wa.picotech.app/public_html/node_modules/@whiskeysockets/baileys/lib/Store/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function makeOrderedDictionary(idGetter) {
const array = [];
const dict = {};
const get = (id) => dict[id];
const update = (item) => {
const id = idGetter(item);
const idx = array.findIndex(i => idGetter(i) === id);
if (idx >= 0) {
array[idx] = item;
dict[id] = item;
}
return false;
};
const upsert = (item, mode) => {
const id = idGetter(item);
if (get(id)) {
update(item);
}
else {
if (mode === 'append') {
array.push(item);
}
else {
array.splice(0, 0, item);
}
dict[id] = item;
}
};
const remove = (item) => {
const id = idGetter(item);
const idx = array.findIndex(i => idGetter(i) === id);
if (idx >= 0) {
array.splice(idx, 1);
delete dict[id];
return true;
}
return false;
};
return {
array,
get,
upsert,
update,
remove,
updateAssign: (id, update) => {
const item = get(id);
if (item) {
Object.assign(item, update);
delete dict[id];
dict[idGetter(item)] = item;
return true;
}
return false;
},
clear: () => {
array.splice(0, array.length);
Object.keys(dict).forEach(key => {
delete dict[key];
});
},
filter: (contain) => {
let i = 0;
while (i < array.length) {
if (!contain(array[i])) {
delete dict[idGetter(array[i])];
array.splice(i, 1);
}
else {
i += 1;
}
}
},
toJSON: () => array,
fromJSON: (newItems) => {
array.splice(0, array.length, ...newItems);
}
};
}
exports.default = makeOrderedDictionary;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0032 ]-- |