[GH-ISSUE #256] [import] readBoolean bugged when importing data #115

Open
opened 2026-05-23 08:31:09 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @warrenberberd on GitHub (Dec 31, 2024).
Original GitHub issue: https://github.com/appy-one/acebase/issues/256

import backup file fail with error :
Error: Expected true or false at index
at readBoolean (./node_modules/acebase/dist/cjs/storage/index.js:1718:19)

Due to function :
const readBoolean = async () => { if (state.data[state.index] === 't') { await consumeToken('true'); } else if (state.data[state.index] === 'f') { await consumeToken('false'); } throw new Error(Expected true or false at index ${state.offset + state.index}); };

missing "return" clause.

Corrected with :
const readBoolean = async () => { if (state.data[state.index] === 't') { await consumeToken('true'); return true; } else if (state.data[state.index] === 'f') { await consumeToken('false'); return false; } throw new Error(Expected true or false at index ${state.offset + state.index}); };

Originally created by @warrenberberd on GitHub (Dec 31, 2024). Original GitHub issue: https://github.com/appy-one/acebase/issues/256 import backup file fail with error : Error: Expected true or false at index at readBoolean (./node_modules/acebase/dist/cjs/storage/index.js:1718:19) Due to function : ` const readBoolean = async () => { if (state.data[state.index] === 't') { await consumeToken('true'); } else if (state.data[state.index] === 'f') { await consumeToken('false'); } throw new Error(`Expected true or false at index ${state.offset + state.index}`); }; ` missing "return" clause. Corrected with : ` const readBoolean = async () => { if (state.data[state.index] === 't') { await consumeToken('true'); return true; } else if (state.data[state.index] === 'f') { await consumeToken('false'); return false; } throw new Error(`Expected true or false at index ${state.offset + state.index}`); }; `
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/acebase#115
No description provided.