MCPcopy Create free account
hub / github.com/caseywebdev/react-list / describePropertiesDiff

Function describePropertiesDiff

docs/index.js:20669–20696  ·  view source on GitHub ↗
(clientObject, serverObject, indent)

Source from the content-addressed store, hash-verified

20667 ">\n";
20668 }
20669 function describePropertiesDiff(clientObject, serverObject, indent) {
20670 var properties = "",
20671 remainingServerProperties = assign({}, serverObject),
20672 propName;
20673 for (propName in clientObject)
20674 if (clientObject.hasOwnProperty(propName)) {
20675 delete remainingServerProperties[propName];
20676 var maxLength = 120 - 2 * indent - propName.length - 2,
20677 clientPropValue = describeValue(clientObject[propName], maxLength);
20678 serverObject.hasOwnProperty(propName)
20679 ? ((maxLength = describeValue(serverObject[propName], maxLength)),
20680 (properties +=
20681 added(indent) + propName + ": " + clientPropValue + "\n"),
20682 (properties +=
20683 removed(indent) + propName + ": " + maxLength + "\n"))
20684 : (properties +=
20685 added(indent) + propName + ": " + clientPropValue + "\n");
20686 }
20687 for (var _propName in remainingServerProperties)
20688 remainingServerProperties.hasOwnProperty(_propName) &&
20689 ((clientObject = describeValue(
20690 remainingServerProperties[_propName],
20691 120 - 2 * indent - _propName.length - 2
20692 )),
20693 (properties +=
20694 removed(indent) + _propName + ": " + clientObject + "\n"));
20695 return properties;
20696 }
20697 function describeElementDiff(type, clientProps, serverProps, indent) {
20698 var content = "",
20699 serverPropNames = new Map();

Callers 1

describeElementDiffFunction · 0.85

Calls 3

describeValueFunction · 0.85
addedFunction · 0.85
removedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…