Update lib/types/Object.js

optimize toObject by inlining "Type(V)" emulation