(obj, target, overwrite)
| 4 | } |
| 5 | |
| 6 | export function copyObj(obj, target, overwrite) { |
| 7 | if (!target) target = {} |
| 8 | for (let prop in obj) |
| 9 | if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) |
| 10 | target[prop] = obj[prop] |
| 11 | return target |
| 12 | } |
| 13 | |
| 14 | // Counts the column offset in a string, taking tabs into account. |
| 15 | // Used mostly to find indentation. |
no outgoing calls
no test coverage detected