Implemented optional type-check for raw JavaScript