MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / calculateOperationHash

Function calculateOperationHash

lib/fastbuilder.js:229–251  ·  view source on GitHub ↗
(methodName, theArguments)

Source from the content-addressed store, hash-verified

227}
228
229function calculateOperationHash(methodName, theArguments) {
230
231
232 // build the signature of the function + arguments
233
234 let key;
235 const args = [];
236 for (key in theArguments) {
237
238 if (theArguments.hasOwnProperty(key)) {
239
240 args.push(replaceObjectsByGUUID(theArguments[key]));
241
242 }
243
244 }
245 const argStr = JSON.stringify(args);
246 const cmd = `${methodName}(${argStr.substr(1, argStr.length - 2)})`;
247 const uuid = hash(cmd);
248
249 return [uuid, cmd];
250
251}
252
253function isFunction(a) {
254

Callers 1

Calls 2

replaceObjectsByGUUIDFunction · 0.85
hashFunction · 0.85

Tested by

no test coverage detected