@lavalogic/scoria 0.21.4 → 0.21.5
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.
|
@@ -238,23 +238,17 @@ export class TableContext {
|
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
240
|
Promise.resolve()
|
|
241
|
-
.then(() => asyncMap(sd, (item, index) => {
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
throw new Error(`Sorted Data not found in Original Row Indices: original index ${originalIndex}, index ${index}`);
|
|
251
|
-
}
|
|
252
|
-
return this.createRow(item, index, unsortedIndex);
|
|
253
|
-
};
|
|
254
|
-
if (rawKey instanceof Promise) {
|
|
255
|
-
return rawKey.then(finish);
|
|
241
|
+
.then(() => asyncMap(sd, async (item, index) => {
|
|
242
|
+
const key = await this._cachedKey(item);
|
|
243
|
+
const originalIndex = ori.get(key);
|
|
244
|
+
const unsortedIndex = originalIndex ?? index;
|
|
245
|
+
if (current !== latest_sortedRowModel) {
|
|
246
|
+
throw new Error(`stale data`);
|
|
247
|
+
}
|
|
248
|
+
if (originalIndex == null) {
|
|
249
|
+
throw new Error(`Sorted Data not found in Original Row Indices: original index ${originalIndex}, index ${index}`);
|
|
256
250
|
}
|
|
257
|
-
return
|
|
251
|
+
return this.createRow(item, index, unsortedIndex);
|
|
258
252
|
}))
|
|
259
253
|
.then((rows) => {
|
|
260
254
|
if (current !== latest_sortedRowModel) {
|