MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / attrChanged

Function attrChanged

web/pgadmin/static/js/SchemaView/SchemaState/common.js:129–149  ·  view source on GitHub ↗
(id, change, force=false)

Source from the content-addressed store, hash-verified

127
128 /* The comparator and setter */
129 const attrChanged = (id, change, force=false) => {
130 if(isValueEqual(_.get(origVal, id), _.get(sessVal, id)) && !force) {
131 return;
132 }
133
134 change = change || _.get(sessVal, id);
135
136 if(stringify && (_.isArray(change) || _.isObject(change))) {
137 change = JSON.stringify(change);
138 }
139
140 /*
141 * Null values are not passed in URL params, pass it as an empty string.
142 * Nested values does not need this.
143 */
144 if(_.isNull(change) && parseChanges.depth === 0) {
145 change = '';
146 }
147
148 levelChanges[id] = change;
149 };
150
151 schema.fields.forEach((field) => {
152 // Never include data from the field in the changes, marked as

Callers 1

parseChangesFunction · 0.85

Calls 2

isValueEqualFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected