* Makes a clone of an object using only Array or Object as base, * and copies over the own enumerable properties. * * @param {Object} obj * @return {Object} New object with only the own properties (recursively).
(obj)
| 209 | * @return {Object} New object with only the own properties (recursively). |
| 210 | */ |
| 211 | function objectValues(obj) { |
| 212 | var key, |
| 213 | val, |
| 214 | vals = is("array", obj) ? [] : {}; |
| 215 | for (key in obj) { |
| 216 | if (hasOwn.call(obj, key)) { |
| 217 | val = obj[key]; |
| 218 | vals[key] = val === Object(val) ? objectValues(val) : val; |
| 219 | } |
| 220 | } |
| 221 | return vals; |
| 222 | } |
| 223 | |
| 224 | function extend(a, b, undefOnly) { |
| 225 | for (var prop in b) { |