(target: any, objects: any | any[])
| 5 | * @return {Object} - return target object |
| 6 | */ |
| 7 | export function assign(target: any, objects: any | any[]): any { |
| 8 | if (!Array.isArray(objects)) { |
| 9 | objects = [ objects ]; |
| 10 | } |
| 11 | |
| 12 | for (let i = 0; i < objects.length; i++) { |
| 13 | const obj = objects[i]; |
| 14 | if (obj) { |
| 15 | const keys = Object.keys(obj); |
| 16 | for (let j = 0; j < keys.length; j++) { |
| 17 | const key = keys[j]; |
| 18 | target[key] = obj[key]; |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | return target; |
| 23 | } |
| 24 | |
| 25 | export function has(obj: object, prop: string) { |
| 26 | return Object.prototype.hasOwnProperty.call(obj, prop); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…