Structure tester
[data/dictionary/Structure tester]
Tests whether a dictionary has the same structure as another one. Values are ignored.
If strict
is set, extra properties are not tolerated, the provided dictionaries must have the same keys.
Example A:
{ "first": 1, "third": 3, "fifth": 5 } @0 received via
dict
{ "first": 0, "fifth": 0 }@0 received via
structure
strict
is set to falsematches
sends true@0
Example B:
{ "first": 1, "third": 3, "fifth": 5 } @0 received via
dict
{ "first": 0, "seventh": 0 }@0 received via
structure
strict
is set to falsematches
sends false@0
Example C:
{ "first": 1, "third": 3, "fifth": 5 } @0 received via
dict
{ "first": 0, "fifth": 0 }@0 received via
structure
strict
is set to truematches
sends false@0
Keywords: dictionary, dict, structure, compare, validate, equals
Input ports
dict:
{string: any}
Receives the dictionary to test. Example: { "first": 1, "third": 3, "fifth": 5 }
structure:
{string: any}
Receives the dictionary with the reference structure, to which the comparison will be made. Example: { "first": 0, "fifth": 0 }
strict:
boolean
Receives whether extra keys in
dict
are allowed. Example: true
Output ports
matches:
boolean
Sends a value indicating whether the dictionary matches the structure. Example: true
Last updated