UNPKG

interactjs

Version:

Drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)

14 lines (12 loc) 276 B
const is = require('./is'); module.exports = function clone (source) { const dest = {}; for (const prop in source) { if (is.plainObject(source[prop])) { dest[prop] = clone(source[prop]); } else { dest[prop] = source[prop]; } } return dest; };