@dxos/util 0.8.4-main.84f28bd → 0.8.4-main.c1de068

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1109,7 +1109,7 @@ var arrayToString = (array) => arrayToBuffer(array).toString("hex");
1109
1109
  // src/json.ts
1110
1110
  var MAX_DEPTH = 5;
1111
1111
  var LOG_MAX_DEPTH = 7;
1112
- function jsonReplacer(key, value) {
1112
+ var jsonReplacer = (key, value) => {
1113
1113
  if (value !== null && typeof value === "object" && typeof value[inspect2.custom] === "function") {
1114
1114
  return value[inspect2.custom]();
1115
1115
  }
@@ -1122,7 +1122,7 @@ function jsonReplacer(key, value) {
1122
1122
  }
1123
1123
  }
1124
1124
  return value;
1125
- }
1125
+ };
1126
1126
  var jsonify = (value, depth = 0, visitedObjects = /* @__PURE__ */ new WeakSet()) => {
1127
1127
  if (depth > MAX_DEPTH) {
1128
1128
  return null;
@@ -1711,6 +1711,12 @@ var capitalize = (str) => {
1711
1711
  }
1712
1712
  return str.charAt(0).toUpperCase() + str.slice(1);
1713
1713
  };
1714
+ var trim = (strings, ...values) => {
1715
+ const full = String.raw(strings, ...values);
1716
+ const lines = full.replace(/^\n/, "").split("\n");
1717
+ const indent = Math.min(...lines.filter((l) => l.trim()).map((l) => l.match(/^ */)[0].length));
1718
+ return lines.map((l) => l.slice(indent)).join("\n");
1719
+ };
1714
1720
 
1715
1721
  // src/sum.ts
1716
1722
  var sum = (values) => values.reduce((a, b) => a + b, 0);
@@ -2266,6 +2272,7 @@ export {
2266
2272
  toFallback,
2267
2273
  toHue,
2268
2274
  tracer,
2275
+ trim,
2269
2276
  visitValues
2270
2277
  };
2271
2278
  //# sourceMappingURL=index.mjs.map