@onyx.dev/onyx-database 0.1.5 → 0.1.6
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.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -521,7 +521,18 @@ var QueryResults = class extends Array {
|
|
|
521
521
|
* ```
|
|
522
522
|
*/
|
|
523
523
|
constructor(records, nextPage, fetcher) {
|
|
524
|
-
|
|
524
|
+
const items = (() => {
|
|
525
|
+
if (records == null) return [];
|
|
526
|
+
if (Array.isArray(records)) return records;
|
|
527
|
+
if (typeof records[Symbol.iterator] === "function") {
|
|
528
|
+
return Array.from(records);
|
|
529
|
+
}
|
|
530
|
+
if (typeof records.length === "number") {
|
|
531
|
+
return Array.from(records);
|
|
532
|
+
}
|
|
533
|
+
return [records];
|
|
534
|
+
})();
|
|
535
|
+
super(...items);
|
|
525
536
|
Object.setPrototypeOf(this, new.target.prototype);
|
|
526
537
|
this.nextPage = nextPage;
|
|
527
538
|
this.fetcher = fetcher;
|