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