Skip to content

Commit 9b64e74

Browse files
committed
fix boundToPosition to account for inclusivity in the id
1 parent 78cf5bc commit 9b64e74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/client/positions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ export function boundToPosition<K extends Key, ID extends string>(
120120
if (direction === "lower") {
121121
return [
122122
explodeKey(bound.key),
123-
bound.id ?? BEFORE_ALL_IDS,
123+
bound.id ?? (bound.inclusive ? BEFORE_ALL_IDS : AFTER_ALL_IDS),
124124
bound.inclusive ? BEFORE_ALL_IDS : AFTER_ALL_IDS,
125125
];
126126
} else {
127127
return [
128128
explodeKey(bound.key),
129-
bound.id ?? AFTER_ALL_IDS,
129+
bound.id ?? (bound.inclusive ? AFTER_ALL_IDS : BEFORE_ALL_IDS),
130130
bound.inclusive ? AFTER_ALL_IDS : BEFORE_ALL_IDS,
131131
];
132132
}

0 commit comments

Comments
 (0)