From fee0bb3eb157fa21f293def819a0a6aa1190763e Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Wed, 15 May 2024 01:57:53 +0200 Subject: [PATCH] Validation singles & schemas now have names --- src/validation.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/validation.gd b/src/validation.gd index cb819a9..68d0761 100644 --- a/src/validation.gd +++ b/src/validation.gd @@ -62,17 +62,20 @@ func _schedule() -> void: ## Returns a new [CoreValidationSingle]. func get_single(data, parent: Node) -> CoreValidationSingle: var single: CoreValidationSingle = CoreValidationSingle.new(core, data, parent) + single.name = core.stringify_variables("CoreValidationSingle -> %parent% (type=%type% bytes=%bytes%)", { "parent": parent, "type": type_string(typeof(data)), "bytes": var_to_bytes_with_objects(data).size() }) singles.append(single) return single ## Returns a new [CoreValidationSingle] for use in [CoreValidationSchema]s. func get_single_schema(parent: Node) -> CoreValidationSingle: var single: CoreValidationSingle = CoreValidationSingle.new(core, null, parent) + single.name = core.stringify_variables("CoreValidationSingle -> %parent% (no data, for schema)", { "parent": parent }) singles.append(single) return single ## Returns a new [CoreValidationSchema]. func get_schema(schema_new: Dictionary, data_new: Dictionary, parent: Node) -> CoreValidationSchema: var schema: CoreValidationSchema = CoreValidationSchema.new(core, schema_new, data_new, parent) + schema.name = core.stringify_variables("CoreValidationSchema -> %parent% (keys_schema=%keys_schema% keys_data=%keys_data% bytes_schema=%bytes_schema% bytes_data=%bytes_data%)", { "parent": parent, "keys_schema": schema_new.size(), "keys_data": data_new.size(), "bytes_schema": var_to_bytes_with_objects(schema_new).size(), "bytes_data": var_to_bytes_with_objects(data_new).size() }) schemas.append(schema) return schema