MCPcopy Create free account
hub / github.com/AnswerOverflow/AnswerOverflow / bitfieldToDict

Function bitfieldToDict

packages/core/src/utils/bitfieldUtils.ts:27–36  ·  view source on GitHub ↗
(
	value: number,
	flags: T,
)

Source from the content-addressed store, hash-verified

25}
26
27export function bitfieldToDict<T extends readonly string[]>(
28 value: number,
29 flags: T,
30): Record<T[number], boolean> {
31 const bitfield = new BitField(toBitfield(...flags));
32 return toDict((key) => bitfield.has(value, key), ...flags) as Record<
33 T[number],
34 boolean
35 >;
36}
37
38export function dictToBitfield<
39 T extends readonly string[],

Callers 3

bitfieldToServerFlagsFunction · 0.90
bitfieldToChannelFlagsFunction · 0.90

Calls 2

toBitfieldFunction · 0.85
toDictFunction · 0.85

Tested by

no test coverage detected