fix: Allow reregistering fields. (#9290)

This commit is contained in:
Aaron Dodson
2025-08-22 14:55:07 -07:00
committed by GitHub
parent dd05c8de2f
commit 3b498d1384

View File

@@ -56,11 +56,11 @@ export interface RegistrableField {
* @param type The field type name as used in the JSON definition. * @param type The field type name as used in the JSON definition.
* @param fieldClass The field class containing a fromJson function that can * @param fieldClass The field class containing a fromJson function that can
* construct an instance of the field. * construct an instance of the field.
* @throws {Error} if the type name is empty, the field is already registered, * @throws {Error} if the type name is empty or the fieldClass is not an object
* or the fieldClass is not an object containing a fromJson function. * containing a fromJson function.
*/ */
export function register(type: string, fieldClass: RegistrableField) { export function register(type: string, fieldClass: RegistrableField) {
registry.register(registry.Type.FIELD, type, fieldClass); registry.register(registry.Type.FIELD, type, fieldClass, true);
} }
/** /**