function canonicalize(value) {
  if (Array.isArray(value)) {
    return "[" + value.map(canonicalize).join(",") + "]";
  } else if (value && typeof value === "object") {
    return "{" + Object.keys(value).sort().map((key) => {
      return JSON.stringify(key) + ":" + canonicalize(value[key]);
    }).join(",") + "}";
  } else {
    return JSON.stringify(value);
  }
}
export {
  canonicalize
};
//# sourceMappingURL=canonicalize.js.map