Registering required RPs from template metadata (1588437, 2002449)

Why are you calling the string constructor her? Is the object not a string already? If so, why not, and is a blanket string conversion the right thing to do?

Also, the idiomatic way to do this in JavaScript is to call .toString() method, not the String() constructor.