@liveblocks/core 1.10.4 → 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.js 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.4";
9
+ var PKG_VERSION = "1.11.0-test1";
10
10
  var PKG_FORMAT = "cjs";
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 = _optionalChain([results, 'optionalAccess', _46 => _46[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) {