Files
memecoin-botV2/.pnpm-store/v10/files/59/430038719f7bed8d4f6b55673d34384ec9caa458f81107049278a3d65d0eff88fb127a43372598c00ba91875af01b623a94065f79109596967edc2041d4868

26 lines
704 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.objectForEachKey = objectForEachKey;
exports.objectMapKey = objectMapKey;
exports.objectReduceKey = objectReduceKey;
function objectForEachKey(obj, callback) {
const keys = Object.keys(obj);
for (const key of keys) {
callback(key);
}
}
function objectMapKey(obj, callback) {
const values = [];
objectForEachKey(obj, key => {
values.push(callback(key));
});
return values;
}
function objectReduceKey(obj, callback, initial) {
let accumulator = initial;
objectForEachKey(obj, key => {
accumulator = callback(accumulator, key);
});
return accumulator;
}