MCPcopy Create free account
hub / github.com/parse-community/parse-server / normalize

Function normalize

spec/helper.js:335–350  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

333
334// Normalizes a JSON object.
335function normalize(obj) {
336 if (obj === null || typeof obj !== 'object') {
337 return JSON.stringify(obj);
338 }
339 if (Array.isArray(obj)) {
340 return '[' + obj.map(normalize).join(', ') + ']';
341 }
342 let answer = '{';
343 for (const key of Object.keys(obj).sort()) {
344 answer += key + ': ';
345 answer += normalize(obj[key]);
346 answer += ', ';
347 }
348 answer += '}';
349 return answer;
350}
351
352// Asserts two json structures are equal.
353function jequal(o1, o2) {

Callers 1

jequalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…