{"version":3,"sources":["../../src/index.ts","../../src/is.ts","../../src/boundedMap.ts","../../src/boundedSet.ts","../../src/chunk.ts","../../src/headers.ts","../../src/d2Map.ts","../../src/string.ts","../../src/time.ts","../../src/transform.ts","../../src/types/environment.ts","../../src/types/logLevel.ts","../../src/uuidSource.ts"],"sourcesContent":["export { BoundedMap } from \"./boundedMap\";\nexport { BoundedSet } from \"./boundedSet\";\n\nexport { type Chunk, asyncChunkify, chunkify } from \"./chunk\";\n\nexport {\n type HeaderProvider,\n type IdentityProviderConfig,\n IdentityProvider,\n} from \"./headers\";\n\nexport {\n isAlpha,\n isAlphaNumeric,\n isArray,\n isAsyncIterable,\n isBigInt,\n isBoolean,\n isFunction,\n isInt,\n isIterable,\n isNumber,\n isObject,\n isString,\n isTransferable,\n} from \"./is\";\n\nexport { D2Map, d2MapDelete, d2MapGet, d2MapHas, d2MapSet } from \"./d2Map\";\n\nexport {\n camelToPascal,\n camelToSnake,\n capitalize,\n pascalToCamel,\n pascalToSnake,\n snakeToCamel,\n snakeToPascal,\n toCamelCase,\n toPascalCase,\n toSnakeCase,\n} from \"./string\";\n\nexport { wait, waitUntil } from \"./time\";\n\nexport {\n camelToSnakeKeys,\n lowercaseKeys,\n snakeToCamelKeys,\n toAsyncIterator,\n uppercaseKeys,\n} from \"./transform\";\n\nexport {\n type CamelToSnake,\n type CamelToSnakeKeys,\n type CamelToSnakeKeysDeep,\n type ConstEnum,\n Environment,\n type Logger,\n LogLevel,\n type LowercaseKeys,\n type LowercaseKeysDeep,\n type Optional,\n type IteratorOptions,\n type PipeOptions,\n type SignalOption,\n type SnakeToCamel,\n type SnakeToCamelKeys,\n type SnakeToCamelKeysDeep,\n type TypedReadable,\n type UppercaseKeys,\n type UppercaseKeysDeep,\n} from \"./types\";\n\nexport { type Source, UuidSource } from \"./uuidSource\";\n","import { Transferable } from \"node:worker_threads\";\n\n/**\n * Checks if a value is a string containing\n * only alphabetic characters (a-z, case-insensitive)\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is an alphabetic string, `false` otherwise\n */\nexport function isAlpha(value: unknown): value is string {\n return isString(value) && /^[a-z]+$/gi.test(value);\n}\n\n/**\n * Checks if a value is a string containing\n * only alphanumeric characters (a-z, 0-9, case-insensitive).\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is an alphanumeric string, `false` otherwise\n */\nexport function isAlphaNumeric(value: unknown): value is string {\n return isString(value) && /^[a-z0-9]+$/gi.test(value);\n}\n\n/**\n * Checks if a value is an array\n *\n * @template T - The expected type of array elements (defaults to `unknown`).\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is an array, `false` otherwise\n */\nexport function isArray(value: unknown): value is T[] {\n return Array.isArray(value);\n}\n\n/**\n * Checks if a value is an `AsyncIterable`\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is an `AsyncIterable`, `false` otherwise\n */\nexport function isAsyncIterable(\n value: unknown,\n): value is AsyncIterable {\n return (\n isObject(value) &&\n Symbol.asyncIterator in value &&\n isFunction(value[Symbol.asyncIterator])\n );\n}\n\n/**\n * Checks if a value is a `bigint`\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is a `bigint`, `false` otherwise\n */\nexport function isBigInt(value: unknown): value is bigint {\n return typeof value === \"bigint\";\n}\n\n/**\n * Checks if a value is a `boolean`\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is a `boolean`, `false` otherwise\n */\nexport function isBoolean(value: unknown): value is boolean {\n return typeof value === \"boolean\";\n}\n\n/**\n * Checks if a value is a function\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is a function, `false` otherwise\n */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport function isFunction(value: unknown): value is Function {\n return typeof value === \"function\";\n}\n\n/**\n * Checks if a value is an integer number\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is an integer, `false` otherwise.\n */\nexport function isInt(value: unknown): value is number {\n return isNumber(value) && Number.isInteger(value);\n}\n\n/**\n * Checks if a value is an `Iterable`\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is an `Iterable`, `false` otherwise\n */\nexport function isIterable(value: unknown): value is Iterable {\n return (\n isObject(value) &&\n Symbol.iterator in value &&\n isFunction(value[Symbol.iterator])\n );\n}\n\n/**\n * Checks if a value is a `number`\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is a `number`, `false` otherwise\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === \"number\";\n}\n\n/**\n * Checks if a value is an `object`. Excludes `null` and arrays.\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is an `object`, `false` otherwise\n */\nexport function isObject(value: unknown): value is object {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\n/**\n * Checks if a value is a `string`\n *\n * @param value - The value to check\n *\n * @returns `true` if the value is a `string`, `false` otherwise\n */\nexport function isString(value: unknown): value is string {\n return typeof value === \"string\";\n}\n\n/**\n * Checks if a value is a `Transferable` object\n *\n * @param value - The value to check\n *\n * @returns `True` if the value is `Transferable`, `false` otherwise\n *\n * @todo Add a reliable check for `FileHandle`\n */\nexport function isTransferable(value: unknown): value is Transferable {\n return (\n value instanceof ArrayBuffer ||\n value instanceof MessagePort ||\n value instanceof AbortSignal ||\n value instanceof ReadableStream ||\n value instanceof WritableStream ||\n value instanceof TransformStream\n );\n}\n","import { isInt, isNumber } from \"./is\";\n\n/**\n * A `Map` with a fixed maximum capacity.\n *\n * Entries are evicted in first-in-first-out (FIFO) order\n * when capacity is exceeded. This means the oldest entry\n * is removed to make space.\n *\n * @template K The type of keys.\n * @template V The type of values.\n *\n * @example\n * const map = new FIFOMap(3);\n * map.set(\"a\", 1); // { a: 1 }\n * map.set(\"b\", 2); // { a: 1, b: 2 }\n * map.set(\"c\", 3); // { a: 1, b: 2, c: 3 }\n * map.set(\"d\", 4); // { b: 2, c: 3, d: 4 }\n */\nexport class BoundedMap implements Map {\n private _capacity: number;\n private _map: Map;\n\n /**\n * Creates a new instance with an optional capacity.\n *\n * @param capacity (Optional) The maximum number of entries the map can hold. Defaults to `Infinity`.\n */\n constructor(capacity?: number);\n /**\n * Creates a new instance with the entries from the given iterable and optional capacity.\n *\n * @param iterable (Optional) An iterable of key-value pairs to initialize the map with.\n * @param capacity (Optional) The maximum number of entries the map can hold. Defaults to `Infinity`.\n */\n constructor(iterable?: Iterable<[K, V]> | null, capacity?: number);\n /**\n * Creates a new instance from an existing `Map` and an optional capacity.\n *\n * @param map (Optional) A `Map` to initialize the instance with.\n * @param capacity (Optional) The maximum number of entries the map can hold. Defaults to `Infinity`.\n */\n constructor(map?: Map | null, capacity?: number);\n /**\n * Internal constructor implementation that handles overloading.\n */\n constructor(\n map?: Iterable<[K, V]> | Map | null | number,\n capacity?: number,\n ) {\n if (isNumber(map)) {\n capacity = map;\n map = undefined;\n }\n\n this._capacity = 0;\n if (map == null) {\n this._map = new Map();\n } else if (map instanceof Map) {\n this._map = map;\n } else {\n this._map = new Map(map);\n }\n\n this.capacity = capacity ?? Infinity;\n }\n\n /**\n * The maximum number of entries the map can hold.\n */\n get capacity(): number {\n return this._capacity;\n }\n\n /**\n *\n * Must be a nonnegative integer or `Infinity`.\n *\n * When reduced, the oldest entries are\n * evicted until the map is within capacity.\n *\n * @throws {RangeError} If an invalid capacity is given.\n */\n set capacity(value: number) {\n // Sanitize input\n if (value !== Infinity && (!isInt(value) || value < 0)) {\n throw new RangeError(\"Invalid map capacity\");\n }\n\n // Update capacity\n this._capacity = value;\n\n // Check if size violates new capacity\n if (this.size <= this._capacity) {\n return;\n }\n\n // Special case; Remove all values\n if (value == 0) {\n this._map.clear();\n return;\n }\n\n // Reduce size to within capacity\n const iterator = this.keys();\n do {\n this.delete(iterator.next().value!);\n } while (this.size > this._capacity);\n }\n\n /**\n * Removes all entries from the map.\n */\n clear(): void {\n this._map.clear();\n }\n\n /**\n * Removes a specified entry from the map.\n *\n * @param key The key of the entry to remove.\n *\n * @returns `true` if the entry was found and removed, `false` otherwise.\n */\n delete(key: K): boolean {\n return this._map.delete(key);\n }\n\n /**\n * Returns an iterable of [key, value] pairs for every entry in the map.\n *\n * @returns An iterable of [key, value] pairs for every entry in the map.\n */\n entries(): MapIterator<[K, V]> {\n return this._map.entries();\n }\n\n /**\n * Executes a provided function once for each entry in the map.\n *\n * @param callbackFn The function to execute.\n *\n * @param thisArg (Optional) The value to use as `this` when executing the function.\n */\n forEach(\n callbackFn: (value: V, key: K, map: Map) => void,\n thisArg?: unknown,\n ): void {\n this._map.forEach((value, key) => {\n callbackFn.call(thisArg, value, key, this);\n });\n }\n\n /**\n * Gets the value associated with the given key.\n *\n * @param key The key to check.\n *\n * @returns The value if the key exists, otherwise `undefined`.\n */\n get(key: K): V | undefined {\n return this._map.get(key);\n }\n\n /**\n * Checks whether the given key exists in the map.\n *\n * @param key The key to check.\n *\n * @returns `true` if the key exists, otherwise `false`.\n */\n has(key: K): boolean {\n return this._map.has(key);\n }\n\n /**\n * Returns an iterable over the keys in the map.\n *\n * @returns An iterable over the keys in the map.\n */\n keys(): MapIterator {\n return this._map.keys();\n }\n\n /**\n * Adds a new key-value pair to the map.\n *\n * If a key already exists, it is re-inserted at the newest position.\n *\n * If capacity would be exceeded, the oldest entry is removed.\n *\n * @param key The key to set.\n * @param value The value associated with the key.\n *\n * @returns The map instance.\n */\n set(key: K, value: V): this {\n if (!this.delete(key) && this.size >= this._capacity) {\n this.shift();\n }\n this.set(key, value);\n return this;\n }\n\n /**\n * Removes and returns the oldest entry in the map.\n *\n * @returns The removed key-value pair, or `undefined` if the map is empty.\n */\n shift(): [K, V] | undefined {\n const iterator = this.entries();\n const next = iterator.next();\n if (next.done) {\n return undefined;\n }\n this.delete(next.value[0]);\n return next.value;\n }\n\n /**\n * The number of entries in the map.\n */\n get size(): number {\n return this._map.size;\n }\n\n /**\n * Returns an iterable over the values in the map.\n *\n * @returns An iterable over the values in the map.\n */\n values(): MapIterator {\n return this._map.values();\n }\n\n /**\n * Returns an iterable over the entries in the map.\n *\n * @returns An iterable over the entries in the map.\n */\n [Symbol.iterator](): MapIterator<[K, V]> {\n return this._map[Symbol.iterator]();\n }\n\n /**\n * The default string tag.\n */\n get [Symbol.toStringTag](): string {\n return BoundedMap.name;\n }\n}\n","import { isInt, isNumber } from \"./is\";\n\n/**\n * A `Set` with a fixed maximum capacity.\n *\n * Values are evicted in first-in-first-out (FIFO) order\n * when capacity is exceeded. This means the oldest value\n * is removed to make space.\n *\n * @template V The type of values.\n *\n * @example\n * const set = new FifoSet(3);\n * set.add(1); // [ 1 ]\n * set.add(2); // [ 1, 2 ]\n * set.add(3); // [ 1, 2, 3 ]\n * set.add(4); // [ 2, 3, 4 ]\n */\nexport class BoundedSet implements Set {\n private _capacity: number;\n private _set: Set;\n\n /**\n * Creates a new instance with an optional capacity.\n *\n * @param capacity (Optional) The maximum number of values the set can hold. Defaults to `Infinity`.\n */\n constructor(capacity?: number);\n /**\n * Creates a new instance with values from the given iterable and an optional capacity.\n *\n * @param iterable (Optional) An iterable of values to initialize the set with.\n * @param capacity (Optional) The maximum number of values the set can hold. Defaults to `Infinity`.\n */\n constructor(iterable?: Iterable | null, capacity?: number);\n /**\n * Creates a new instance from an existing `Set` and an optional capacity.\n *\n * @param set (Optional) A `Set` to initialize the instance with.\n * @param capacity (Optional) The maximum number of values the set can hold. Defaults to `Infinity`.\n */\n constructor(set?: Set | null, capacity?: number);\n constructor(set?: Iterable | Set | null | number, capacity?: number) {\n if (isNumber(set)) {\n capacity = set;\n set = undefined;\n }\n\n this._capacity = 0;\n if (set == null) {\n this._set = new Set();\n } else if (set instanceof Set) {\n this._set = set;\n } else {\n this._set = new Set(set);\n }\n\n this.capacity = capacity ?? Infinity;\n }\n\n /**\n * Adds a new value to the set.\n *\n * If the value already exists, it is re-inserted at the newest position.\n *\n * If capacity would be exceeded, the oldest value is removed.\n *\n * @param value The value to add.\n *\n * @returns The set instance.\n */\n add(value: V): this {\n if (!this.delete(value) && this.size >= this._capacity) {\n this.shift();\n }\n this._set.add(value);\n return this;\n }\n\n /**\n * The maximum number of values the set can hold.\n */\n get capacity(): number {\n return this._capacity;\n }\n\n /**\n * Must be a nonnegative integer or `Infinity`.\n *\n * When reduced, the oldest values are\n * evicted until the set is within capacity.\n *\n * @throws {RangeError} If an invalid capacity is given.\n */\n set capacity(value: number) {\n // Sanitize input\n if (value !== Infinity && (!isInt(value) || value < 0)) {\n throw new RangeError(\"Invalid set capacity\");\n }\n\n // Update capacity\n this._capacity = value;\n\n // Check if size violates new capacity\n if (this.size <= this._capacity) {\n return;\n }\n\n // Special case; Remove all values\n if (value === 0) {\n this._set.clear();\n return;\n }\n\n // Reduce size to within capacity\n const iterator = this.keys();\n do {\n this.delete(iterator.next().value!);\n } while (this.size > this._capacity);\n }\n\n /**\n * Removes all values from the set.\n */\n clear(): void {\n this._set.clear();\n }\n\n /**\n * Removes a specified value from the set.\n *\n * @param value The value to remove.\n *\n * @returns `true` if the value was found and removed, otherwise `false`.\n */\n delete(value: V): boolean {\n return this._set.delete(value);\n }\n\n /**\n * @param other The other set.\n *\n * @param capacity (Optional) The capacity for the new set. Defaults to this set's capacity.\n *\n * @returns A new set containing the values that are in this set and not in `other`\n */\n difference(other: ReadonlySetLike, capacity?: number): BoundedSet {\n return new BoundedSet(\n this._set.difference(other),\n capacity ?? this.capacity,\n );\n }\n\n /**\n * Returns an iterable of [value, value] pairs for every value in the set.\n *\n * @returns An iterable of [value, value] pairs for every value in the set.\n */\n entries(): SetIterator<[V, V]> {\n return this._set.entries();\n }\n\n /**\n * Executes a provided function once for each value in the set.\n *\n * @param callbackFn The function to execute.\n *\n * @param thisArg (Optional) The value to use as `this` when executing the function.\n */\n forEach(\n callbackFn: (value: V, value2: V, set: BoundedSet) => void,\n thisArg?: unknown,\n ): void {\n this._set.forEach((value, value2) => {\n callbackFn.call(thisArg, value, value2, this);\n });\n }\n\n /**\n * Checks whether the given value exists in the set.\n *\n * @param value The value to check.\n *\n * @returns `true` if the value exists, otherwise `false`.\n */\n has(value: V): boolean {\n return this._set.has(value);\n }\n\n /**\n * @param other The other set.\n *\n * @param capacity (Optional) The capacity for the new set. Defaults to this set's capacity.\n *\n * @return A new set containing the values that are in both this set and `other`.\n */\n intersection(\n other: ReadonlySetLike,\n capacity?: number,\n ): BoundedSet {\n return new BoundedSet(\n this._set.intersection(other),\n capacity ?? this.capacity,\n );\n }\n\n /**\n * @param other The other set.\n *\n * @returns `true` if this set has no values in common with `other`, otherwise `false`.\n */\n isDisjointFrom(other: ReadonlySetLike): boolean {\n return this._set.isDisjointFrom(other);\n }\n\n /**\n * @param other The other set.\n *\n * @returns `true` if all values in this set are in `other`, otherwise `false`.\n */\n isSubsetOf(other: ReadonlySetLike): boolean {\n return this._set.isSubsetOf(other);\n }\n\n /**\n * @param other The other set.\n *\n * @returns `true` if all values in `other` are in this set, otherwise `false`.\n */\n isSupersetOf(other: ReadonlySetLike): boolean {\n return this._set.isSupersetOf(other);\n }\n\n /**\n * Returns an iterable over the values in the set.\n *\n * @returns An iterable over the values in the set.\n */\n keys(): SetIterator {\n return this._set.keys();\n }\n\n /**\n * Removes and returns the oldest value in the set.\n *\n * @returns The removed value, or `undefined` if the set is empty.\n */\n shift(): V | undefined {\n const iterator = this.values();\n const next = iterator.next();\n if (next.done) {\n return undefined;\n }\n this.delete(next.value);\n return next.value;\n }\n\n /**\n * @param other The other set.\n * @param capacity (Optional) The capacity for the new set. Defaults to this set's capacity.\n *\n * @returns A new set containing the values that are in either this set or `other`, but not both.\n */\n symmetricDifference(\n other: ReadonlySetLike,\n capacity?: number,\n ): BoundedSet {\n return new BoundedSet(\n this._set.symmetricDifference(other),\n capacity ?? this.capacity,\n );\n }\n\n /**\n * The number of values in the set.\n */\n get size(): number {\n return this._set.size;\n }\n\n /**\n * @param other The other set.\n * @param capacity (Optional) The capacity for the new set. Defaults to this set's capacity.\n *\n * @returns A new set containing all values in this set and `other`.\n */\n union(other: ReadonlySetLike, capacity?: number): BoundedSet {\n return new BoundedSet(\n this._set.union(other),\n capacity ?? this.capacity,\n );\n }\n\n /**\n * Returns an iterable over the values in the set.\n *\n * @returns An iterable over the values in the set.\n */\n values(): SetIterator {\n return this._set.values();\n }\n\n /**\n * Returns an iterable over the values in the set.\n *\n * @returns An iterable over the values in the set.\n */\n [Symbol.iterator](): SetIterator {\n return this._set[Symbol.iterator]();\n }\n\n /**\n * The default string tag.\n */\n get [Symbol.toStringTag](): string {\n return BoundedSet.name;\n }\n}\n","/**\n * Represents a chunked segment of a sequence of values.\n *\n * @template T - The type of values in the chunk.\n */\nexport interface Chunk {\n /**\n * The zero-based index of the chunk.\n */\n chunkIndex: number;\n\n /**\n * The zero-based index in the original\n * sequence of the first value in the chunk.\n */\n startIndex: number;\n\n /**\n * The values contained in the chunk.\n */\n values: T[];\n}\n\n/**\n * Asynchronously splits an iterable into fixed-size chunks.\n *\n * @template T - The type of values in the input iterable.\n *\n * @param size - The maximum number of items per chunk. Must be a positive integer or `Infinity`.\n * @param values - The source of values to be chunked.\n *\n * @yields {Chunk} An object representing the next chunk in the sequence.\n *\n * @throws {RangeError} If `size` is less than 1 or not an integer (except for `Infinity`).\n *\n * @example\n * const data = [1, 2, 3, 4, 5];\n * for await (const chunk of chunkify(2, data)) {\n * console.log(chunk);\n * }\n * // Output:\n * // { chunkIndex: 0, startIndex: 0, values: [1, 2] }\n * // { chunkIndex: 1, startIndex: 2, values: [3, 4] }\n * // { chunkIndex: 2, startIndex: 4, values: [5] }\n */\nexport async function* asyncChunkify(\n size: number,\n values: Iterable | AsyncIterable,\n): AsyncGenerator> {\n if (size !== Infinity && (!Number.isInteger(size) || size < 1)) {\n throw new RangeError(\"Invalid chunk length\");\n }\n\n let chunkIndex = 0;\n let startIndex = 0;\n let chunk: T[] = [];\n for await (const value of values) {\n if (chunk.push(value) >= size) {\n yield { chunkIndex, startIndex, values: chunk };\n chunk = [];\n ++chunkIndex;\n startIndex += chunk.length;\n }\n }\n\n if (chunk.length > 0) {\n yield { chunkIndex, startIndex, values: chunk };\n }\n}\n\n/**\n * Splits an iterable into fixed-size chunks.\n *\n * @template T - The type of values in the input iterable.\n *\n * @param size - The maximum number of items per chunk. Must be a positive integer or `Infinity`.\n * @param values - The source of values to be chunked.\n *\n * @yields {Chunk} An object representing the next chunk in the sequence.\n *\n * @throws {RangeError} If `size` is less than 1 or not an integer (except for `Infinity`).\n *\n * @example\n * const data = [1, 2, 3, 4, 5];\n * for (const chunk of chunkify(2, data)) {\n * console.log(chunk);\n * }\n * // Output:\n * // { chunkIndex: 0, startIndex: 0, values: [1, 2] }\n * // { chunkIndex: 1, startIndex: 2, values: [3, 4] }\n * // { chunkIndex: 2, startIndex: 4, values: [5] }\n */\nexport function* chunkify(\n size: number,\n values: Iterable,\n): Generator> {\n if (size !== Infinity && (!Number.isInteger(size) || size < 1)) {\n throw new RangeError(\"Invalid chunk length\");\n }\n\n let chunkIndex = 0;\n let startIndex = 0;\n let chunk: T[] = [];\n for (const value of values) {\n if (chunk.push(value) >= size) {\n yield { chunkIndex, startIndex, values: chunk };\n chunk = [];\n ++chunkIndex;\n startIndex += chunk.length;\n }\n }\n\n if (chunk.length > 0) {\n yield { chunkIndex, startIndex, values: chunk };\n }\n}\n","import { randomUUID } from \"node:crypto\";\n\nimport {\n HEADER_CORRELATION_ID,\n HEADER_ORCHARD_IDENTITY_ID,\n} from \"@theorchard/ows-headers\";\n\nexport interface HeaderProvider {\n getHeaders(): Record | Promise>;\n}\n\nexport interface IdentityProviderConfig {\n identityId: string;\n}\n\nexport class IdentityProvider implements HeaderProvider {\n identityId: string;\n\n constructor(config: IdentityProviderConfig) {\n this.identityId = config.identityId;\n }\n\n async getHeaders(): Promise> {\n return {\n [HEADER_CORRELATION_ID]: randomUUID(),\n [HEADER_ORCHARD_IDENTITY_ID]: this.identityId,\n };\n }\n}\n","/**\n * A two-dimensional map implemented as a `Map` of `Map`s.\n *\n * Allows storing and retrieving values using a pair of keys.\n *\n * @template K1 - The type of the first-level (outer) key.\n * @template K2 - The type of the second-level (inner) key.\n * @template V - The type of the value.\n *\n * @example\n * const map = new Map2D();\n * map.set([\"a\", 1], \"b\");\n * console.log(map.get([\"a\", 1])); // \"b\"\n */\nexport class D2Map implements Map<[K1, K2], V> {\n private _data: Map>;\n private _size: number;\n\n constructor(iterable?: Iterable<[[K1, K2], V]> | null) {\n this._data = new Map();\n this._size = 0;\n if (iterable != null) {\n for (const [keys, value] of iterable) {\n this.set(keys, value);\n }\n }\n }\n\n /**\n * Removes all entries from the map.\n */\n clear(): void {\n this._data.clear();\n this._size = 0;\n }\n\n /**\n * Removes a specified entry from the map.\n *\n * @param keys The keys of the entry to remove.\n *\n * @returns `true` if the entry was found and removed, `false` otherwise.\n */\n delete(keys: [K1, K2]): boolean {\n return d2MapDelete(this._data, keys[0], keys[1]);\n }\n\n /**\n * Returns an iterable of [keys, value] pairs for every entry in the map.\n *\n * @returns An iterable of [keys, value] pairs for every entry in the map.\n */\n entries(): MapIterator<[[K1, K2], V]> {\n return this[Symbol.iterator]();\n }\n\n /**\n * Executes a provided function once for each entry in the map.\n *\n * @param callbackFn The function to execute.\n *\n * @param thisArg (Optional) The value to use as `this` when executing the function.\n */\n forEach(\n callbackFn: (value: V, keys: [K1, K2], map: Map<[K1, K2], V>) => void,\n thisArg?: unknown,\n ): void {\n for (const [keys, value] of this) {\n callbackFn.call(thisArg, value, keys, this);\n }\n }\n\n /**\n * Gets the value associated with the given keys.\n *\n * @param key The keys to check.\n *\n * @returns The value if the keys exist, otherwise `undefined`.\n */\n get(keys: [K1, K2]): V | undefined {\n return d2MapGet(this._data, keys[0], keys[1]);\n }\n\n /**\n * Checks whether the given keys exist in the map.\n *\n * @param key The keys to check.\n *\n * @returns `true` if the keys exist, otherwise `false`.\n */\n has(keys: [K1, K2]): boolean {\n return d2MapHas(this._data, keys[0], keys[1]);\n }\n\n /**\n * Returns an iterable over the keys in the map.\n *\n * @returns An iterable over the keys in the map.\n */\n *keys(): MapIterator<[K1, K2]> {\n for (const [key1, map] of this._data) {\n for (const key2 of map.keys()) {\n yield [key1, key2];\n }\n }\n }\n\n /**\n * Adds a new keys-value pair to the map.\n *\n * @param key The keys to set.\n * @param value The value associated with the keys.\n *\n * @returns The map instance.\n */\n set(keys: [K1, K2], value: V): this {\n d2MapSet(this._data, keys[0], keys[1], value);\n return this;\n }\n\n /**\n * The number of entries in the map.\n */\n get size(): number {\n return this._size;\n }\n\n /**\n * Returns an iterable over the values in the map.\n *\n * @returns An iterable over the values in the map.\n */\n *values(): MapIterator {\n for (const map of this._data.values()) {\n for (const value of map.values()) {\n yield value;\n }\n }\n }\n\n /**\n * Returns an iterable over the entries in the map.\n *\n * @returns An iterable over the entries in the map.\n */\n *[Symbol.iterator](): MapIterator<[[K1, K2], V]> {\n for (const [key1, map] of this._data) {\n for (const [key2, value] of map) {\n yield [[key1, key2], value];\n }\n }\n }\n\n /**\n * The default string tag.\n */\n get [Symbol.toStringTag](): string {\n return D2Map.name;\n }\n}\n\n/**\n * Removes a specified entry from the map.\n *\n * @param key1 The key for the outer map.\n * @param key2 The key for the inner map.\n *\n * @returns `true` if the entry was found and removed, `false` otherwise.\n */\nexport function d2MapDelete(\n map2d: Map>,\n key1: K1,\n key2: K2,\n): boolean {\n const map = map2d.get(key1);\n if (map == null || !map.delete(key2)) {\n return false;\n }\n if (map.size < 1) {\n map2d.delete(key1);\n }\n return true;\n}\n\n/**\n * Gets the value associated with the given keys.\n *\n * @param key1 The key for the outer map.\n * @param key2 The key for the inner map.\n *\n * @returns The value if the keys exist, otherwise `undefined`.\n */\nexport function d2MapGet(\n map2d: Map>,\n key1: K1,\n key2: K2,\n): V | undefined {\n return map2d.get(key1)?.get(key2);\n}\n\n/**\n * Checks whether the given keys exist in the map.\n *\n * @param key1 The key for the outer map.\n * @param key2 The key for the inner map.\n *\n * @returns `true` if the keys exist, otherwise `false`.\n */\nexport function d2MapHas(\n map2d: Map>,\n key1: K1,\n key2: K2,\n): boolean {\n return map2d.get(key1)?.has(key2) ?? false;\n}\n\n/**\n * Adds a new keys-value pair to the map.\n *\n * @param key1 The key for the outer map.\n * @param key2 The key for the inner map.\n *\n * @param value The value associated with the keys.\n */\nexport function d2MapSet(\n map2d: Map>,\n key1: K1,\n key2: K2,\n value: V,\n): void {\n let map1d = map2d.get(key1);\n if (map1d == null) {\n map1d = new Map();\n map2d.set(key1, map1d);\n }\n map1d.set(key2, value);\n}\n","/**\n * Converts camelCase to PascalCase\n *\n * @param str A string in camelCase\n *\n * @returns A string in PascalCase\n */\nexport function camelToPascal(str: string): string {\n return str.slice(0, 1).toUpperCase() + str.slice(1);\n}\n\n/**\n * Converts camelCase to snake_case\n *\n * @param str A string in camelCase\n *\n * @returns A string in snake_case\n */\nexport function camelToSnake(str: string): string {\n return str.replace(/([a-z0-9])([A-Z])/g, \"$1_$2\").toLowerCase();\n}\n\n/**\n * Capitalized the first character in the string\n *\n * @param str A string\n *\n * @return The given string with the first character capitalized\n */\nexport function capitalize(str: string): string {\n return str.slice(0, 1).toUpperCase() + str.slice(1);\n}\n\n/**\n * Converts PascalCase to camelCase\n *\n * @param str A string in PascalCase\n *\n * @returns A string in camelCase\n */\nexport function pascalToCamel(str: string): string {\n return str.slice(0, 1).toLowerCase() + str.slice(1);\n}\n\n/**\n * Converts PascalCase to snake_case\n *\n * @param str A string in PascalCase\n *\n * @returns A string in snake_case\n */\nexport function pascalToSnake(str: string): string {\n return camelToSnake(pascalToCamel(str));\n}\n\n/**\n * Converts snake_case to camelCase\n *\n * @param str A string in snake_case\n *\n * @returns A string in camelCase\n */\nexport function snakeToCamel(str: string): string {\n return str\n .replaceAll(/_([^_])/g, (_, char) => char.toUpperCase())\n .replaceAll(\"_\", \"\");\n}\n\n/**\n * Converts snake_case to PascalCase\n *\n * @param str A string in snake_case\n *\n * @returns A string in PascalCase\n */\nexport function snakeToPascal(str: string): string {\n return camelToPascal(snakeToCamel(str));\n}\n\n/**\n * Takes a string of space separated text\n * and converts to camelCase.\n *\n * @param str\n *\n * @returns A string in camelCase\n */\nexport function toCamelCase(str: string): string {\n return str\n .trim()\n .toLowerCase()\n .replaceAll(/\\s+([^\\s])/g, (_, char) => char.toUpperCase());\n}\n\n/**\n * Takes a string of space separated text\n * and converts to PascalCase.\n *\n * @param str\n *\n * @returns A string in camelCase\n */\nexport function toPascalCase(str: string): string {\n return str\n .trim()\n .toLowerCase()\n .replaceAll(/(?:^|\\s+)([^\\s])/g, (_, char) => char.toUpperCase());\n}\n\n/**\n * Takes a string of space separated text\n * and converts to snake_case.\n *\n * @param str\n *\n * @returns A string in snake_case\n */\nexport function toSnakeCase(str: string): string {\n return str.trim().toLowerCase().replaceAll(/\\s+/g, \"_\");\n}\n","/**\n * Waits the given amount of time.\n *\n * @param ms - Time to wait in milliseconds\n */\nexport function wait(ms: number): Promise {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Waits until the given timestamp.\n *\n * @param ts - Unix timestamp in milliseconds (e.g. `Date.now()`)\n */\nexport async function waitUntil(ts: number): Promise {\n for (let now = Date.now(); ts > now; now = Date.now()) {\n await wait(ts - now);\n }\n}\n","import { camelToSnake, snakeToCamel } from \"./string\";\nimport { CamelToSnakeKeys, SnakeToCamelKeys } from \"./types\";\nimport { LowercaseKeys, UppercaseKeys } from \"./types/string\";\n\n/**\n * Creates a new object with the same values and\n * keys transformed from camelCase to snake_case.\n *\n * @typeParam T The type of the input object\n *\n * @param obj The object whose keys will be transformed\n *\n * @returns A new object with snake_case keys\n */\nexport function camelToSnakeKeys(\n obj: T,\n): CamelToSnakeKeys {\n const out = {} as Record;\n for (const key of Object.keys(obj)) {\n const outKey = typeof key === \"string\" ? camelToSnake(key) : key;\n out[outKey] = obj[key as keyof T];\n }\n return out as CamelToSnakeKeys;\n}\n\n/**\n * Creates a new object with the same\n * values and keys transformed to lowercase.\n *\n * @typeParam T The type of the input object\n *\n * @param obj The object whose keys will be transformed\n *\n * @returns A new object with lowercase keys\n */\nexport function lowercaseKeys(obj: T): LowercaseKeys {\n const out = {} as Record;\n for (const key of Object.keys(obj)) {\n const outKey = typeof key === \"string\" ? key.toLowerCase() : key;\n out[outKey] = obj[key as keyof T];\n }\n return out as LowercaseKeys;\n}\n\n/**\n * Creates a new object with the same values and\n * keys transformed from snake_case to camelCase.\n *\n * @typeParam T The type of the input object\n *\n * @param obj The object whose keys will be transformed\n *\n * @returns A new object with camelCase keys\n */\nexport function snakeToCamelKeys(\n obj: T,\n): SnakeToCamelKeys {\n const out = {} as Record;\n for (const key of Object.keys(obj)) {\n const outKey = typeof key === \"string\" ? snakeToCamel(key) : key;\n out[outKey] = obj[key as keyof T];\n }\n return out as SnakeToCamelKeys;\n}\n\n/**\n * Converts a synchronous or asynchronous\n * iterator into an asynchronous generator.\n *\n * Allows consistent handling of iterators\n * regardless of whether they are synchronous\n * or asynchronous.\n *\n * @typeParam T The type of values yielded by the iterator\n *\n * @param iterator - A sync / async iterator\n *\n * @returns An async generator\n */\nexport async function* toAsyncIterator(\n iterator: AsyncIterator | Iterator,\n): AsyncGenerator {\n let result = await iterator.next();\n while (!result.done) {\n yield result.value;\n result = await iterator.next();\n }\n}\n\n/**\n * Creates a new object with the same\n * values and keys transformed to uppercase.\n *\n * @typeParam T The type of the input object\n *\n * @param obj The object whose keys will be transformed\n *\n * @returns A new object with uppercase keys\n */\nexport function uppercaseKeys(obj: T): UppercaseKeys {\n const out = {} as Record;\n for (const key of Object.keys(obj)) {\n const outKey = typeof key === \"string\" ? key.toUpperCase() : key;\n out[outKey] = obj[key as keyof T];\n }\n return out as UppercaseKeys;\n}\n","/**\n * Represents the possible runtime environments\n */\nexport enum Environment {\n /**\n * Development environment\n */\n Dev = \"dev\",\n\n /**\n * Production environment\n */\n Prod = \"prod\",\n\n /**\n * Quality assurance (QA) environment\n */\n QA = \"qa\",\n\n /**\n * Testing environment\n */\n Test = \"test\",\n\n /**\n * User acceptance testing (UAT) environment\n */\n UAT = \"uat\",\n}\n","/**\n * Represents the severity level of a log message.\n *\n * These levels can be used to filter or control logging output.\n */\nexport enum LogLevel {\n /**\n * Debug-level messages. Used for development and diagnostics.\n */\n Debug = \"debug\",\n\n /**\n * Error-level messages. Used for failures and unexpected conditions.\n */\n Error = \"error\",\n\n /**\n * Info-level messages. Used for general events.\n */\n Info = \"info\",\n\n /**\n * Disables logging\n */\n Off = \"off\",\n\n /**\n * Warning-level messages. Used for recoverable issues and unexpected non-fatal events.\n */\n Warning = \"warning\",\n}\n","import { randomUUID } from \"node:crypto\";\n\n/**\n * Represents a reusable source of values that supports both\n * on-demand generation via `next()` and iterable consumption.\n *\n * @template T - The type of values produced by the source.\n */\nexport interface Source extends Iterable {\n /**\n * Returns the next value from the source.\n *\n * This method should return a new value each time it is called.\n */\n next(): T;\n}\n\n/**\n * A source of infinite UUIDv4 strings.\n *\n * Implements a `next()` method for generating a single UUID\n * and an infinite iterable that yields UUIDs on demand.\n */\nexport class UuidSource implements Source {\n /**\n * Returns a generated UUID string\n */\n next(): string {\n return randomUUID();\n }\n\n /**\n * Returns an infinite iterator of UUID strings\n *\n * @returns {Iterator}\n */\n *[Symbol.iterator](): Iterator {\n while (true) {\n yield this.next();\n }\n }\n}\n"],"mappings":"ibAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,gBAAAE,EAAA,eAAAC,EAAA,UAAAC,EAAA,gBAAAC,EAAA,qBAAAC,EAAA,aAAAC,EAAA,eAAAC,EAAA,kBAAAC,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,qBAAAC,EAAA,eAAAC,EAAA,aAAAC,EAAA,gBAAAC,EAAA,aAAAC,EAAA,aAAAC,EAAA,aAAAC,EAAA,YAAAC,EAAA,mBAAAC,EAAA,YAAAC,EAAA,oBAAAC,EAAA,aAAAC,EAAA,cAAAC,EAAA,eAAAC,EAAA,UAAAC,EAAA,eAAAC,EAAA,aAAAC,EAAA,aAAAC,EAAA,aAAAC,EAAA,mBAAAC,EAAA,kBAAAC,EAAA,kBAAAC,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,qBAAAC,EAAA,kBAAAC,EAAA,oBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,EAAA,gBAAAC,EAAA,kBAAAC,EAAA,SAAAC,EA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H,EAAIE,CAAc,CAClC,CACA,OAAOD,CACT,CAgBA,eAAuBO,EACrBC,EACmB,CACnB,IAAIC,EAAS,MAAMD,EAAS,KAAK,EACjC,KAAO,CAACC,EAAO,MACb,MAAMA,EAAO,MACbA,EAAS,MAAMD,EAAS,KAAK,CAEjC,CAYO,SAASE,EAAgCX,EAA0B,CACxE,IAAMC,EAAM,CAAC,EACb,QAAWC,KAAO,OAAO,KAAKF,CAAG,EAAG,CAClC,IAAMG,EAAS,OAAOD,GAAQ,SAAWA,EAAI,YAAY,EAAIA,EAC7DD,EAAIE,CAAM,EAAIH,EAAIE,CAAc,CAClC,CACA,OAAOD,CACT,CCvGO,IAAKW,OAIVA,EAAA,IAAM,MAKNA,EAAA,KAAO,OAKPA,EAAA,GAAK,KAKLA,EAAA,KAAO,OAKPA,EAAA,IAAM,MAxBIA,OAAA,ICEL,IAAKC,OAIVA,EAAA,MAAQ,QAKRA,EAAA,MAAQ,QAKRA,EAAA,KAAO,OAKPA,EAAA,IAAM,MAKNA,EAAA,QAAU,UAxBAA,OAAA,ICLZ,IAAAC,EAA2B,kBAuBdC,EAAN,KAA2C,CAIhD,MAAe,CACb,SAAO,cAAW,CACpB,CAOA,EAAE,OAAO,QAAQ,GAAsB,CACrC,OACE,MAAM,KAAK,KAAK,CAEpB,CACF","names":["index_exports","__export","BoundedMap","BoundedSet","D2Map","Environment","IdentityProvider","LogLevel","UuidSource","asyncChunkify","camelToPascal","camelToSnake","camelToSnakeKeys","capitalize","chunkify","d2MapDelete","d2MapGet","d2MapHas","d2MapSet","isAlpha","isAlphaNumeric","isArray","isAsyncIterable","isBigInt","isBoolean","isFunction","isInt","isIterable","isNumber","isObject","isString","isTransferable","lowercaseKeys","pascalToCamel","pascalToSnake","snakeToCamel","snakeToCamelKeys","snakeToPascal","toAsyncIterator","toCamelCase","toPascalCase","toSnakeCase","uppercaseKeys","wait","waitUntil","__toCommonJS","isAlpha","value","isString","isAlphaNumeric","isArray","isAsyncIterable","isObject","isFunction","isBigInt","isBoolean","isInt","isNumber","isIterable","isTransferable","BoundedMap","_BoundedMap","map","capacity","isNumber","value","isInt","iterator","key","callbackFn","thisArg","next","BoundedSet","_BoundedSet","set","capacity","isNumber","value","isInt","iterator","other","callbackFn","thisArg","value2","next","asyncChunkify","size","values","chunkIndex","startIndex","chunk","value","chunkify","import_node_crypto","import_ows_headers","IdentityProvider","config","D2Map","_D2Map","iterable","keys","value","d2MapDelete","callbackFn","thisArg","d2MapGet","d2MapHas","key1","map","key2","d2MapSet","map2d","map1d","camelToPascal","str","camelToSnake","capitalize","pascalToCamel","pascalToSnake","snakeToCamel","_","char","snakeToPascal","toCamelCase","toPascalCase","toSnakeCase","wait","ms","resolve","waitUntil","ts","now","camelToSnakeKeys","obj","out","key","outKey","camelToSnake","lowercaseKeys","snakeToCamelKeys","snakeToCamel","toAsyncIterator","iterator","result","uppercaseKeys","Environment","LogLevel","import_node_crypto","UuidSource"]}