MCPcopy Create free account
hub / github.com/aradzie/keybr.com / sortJsonArray

Function sortJsonArray

scripts/lib/sort-json.js:14–22  ·  view source on GitHub ↗
(json, order)

Source from the content-addressed store, hash-verified

12}
13
14function sortJsonArray(json, order) {
15 if (order === undefined) {
16 return json;
17 }
18 if (order === "alpha") {
19 return [...json].sort();
20 }
21 throw new TypeError(`Invalid array order [${order}]`);
22}
23
24function sortJsonObject(json, order) {
25 if (order === undefined) {

Callers 1

sortJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected