* For the base to be extensible, both objects must be pure JavaScript objects. * The function assumes that base is undefined, or null or a pure object.
(base, extension)
| 115 | * The function assumes that base is undefined, or null or a pure object. |
| 116 | */ |
| 117 | function extend (base, extension) { |
| 118 | if (isUndefined(base)) { |
| 119 | return copy(extension); |
| 120 | } |
| 121 | if (isUndefined(extension)) { |
| 122 | return copy(base); |
| 123 | } |
| 124 | if (isPureObject(base) && isPureObject(extension)) { |
| 125 | return utils.extendDeep(base, extension); |
| 126 | } |
| 127 | return copy(extension); |
| 128 | } |
| 129 | |
| 130 | function isUndefined (value) { |
| 131 | return typeof value === 'undefined'; |
no outgoing calls
no test coverage detected