*
(arg)
| 199 | * |
| 200 | */ |
| 201 | function replaceObjectsByGUUID(arg) { |
| 202 | |
| 203 | const toUUID = el => el.uuid; |
| 204 | |
| 205 | if (!arg) { |
| 206 | return null; |
| 207 | } |
| 208 | if (arg.hasOwnProperty("uuid")) { |
| 209 | return toUUID(arg); |
| 210 | } else if ((arg.length > 0 && typeof arg[0] === "number") || (typeof arg === "number")) { |
| 211 | return arg; |
| 212 | } else if (arg.length > 0 && (arg[0] instanceof Object) && arg[0].hasOwnProperty("uuid")) { |
| 213 | debugLog(" Found an array of object with guiid", (`arg ${arg.map(el => el.uuid)}`)); |
| 214 | return arg.map(replaceObjectsByGUUID); |
| 215 | |
| 216 | } else { |
| 217 | if (arg.hashCode) { |
| 218 | return hash(`---${arg.hashCode}`); |
| 219 | } |
| 220 | // we can"t use cache yet |
| 221 | const tmp = arg; |
| 222 | // .map(toUUID); |
| 223 | debugLog(" ERROR : Cannot use cache with object ", typeof arg, JSON.stringify(tmp)); |
| 224 | |
| 225 | return tmp; |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | function calculateOperationHash(methodName, theArguments) { |
| 230 |
no test coverage detected