I think it would be more readable this way:
`class_name = "type-" + (['array', 'string', 'object'].indexOf(obj.type) < 0 ? "auto" : obj.type)`