TreeUtils Class

Module: BinaryUtils

TreeUtils used to compare Tree.

Can also be used to compare Object structure.

Item Index

Methods

Methods

compare

(
  • a
  • b
  • diffs
  • pathA
  • pathB
)
Array static

Compare two trees and return list of changes.

A is compared to B, A is the oldest version of tree and B the newest.

Elements inside Trees are compared using their UUID.

The array returned from this method contains objects in the format {status:, uuid: , from: , to: }

Parameters:

  • a Tree

    Old version of Tree.

  • b Tree

    New version of Tree.

  • diffs Array

    Recursive parameter not required.

  • pathA Array

    Recursive parameter not required.

  • pathB Array

    Recursive parameter not required.

Returns:

Array:

Array with diffs between A and B.

test

()

Unit test for tree comparison.

Prints information into the console.

Attributes

DIFF_ADDED

Number

Flag used to indicate ADDED diff.

DIFF_MOVED

Number

Flag used to indicate MOVED diff.

DIFF_REMOVED

Number

Flag used to indicate REMOVED diff.