VulpesOS/gaia/apps/calendar/js/common/object.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

36 lines
695 B
JavaScript
Executable file

define(function(require, exports, module) {
'use strict';
exports.filter = function(obj, fn, thisArg) {
var results = [];
exports.forEach(obj, function(key, value) {
if (fn.call(thisArg, key, value)) {
results.push(value);
}
});
return results;
};
exports.forEach = function(obj, fn, thisArg) {
exports.map(obj, fn, thisArg);
};
exports.map = function(obj, fn, thisArg) {
var results = [];
Object.keys(obj).forEach((key) => {
var value = obj[key];
var result = fn.call(thisArg, key, value);
results.push(result);
});
return results;
};
exports.values = function(obj) {
return exports.map(obj, (key, value) => {
return value;
});
};
});