2015-02-05 16:08:05 -05:00
|
|
|
import {isBlank} from 'angular2/src/facade/lang';
|
2014-11-24 12:42:53 -05:00
|
|
|
|
2015-03-13 19:22:01 -04:00
|
|
|
export function iterableChangesAsString({collection, previous, additions, moves, removals}) {
|
2014-11-24 12:42:53 -05:00
|
|
|
if (isBlank(collection)) collection = [];
|
|
|
|
if (isBlank(previous)) previous = [];
|
|
|
|
if (isBlank(additions)) additions = [];
|
|
|
|
if (isBlank(moves)) moves = [];
|
|
|
|
if (isBlank(removals)) removals = [];
|
|
|
|
|
|
|
|
return "collection: " + collection.join(', ') + "\n" +
|
|
|
|
"previous: " + previous.join(', ') + "\n" +
|
|
|
|
"additions: " + additions.join(', ') + "\n" +
|
|
|
|
"moves: " + moves.join(', ') + "\n" +
|
|
|
|
"removals: " + removals.join(', ') + "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
export function kvChangesAsString({map, previous, additions, changes, removals}) {
|
|
|
|
if (isBlank(map)) map = [];
|
|
|
|
if (isBlank(previous)) previous = [];
|
|
|
|
if (isBlank(additions)) additions = [];
|
|
|
|
if (isBlank(changes)) changes = [];
|
|
|
|
if (isBlank(removals)) removals = [];
|
|
|
|
|
|
|
|
return "map: " + map.join(', ') + "\n" +
|
|
|
|
"previous: " + previous.join(', ') + "\n" +
|
|
|
|
"additions: " + additions.join(', ') + "\n" +
|
|
|
|
"changes: " + changes.join(', ') + "\n" +
|
|
|
|
"removals: " + removals.join(', ') + "\n";
|
|
|
|
}
|