@dxos/util 0.6.14-main.8b352a0 → 0.6.14-staging.54a8bab

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.
@@ -1107,14 +1107,14 @@ var DeepMapper = class {
1107
1107
  const res = new Array(value.length);
1108
1108
  this._cyclic.set(value, res);
1109
1109
  for (let i = 0; i < value.length; i++) {
1110
- res[i] = this.map(value[i]);
1110
+ res[i] = this._map(value[i], i);
1111
1111
  }
1112
1112
  return res;
1113
1113
  } else if (value !== null && typeof value === "object") {
1114
1114
  const res = {};
1115
1115
  this._cyclic.set(value, res);
1116
1116
  for (const key in value) {
1117
- res[key] = this.map(value[key]);
1117
+ res[key] = this._map(value[key], key);
1118
1118
  }
1119
1119
  return res;
1120
1120
  } else {
@@ -1123,10 +1123,13 @@ var DeepMapper = class {
1123
1123
  };
1124
1124
  }
1125
1125
  map(value) {
1126
+ return this._map(value, void 0);
1127
+ }
1128
+ _map(value, key) {
1126
1129
  if (this._cyclic.has(value)) {
1127
1130
  return this._cyclic.get(value);
1128
1131
  }
1129
- return this._fn(value, this._recurse);
1132
+ return this._fn(value, this._recurse, key);
1130
1133
  }
1131
1134
  };
1132
1135
  var deepMapValuesAsync = (value, fn) => {
@@ -1144,14 +1147,14 @@ var DeepMapperAsync = class {
1144
1147
  const res = new Array(value.length);
1145
1148
  this._cyclic.set(value, res);
1146
1149
  for (let i = 0; i < value.length; i++) {
1147
- res[i] = await this.map(value[i]);
1150
+ res[i] = await this._map(value[i], i);
1148
1151
  }
1149
1152
  return res;
1150
1153
  } else if (value !== null && typeof value === "object") {
1151
1154
  const res = {};
1152
1155
  this._cyclic.set(value, res);
1153
1156
  for (const key in value) {
1154
- res[key] = await this.map(value[key]);
1157
+ res[key] = await this._map(value[key], key);
1155
1158
  }
1156
1159
  return res;
1157
1160
  } else {
@@ -1160,10 +1163,13 @@ var DeepMapperAsync = class {
1160
1163
  };
1161
1164
  }
1162
1165
  map(value) {
1166
+ return this._map(value, void 0);
1167
+ }
1168
+ _map(value, key) {
1163
1169
  if (this._cyclic.has(value)) {
1164
1170
  return this._cyclic.get(value);
1165
1171
  }
1166
- return this._fn(value, this._recurse);
1172
+ return this._fn(value, this._recurse, key);
1167
1173
  }
1168
1174
  };
1169
1175
 
@@ -1874,6 +1880,19 @@ var arrayToHex = (buf) => {
1874
1880
  }
1875
1881
  return hexOctets.join("");
1876
1882
  };
1883
+
1884
+ // packages/common/util/src/remove-undefined-keys.ts
1885
+ var removeUndefinedProperties = (object) => {
1886
+ for (const prop of [
1887
+ ...Object.getOwnPropertyNames(object),
1888
+ ...Object.getOwnPropertySymbols(object)
1889
+ ]) {
1890
+ if (object[prop] === void 0) {
1891
+ delete object[prop];
1892
+ }
1893
+ }
1894
+ return object;
1895
+ };
1877
1896
  export {
1878
1897
  BitField,
1879
1898
  Callback,
@@ -1960,6 +1979,7 @@ export {
1960
1979
  reduceGroupBy,
1961
1980
  reduceSeries,
1962
1981
  reduceSet,
1982
+ removeUndefinedProperties,
1963
1983
  safariCheck,
1964
1984
  safeAwaitAll,
1965
1985
  safeInstanceof,