Skip to content

[import] readBoolean bugged when importing data #256

@warrenberberd

Description

@warrenberberd

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}); };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions