The type of flag keys, extending string.
Returns an iterator over the [key, value] pairs in the registry.
An iterator over the [key, value] pairs.
Retrieves the BigInt value associated with the given flag name.
The name of the flag to retrieve.
The BigInt value of the flag, or undefined if not found.
Returns an iterator over the flag keys in the registry.
An iterator over the flag keys.
Parses a string value to create a flag instance.
The string value to parse.
Optionalradix: numberThe radix to use when parsing the string (default is 10).
A flag instance representing the parsed value.
const registry = FlagsRegistry.from("READ", "WRITE");
const flag = registry.parse("3"); // Represents both READ and WRITE flags
flag.has("READ"); // true
flag.has("WRITE"); // true
const hexFlag = registry.parse("3", 16); // Parses "3" as hexadecimal
hexFlag.has("READ"); // true
hexFlag.has("WRITE"); // true
const binaryFlag = registry.parse("11", 2); // Parses "11" as binary
binaryFlag.has("READ"); // true
binaryFlag.has("WRITE"); // true
Returns an iterator over the flag values in the registry.
An iterator over the flag values.
StaticfromCreates a new FlagsRegistry from the provided flag keys, assigning each a unique bit position.
An array of flag keys to include in the registry.
A new FlagsRegistry instance with the specified flags.
A registry for managing bitwise flags. This class maps flag keys (strings) to unique bit positions using BigInt for scalable storage.