v2.0.0 Different implementation for node.js and the browser
This version uses two different implementations for Node and browser.
Node.js: The function uses the Buffer.from(objectToString) method to convert the string representation of the object to a buffer, and then it uses the byteLength property to obtain the size of the buffer in bytes.
Browser implementation uses a combination of recursion and a stack to iterate through all of its properties, adding up the number of bytes for each data type it encounters.