diffs-to-string
Turns an array of diffs into a string. You can generate a changes stream by using sorted-diff-stream.
basic example
var diffs2string = var changes = country: 'germany' capital: null country: 'germany' code: 'de' capital: 'berlin' country: 'ireland' capital: 'dublin' country: 'ireland' code: 'ie' capital: 'dublin' country: 'france' capital: 'paris' country: null code: 'fr' capital: 'paris' country: 'spain' capital: 'madrid' country: 'spain' code: 'es' capital: 'barcelona' var visual = console
Outputs:
row 1
country: germany
+ capital: berlin
+ code: de
row 2
country: ireland
capital: dublin
+ code: ie
row 3
- country: france
capital: paris
+ code: fr
row 4
country: spain
? capital: madrid -> barcelona
+ code: es
with streams
var diffs2string = streamvar diffStream = from diffStream
custom row path and row header
{ return rowvalue} { return 'this is row ' + diff'some-value' + '\n'} var opts = getRowValue: getRowValue getRowHeader: getRowHeader diffStreamvar visual =