Skip to content

Feature request: Modify toArray method for custom keys #1

@Philippe-Guyard

Description

@Philippe-Guyard

Current behaviour

const numbers = [10, 20, 30];
const NumbersBitList = BitList.useKeys(numbers);
const numbersFromQuery = new NumbersBitList(1).toArray();
//numberFromQuery is [1] (which means that numbers[0] is in the query)

Expected behaviour

const numbers = [10, 20, 30];
const NumbersBitList = BitList.useKeys(numbers);
const numbersFromQuery = new NumbersBitList(1).toArray(); //you could name this .toNamedArray()
//numberFromQuery is [10] (replacing true bit values by the actual keys)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions