To check if a class is valid, I use this portion of code:

if pcall(function()
	Instance.new(Class):Destroy()
end) then
	print(Class, "is a valid class!")
end

However, when I want to see if the :IsA only classes, such as "ValueBase", creating a new instance with that class will error, and the class will always be invalid. My first thought was to check if :IsA would error, but it just returns false if its not a valid class. How would I achieve this without storing all the :IsA values inside a table somewhere?