signature function

String signature(
  1. IrNode node
)

What must be identical for two occurrences to share a component variant: everything except text content, provenance, and the root's own size and placement (instances can be resized and positioned).

Implementation

String signature(IrNode node) {
  final json = node.toJson()
    ..remove('width')
    ..remove('height')
    ..remove('position')
    ..remove('instance');
  return jsonEncode(_strip(json));
}