Sha256: 47bf0b0b88bfa0f2de51049e196442445e32e5a152f27917f5333a9fff014c8f
Contents?: true
Size: 598 Bytes
Versions: 375
Compression:
Stored size: 598 Bytes
Contents
/** * Deeply clones an object or array * @param {Mixed} obj The object/array to clone * @return {Mixed} A clone of the initial object or array */ axe.utils.clone = function(obj) { /* eslint guard-for-in: 0*/ 'use strict'; var index, length, out = obj; if (obj !== null && typeof obj === 'object') { if (Array.isArray(obj)) { out = []; for (index = 0, length = obj.length; index < length; index++) { out[index] = axe.utils.clone(obj[index]); } } else { out = {}; for (index in obj) { out[index] = axe.utils.clone(obj[index]); } } } return out; };
Version data entries
375 entries across 375 versions & 1 rubygems