semantic-analysis
Version:
Extensible semantic Structured Data analysis library for Microdata and JSON-LD
21 lines • 540 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.map = void 0;
/**
* Maps all own properties to a function and
* creates new object accordingly
* *
* @param object Input object
* @param callback Mapper callback function
*/
function map(object, callback) {
var result = {};
for (var key in object) {
if (object.hasOwnProperty(key)) {
result[key] = callback(object[key], key, object);
}
}
return result;
}
exports.map = map;
//# sourceMappingURL=map.js.map