(id, change, force=false)
| 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 |
no test coverage detected