MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / canonicalJson

Function canonicalJson

wxapp/wps.js:140–148  ·  view source on GitHub ↗
(data = {})

Source from the content-addressed store, hash-verified

138}
139
140function canonicalJson(data = {}) {
141 const sorted = {};
142 Object.keys(data || {})
143 .sort()
144 .forEach((key) => {
145 sorted[key] = data[key];
146 });
147 return JSON.stringify(sorted);
148}
149
150function makeSignature(data, config = {}) {
151 const key = config.key || "";

Callers 1

makeSignatureFunction · 0.85

Calls 1

forEachMethod · 0.80

Tested by

no test coverage detected