Skip to content

Commit

Permalink
Add missing mode reset and invalid EOF handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Jun 14, 2020
1 parent e5a3f7c commit bf9fcd1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion exchanges/graphcache/src/default-storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ export const makeDefaultStorage = (opts?: StorageOptions): DefaultStorage => {
index = 0;

while (index < input.length) {
while ((char = input[index++]) !== ':') entry += char;
while ((char = input[index++]) !== ':' && char) {
entry += char;
}

if (mode) {
data[key] = deserializeEntry(entry) || undefined;
entry = '';
mode = 0;
} else {
key = deserializeEntry(entry);
entry = '';
Expand Down

0 comments on commit bf9fcd1

Please sign in to comment.