There are already a few packages that do this, my suggestion is `fclone` package... I wrote `safe-clone-deep`, which inspired fclone, at this point fclone is more mature and thorough.
NOTE: if you're using babel/webpack for building and using fclone, you may want to make sure the Buffer shim isn't loaded by using the webpack null loader or otherwise specifying it. There is a test for Buffer for the clone operation(s).