Files
BeWoPlaner/BeWoPlanerMobil/node_modules/utilise/to.js
Lyndon Jetten fda2c306b5 MoK: Report Viewer hinzugefügt
FaC: Das alte Flag von Terminen, die in die Zeiterfassung übernommen worden sind, wird ebenfalls berücksichtigt.
2023-03-13 19:39:04 +01:00

25 lines
399 B
JavaScript

var is = require('./is')
module.exports = {
arr: toArray
, obj: toObject
}
function toArray(d){
return Array.prototype.slice.call(d, 0)
}
function toObject(d) {
var by = 'id'
, o = {}
return arguments.length == 1
? (by = d, reduce)
: reduce.apply(this, arguments)
function reduce(p,v,i){
if (i === 0) p = {}
p[is.fn(by) ? by(v, i) : v[by]] = v
return p
}
}