@liveblocks/core 1.10.3 → 1.11.0-test1

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.
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/version.ts
8
8
  var PKG_NAME = "@liveblocks/core";
9
- var PKG_VERSION = "1.10.3";
9
+ var PKG_VERSION = "1.11.0-test1";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -1834,20 +1834,18 @@ var Batch = class {
1834
1834
  this.error = false;
1835
1835
  calls.forEach((call, index) => {
1836
1836
  const result = results?.[index];
1837
- if (result instanceof Error) {
1837
+ if (!Array.isArray(results)) {
1838
+ call.reject(new Error("Callback must return an array."));
1839
+ } else if (calls.length !== results.length) {
1840
+ call.reject(
1841
+ new Error(
1842
+ `Callback must return an array of the same length as the number of provided items. Expected ${calls.length}, but got ${results.length}.`
1843
+ )
1844
+ );
1845
+ } else if (result instanceof Error) {
1838
1846
  call.reject(result);
1839
- } else if (result !== void 0) {
1840
- call.resolve(result);
1841
1847
  } else {
1842
- if (Array.isArray(results)) {
1843
- call.reject(
1844
- new Error(
1845
- `Batch callback must return an array of the same length as the number of calls in the batch. Expected ${calls.length}, but got ${results.length}.`
1846
- )
1847
- );
1848
- } else {
1849
- call.reject(new Error("Batch callback must return an array."));
1850
- }
1848
+ call.resolve(result);
1851
1849
  }
1852
1850
  });
1853
1851
  } catch (error3) {
@@ -7068,7 +7066,6 @@ var DEFAULT_LOST_CONNECTION_TIMEOUT = 5e3;
7068
7066
  var RESOLVE_USERS_BATCH_DELAY = 50;
7069
7067
  var RESOLVE_ROOMS_INFO_BATCH_DELAY = 50;
7070
7068
  function getBaseUrl(baseUrl) {
7071
- baseUrl || (baseUrl = process.env.LIVEBLOCKS_BASE_URL || process.env.NEXT_PUBLIC_LIVEBLOCKS_BASE_URL || process.env.VITE_LIVEBLOCKS_BASE_URL || void 0);
7072
7069
  if (typeof baseUrl === "string" && baseUrl.startsWith("http")) {
7073
7070
  return baseUrl;
7074
7071
  } else {