Function isDevice

Checks if the current environment is a device (browser). Logs an error if the function is called outside of a Node.js environment.