'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

var _typeof2 = require('babel-runtime/helpers/typeof');

var _typeof3 = _interopRequireDefault(_typeof2);

exports.deepClone = deepClone;

var _deepAssign = require('./deep-assign');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

function deepClone(obj) {
    if (Array.isArray(obj)) {
        return obj.map(function (item) {
            return deepClone(item);
        });
    }

    if ((typeof obj === 'undefined' ? 'undefined' : (0, _typeof3['default'])(obj)) === 'object') {
        return (0, _deepAssign.deepAssign)({}, obj);
    }

    return obj;
}