(target, path)
| 689 | } |
| 690 | |
| 691 | const getByPath = function (target, path) { |
| 692 | if (!target) { throw new Error('Expected an object to match a query against, instead got null') } |
| 693 | const pieces = path.split('.') |
| 694 | let obj = target |
| 695 | for (const piece of Array.from(pieces)) { |
| 696 | if (!(piece in obj)) { return undefined } |
| 697 | obj = obj[piece] |
| 698 | } |
| 699 | return obj |
| 700 | } |
| 701 | |
| 702 | const isID = id => _.isString(id) && (id.length === 24) && (__guard__(id.match(/[a-f0-9]/gi), x1 => x1.length) === 24) |
| 703 |
nothing calls this directly
no outgoing calls
no test coverage detected