| 568 | } |
| 569 | |
| 570 | const normalizeFunc = function (func_thing, object) { |
| 571 | // func could be a string to a function in this class |
| 572 | // or a function in its own right |
| 573 | if (object == null) { object = {} } |
| 574 | if (_.isString(func_thing)) { |
| 575 | const func = object[func_thing] |
| 576 | if (!func) { |
| 577 | console.error(`Could not find method ${func_thing} in object`, object) |
| 578 | return () => null // always return a func, or Mediator will go boom |
| 579 | } |
| 580 | func_thing = func |
| 581 | } |
| 582 | return func_thing |
| 583 | } |
| 584 | |
| 585 | const objectIdToDate = objectID => new Date(parseInt(objectID.toString().slice(0, 8), 16) * 1000) |
| 586 | |