2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2016-09-30 12:26:53 -04:00
|
|
|
|
2015-05-26 20:12:38 -04:00
|
|
|
|
2016-02-05 19:32:24 -05:00
|
|
|
export function iterableChangesAsString(
|
2016-07-30 22:18:14 -04:00
|
|
|
{collection = [] as any, previous = [] as any, additions = [] as any, moves = [] as any,
|
|
|
|
removals = [] as any, identityChanges = [] as any}): string {
|
2016-06-08 19:38:52 -04:00
|
|
|
return 'collection: ' + collection.join(', ') + '\n' +
|
|
|
|
'previous: ' + previous.join(', ') + '\n' +
|
|
|
|
'additions: ' + additions.join(', ') + '\n' +
|
|
|
|
'moves: ' + moves.join(', ') + '\n' +
|
|
|
|
'removals: ' + removals.join(', ') + '\n' +
|
|
|
|
'identityChanges: ' + identityChanges.join(', ') + '\n';
|
2015-05-26 20:12:38 -04:00
|
|
|
}
|
|
|
|
|
2015-08-28 14:29:19 -04:00
|
|
|
export function kvChangesAsString(
|
|
|
|
{map, previous, additions, changes, removals}:
|
|
|
|
{map?: any[], previous?: any[], additions?: any[], changes?: any[], removals?: any[]}):
|
|
|
|
string {
|
2016-09-30 12:26:53 -04:00
|
|
|
if (!map) map = [];
|
|
|
|
if (!previous) previous = [];
|
|
|
|
if (!additions) additions = [];
|
|
|
|
if (!changes) changes = [];
|
|
|
|
if (!removals) removals = [];
|
2015-05-26 20:12:38 -04:00
|
|
|
|
2016-06-08 19:38:52 -04:00
|
|
|
return 'map: ' + map.join(', ') + '\n' +
|
|
|
|
'previous: ' + previous.join(', ') + '\n' +
|
|
|
|
'additions: ' + additions.join(', ') + '\n' +
|
|
|
|
'changes: ' + changes.join(', ') + '\n' +
|
|
|
|
'removals: ' + removals.join(', ') + '\n';
|
2015-05-26 20:12:38 -04:00
|
|
|
}
|