Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[import] readBoolean bugged when importing data #256

Open
warrenberberd opened this issue Dec 31, 2024 · 0 comments
Open

[import] readBoolean bugged when importing data #256

warrenberberd opened this issue Dec 31, 2024 · 0 comments

Comments

@warrenberberd
Copy link

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant