@transcend-io/type-utils 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -374,32 +374,39 @@ declare const createDefaultCodec: <C extends t.Mixed>(codec: C) => t.TypeOf<C>;
374
374
  //#region src/enum.d.ts
375
375
  /**
376
376
  * An enumerated value.
377
+ * @deprecated - Enum utils are deprecated
377
378
  */
378
379
  type Enumerate<T = string, TKey extends string = string> = { [key in TKey]: T };
379
380
  /**
380
381
  * A TypeScript enum with string values.
382
+ * @deprecated - Enum utils are deprecated
381
383
  */
382
384
  type TypescriptEnum = { [key in string]: string } | { [key in number]: string };
383
385
  /**
384
386
  * An input when defining an enum can be an object of string -> string or a list
385
387
  * of strings.
388
+ * @deprecated - Enum utils are deprecated
386
389
  */
387
390
  type EnumInput<T, TKey extends string = string> = Enumerate<T, TKey> | string[];
388
391
  /**
389
392
  * Convert a list of strings to an enum-like object.
393
+ * @deprecated - Enum utils are deprecated
390
394
  */
391
395
  declare function listToEnum(attributes: string[]): Enumerate<string>;
392
396
  /**
393
397
  * Merge enum-like inputs into a single enum object.
398
+ * @deprecated - Enum utils are deprecated
394
399
  */
395
400
  declare function createEnum<T = string, TKey extends string = string>(...attributes: EnumInput<T, TKey>[]): Enumerate<T, TKey>;
396
401
  /**
397
402
  * Filter an enum and return the keys that remain.
403
+ * @deprecated - Enum utils are deprecated
398
404
  */
399
405
  declare function filterEnum<T extends ObjByString>(obj: T, filterFunc: (value: T[keyof T], key: keyof T, calculatedEnum: Enumerate<T[keyof T]>) => boolean): (keyof T)[];
400
406
  /**
401
407
  * Make an enum compatible with type inference without changing its runtime
402
408
  * shape.
409
+ * @deprecated – Enum utils are deprecated
403
410
  */
404
411
  declare function makeEnum<T extends {
405
412
  [index: string]: Value | Value[];
@@ -410,11 +417,11 @@ declare function makeEnum<T extends {
410
417
  * The HTTP method types.
411
418
  */
412
419
  declare const HttpMethod: {
413
- /** A GET request. */Get: "GET"; /** A POST request. */
414
- Post: "POST"; /** A DELETE request. */
415
- Delete: "DELETE"; /** A PUT request. */
416
- Put: "PUT"; /** A PATCH request. */
417
- Patch: "PATCH";
420
+ /** A GET request. */readonly Get: "GET"; /** A POST request. */
421
+ readonly Post: "POST"; /** A DELETE request. */
422
+ readonly Delete: "DELETE"; /** A PUT request. */
423
+ readonly Put: "PUT"; /** A PATCH request. */
424
+ readonly Patch: "PATCH";
418
425
  };
419
426
  /**
420
427
  * The HTTP method string union.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":["JSONSchema4TypeName","JSONSchema4Type","JSONSchema4Object","JSONSchema4Array","key","Array","JSONSchema4Version","JSONSchema4","id","$ref","$schema","title","description","default","multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","items","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","definitions","k","properties","patternProperties","dependencies","enum","type","allOf","anyOf","oneOf","not","extends","format","JSONSchema6TypeName","JSONSchema6Type","JSONSchema6Object","JSONSchema6Array","JSONSchema6Version","JSONSchema6Definition","JSONSchema6","$id","contains","propertyNames","const","examples","JSONSchema7TypeName","JSONSchema7Type","JSONSchema7Object","JSONSchema7Array","JSONSchema7Version","JSONSchema7Definition","JSONSchema7","$comment","$defs","if","then","else","contentMediaType","contentEncoding","readOnly","writeOnly","ValidationResult","ValidationError","valid","errors","property","message","validate","instance","schema","checkPropertyChange","value","mustBeValid","result"],"sources":["../src/types.ts","../src/apply.ts","../src/codecTools/decodeCodec.ts","../src/codecTools/dictionary.ts","../src/codecTools/FixedLengthString.ts","../src/codecTools/FixedLengthArray.ts","../src/codecTools/partialRecord.ts","../src/codecTools/isCodecError.ts","../src/codecTools/NonEmptyString.ts","../../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts","../src/codecTools/toJsonSchema.ts","../src/codecTools/createDefaultCodec.ts","../src/enum.ts","../src/enums.ts","../src/getEntries.ts","../src/getKeys.ts","../src/getValues.ts","../src/groupBy.ts","../src/gql.ts","../src/invert.ts","../src/valuesOf.ts","../src/findAllWithRegex.ts","../src/flattenObject.ts","../src/aggregateObjects.ts","../src/transposeObjectArray.ts","../src/fromEntries.ts","../src/noExcess.ts"],"x_google_ignoreList":[9],"mappings":";;;;;;KAGY,WAAA;;;AAKZ;KAAY,WAAA,OAAkB,IAAA;;;;KAKlB,QAAA;;;;KAKA,OAAA,eAAsB,QAAA,IAAY,KAAA,2BAAgC,KAAA;AAA9E;;;AAAA,KAKY,WAAA,UAAqB,KAAA,SAAc,OAAA,iBAAwB,MAAA,GAAS,KAAA;;;;KAKpE,iBAAA,UAA2B,KAAA,2BAAgC,KAAA,GAAQ,KAAA;;;;KAKnE,OAAA,MAAa,CAAA,GAAI,CAAA;;;;KAKjB,QAAA,oBACE,CAAA,GAAI,CAAA,CAAE,CAAA;;;;KAMR,iBAAA,MAAuB,CAAA,SAAU,QAAA,GACzC,OAAA,CAAQ,CAAA,mBACN,QAAA,CAAS,OAAA,CAAQ,CAAA,OACjB,CAAA,GACF,CAAA,kBACE,CAAA,GACA,CAAA,gCAEgB,CAAA,GAAI,CAAA,CAAE,CAAA,mBAAoB,QAAA,CAAS,CAAA,CAAE,CAAA,KAAM,CAAA,CAAE,CAAA,MAE3D,CAAA;;;;KAKI,WAAA,oBAA+B,CAAA,IAAK,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,IAAK,OAAA,CAAQ,CAAA;;;;KAKlE,SAAA,oBAA6B,CAAA,IAAK,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,IAAK,QAAA,SAAiB,CAAA,GAAI,CAAA,CAAE,CAAA;;;;KAK/E,SAAA,oBAA6B,CAAA,IAAK,IAAA,CAAK,CAAA,EAAG,CAAA,kBACxC,CAAA;;;;KAMF,UAAA,cAAwB,WAAA,IAAe,OAAA,OAAc,IAAA;;;;KAKrD,YAAA,cAA0B,WA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A,YAAA,CACzE,OAAA,EAAS,QAAA,WACA,QAAA,YAAoB,CAAA,MAAO,CAAA;;;;;AzBFtC;c0BiFa,QAAA,aAAsB,CAAA,CAAE,QAAA,EACnC,KAAA,EAAO,CAAA,EACP,IAAA,cACC,YAAA,CAAa,CAAA;;;;cAoCH,YAAA,WAAuB,CAAA,CAAE,GAAA,MAAS,CAAA,YAAa,CAAA,uBAAwB,CAAA,CAAE,IAAA,CACpF,CAAA,EACA,CAAA,EACA,CAAA;EAAA,SASkB,IAAA,EAAM,CAAA;EAAA,SAPR,IAAA;cAGd,IAAA,UACA,EAAA,EAAI,YAAA,CAAa,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,SAC1B,QAAA,EAAU,YAAA,CAAa,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,eAChC,MAAA,EAAQ,YAAA,CAAa,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,aACd,IAAA,EAAM,CAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":["JSONSchema4TypeName","JSONSchema4Type","JSONSchema4Object","JSONSchema4Array","key","Array","JSONSchema4Version","JSONSchema4","id","$ref","$schema","title","description","default","multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","items","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","definitions","k","properties","patternProperties","dependencies","enum","type","allOf","anyOf","oneOf","not","extends","format","JSONSchema6TypeName","JSONSchema6Type","JSONSchema6Object","JSONSchema6Array","JSONSchema6Version","JSONSchema6Definition","JSONSchema6","$id","contains","propertyNames","const","examples","JSONSchema7TypeName","JSONSchema7Type","JSONSchema7Object","JSONSchema7Array","JSONSchema7Version","JSONSchema7Definition","JSONSchema7","$comment","$defs","if","then","else","contentMediaType","contentEncoding","readOnly","writeOnly","ValidationResult","ValidationError","valid","errors","property","message","validate","instance","schema","checkPropertyChange","value","mustBeValid","result"],"sources":["../src/types.ts","../src/apply.ts","../src/codecTools/decodeCodec.ts","../src/codecTools/dictionary.ts","../src/codecTools/FixedLengthString.ts","../src/codecTools/FixedLengthArray.ts","../src/codecTools/partialRecord.ts","../src/codecTools/isCodecError.ts","../src/codecTools/NonEmptyString.ts","../../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts","../src/codecTools/toJsonSchema.ts","../src/codecTools/createDefaultCodec.ts","../src/enum.ts","../src/enums.ts","../src/getEntries.ts","../src/getKeys.ts","../src/getValues.ts","../src/groupBy.ts","../src/gql.ts","../src/invert.ts","../src/valuesOf.ts","../src/findAllWithRegex.ts","../src/flattenObject.ts","../src/aggregateObjects.ts","../src/transposeObjectArray.ts","../src/fromEntries.ts","../src/noExcess.ts"],"x_google_ignoreList":[9],"mappings":";;;;;;KAGY,WAAA;;;AAKZ;KAAY,WAAA,OAAkB,IAAA;;;;KAKlB,QAAA;;;;KAKA,OAAA,eAAsB,QAAA,IAAY,KAAA,2BAAgC,KAAA;AAA9E;;;AAAA,KAKY,WAAA,UAAqB,KAAA,SAAc,OAAA,iBAAwB,MAAA,GAAS,KAAA;;;;KAKpE,iBAAA,UAA2B,KAAA,2BAAgC,KAAA,GAAQ,KAAA;;;;KAKnE,OAAA,MAAa,CAAA,GAAI,CAAA;;;;KAKjB,QAAA,oBACE,CAAA,GAAI,CAAA,CAAE,CAAA;;;;KAMR,iBAAA,MAAuB,CAAA,SAAU,QAAA,GACzC,OAAA,CAAQ,CAAA,mBACN,QAAA,CAAS,OAAA,CAAQ,CAAA,OACjB,CAAA,GACF,CAAA,kBACE,CAAA,GACA,CAAA,gCAEgB,CAAA,GAAI,CAAA,CAAE,CAAA,mBAAoB,QAAA,CAAS,CAAA,CAAE,CAAA,KAAM,CAAA,CAAE,CAAA,MAE3D,CAAA;;;;KAKI,WAAA,oBAA+B,CAAA,IAAK,QAAA,CAAS,IAAA,CAAK,CAAA,EAAG,CAAA,IAAK,OAAA,CAAQ,CAAA;;;;KAKlE,SAAA,o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A,EAAG,CAAA;AAAA;;;;;cAOT,oBAAA,qCAA0D,CAAA;EAAG,OAAA;EAAA,UAAA;EAAA;AAAA;ExBDtD,qCwBOlB,OAAA,EAAS,CAAA,IxBPS;EwBSlB,UAAA,EAAY,CAAA,IxBJF;EwBMV,OAAA;IxBNiB,wEwBQf,sBAAA;EAAA;AAAA,MAEA,qBAAA,CAAsB,CAAA,EAAG,CAAA;;;;;;iBCzBb,WAAA,wBAAmC,aAAA,WAAwB,WAAA,YAAA,CACzE,OAAA,EAAS,QAAA,WACA,QAAA,YAAoB,CAAA,MAAO,CAAA;;;;;AzBFtC;c0BiFa,QAAA,aAAsB,CAAA,CAAE,QAAA,EACnC,KAAA,EAAO,CAAA,EACP,IAAA,cACC,YAAA,CAAa,CAAA;;;;cAoCH,YAAA,WAAuB,CAAA,CAAE,GAAA,MAAS,CAAA,YAAa,CAAA,uBAAwB,CAAA,CAAE,IAAA,CACpF,CAAA,EACA,CAAA,EACA,CAAA;EAAA,SASkB,IAAA,EAAM,CAAA;EAAA,SAPR,IAAA;cAGd,IAAA,UACA,EAAA,EAAI,YAAA,CAAa,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,SAC1B,QAAA,EAAU,YAAA,CAAa,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,eAChC,MAAA,EAAQ,YAAA,CAAa,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,aACd,IAAA,EAAM,CAAA;AAAA"}
package/dist/index.mjs CHANGED
@@ -4,6 +4,7 @@ import * as t from "io-ts";
4
4
  //#region src/enum.ts
5
5
  /**
6
6
  * Convert a list of strings to an enum-like object.
7
+ * @deprecated - Enum utils are deprecated
7
8
  */
8
9
  function listToEnum(attributes) {
9
10
  return attributes.reduce((accumulator, value) => {
@@ -13,6 +14,7 @@ function listToEnum(attributes) {
13
14
  }
14
15
  /**
15
16
  * Merge enum-like inputs into a single enum object.
17
+ * @deprecated - Enum utils are deprecated
16
18
  */
17
19
  function createEnum(...attributes) {
18
20
  const objectAttributes = attributes.map((attribute) => Array.isArray(attribute) ? listToEnum(attribute) : attribute);
@@ -20,6 +22,7 @@ function createEnum(...attributes) {
20
22
  }
21
23
  /**
22
24
  * Filter an enum and return the keys that remain.
25
+ * @deprecated - Enum utils are deprecated
23
26
  */
24
27
  function filterEnum(obj, filterFunc) {
25
28
  return Object.keys(obj).filter((key) => filterFunc(obj[key], key, obj)).map((key) => key);
@@ -27,6 +30,7 @@ function filterEnum(obj, filterFunc) {
27
30
  /**
28
31
  * Make an enum compatible with type inference without changing its runtime
29
32
  * shape.
33
+ * @deprecated – Enum utils are deprecated
30
34
  */
31
35
  function makeEnum(value) {
32
36
  return value;
@@ -252,13 +256,18 @@ const createDefaultCodec = (codec) => {
252
256
  /**
253
257
  * The HTTP method types.
254
258
  */
255
- const HttpMethod = makeEnum({
259
+ const HttpMethod = {
260
+ /** A GET request. */
256
261
  Get: "GET",
262
+ /** A POST request. */
257
263
  Post: "POST",
264
+ /** A DELETE request. */
258
265
  Delete: "DELETE",
266
+ /** A PUT request. */
259
267
  Put: "PUT",
268
+ /** A PATCH request. */
260
269
  Patch: "PATCH"
261
- });
270
+ };
262
271
  //#endregion
263
272
  //#region src/getEntries.ts
264
273
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/enum.ts","../src/getKeys.ts","../src/apply.ts","../src/codecTools/decodeCodec.ts","../src/codecTools/dictionary.ts","../src/codecTools/FixedLengthString.ts","../src/codecTools/FixedLengthArray.ts","../src/codecTools/partialRecord.ts","../src/codecTools/isCodecError.ts","../src/codecTools/NonEmptyString.ts","../src/codecTools/toJsonSchema.ts","../src/codecTools/createDefaultCodec.ts","../src/enums.ts","../src/getEntries.ts","../src/getValues.ts","../src/groupBy.ts","../src/gql.ts","../src/invert.ts","../src/valuesOf.ts","../src/findAllWithRegex.ts","../src/aggregateObjects.ts","../src/flattenObject.ts","../src/transposeObjectArray.ts","../src/fromEntries.ts","../src/noExcess.ts"],"sourcesContent":["import type { ObjByString } from './types.js';\n\n/**\n * An enumerated value.\n */\nexport type Enumerate<T = string, TKey extends string = string> = {\n [key in TKey]: T;\n};\n\n/**\n * A TypeScript enum with string values.\n */\nexport type TypescriptEnum = { [key in string]: string } | { [key in number]: string };\n\n/**\n * An input when defining an enum can be an object of string -> string or a list\n * of strings.\n */\nexport type EnumInput<T, TKey extends string = string> = Enumerate<T, TKey> | string[];\n\n/**\n * Convert a list of strings to an enum-like object.\n */\nexport function listToEnum(attributes: string[]): Enumerate<string> {\n const initialValue: Enumerate<string> = {};\n return attributes.reduce((accumulator, value) => {\n accumulator[value] = value;\n return accumulator;\n }, initialValue);\n}\n\n/**\n * Merge enum-like inputs into a single enum object.\n */\nexport function createEnum<T = string, TKey extends string = string>(\n ...attributes: EnumInput<T, TKey>[]\n): Enumerate<T, TKey> {\n const objectAttributes = attributes.map((attribute) =>\n Array.isArray(attribute) ? listToEnum(attribute) : attribute,\n );\n\n return Object.assign({}, ...objectAttributes);\n}\n\n/**\n * Filter an enum and return the keys that remain.\n */\nexport function filterEnum<T extends ObjByString>(\n obj: T,\n filterFunc: (value: T[keyof T], key: keyof T, calculatedEnum: Enumerate<T[keyof T]>) => boolean,\n): (keyof T)[] {\n return (Object.keys(obj) as (keyof T)[])\n .filter((key) => filterFunc(obj[key], key, obj))\n .map((key) => key);\n}\n\n/**\n * Make an enum compatible with type inference without changing its runtime\n * shape.\n */\nexport function makeEnum<T extends { [index: string]: Value | Value[] }, Value extends string>(\n value: T,\n): T {\n return value;\n}\n","import type { StringKeys } from './types.js';\n\n/**\n * `Object.keys` for string keys only.\n */\nexport function getStringKeys<T extends {}>(obj: T): StringKeys<T>[] {\n return Object.keys(obj).filter((key) => typeof key === 'string') as StringKeys<T>[];\n}\n\n/**\n * `Object.keys` that preserves key types.\n */\nexport function getKeys<T extends {}>(obj: T): (keyof T)[] {\n return Object.keys(obj) as (keyof T)[];\n}\n","import { createEnum } from './enum.js';\nimport { getKeys } from './getKeys.js';\nimport type { ObjByString, StringKeys } from './types.js';\n\n/**\n * Apply a function to each value of an object while preserving the key types.\n */\nexport function apply<TInput extends ObjByString, TOutput>(\n obj: TInput,\n applyFunc: (\n value: TInput[keyof TInput],\n key: StringKeys<TInput>,\n fullObj: typeof obj,\n index: number,\n ) => TOutput,\n): { [key in keyof TInput]: TOutput } {\n const result = Object.keys(obj).reduce(\n (accumulator, key, index) =>\n Object.assign(accumulator, {\n [key]: applyFunc(obj[key], key as StringKeys<TInput>, obj, index),\n }),\n {},\n );\n\n return result as { [key in keyof TInput]: TOutput };\n}\n\n/**\n * Async version of `apply`.\n */\nexport async function asyncApply<TInput extends ObjByString, TOutput>(\n obj: TInput,\n applyFunc: (\n value: TInput[keyof TInput],\n key: StringKeys<TInput>,\n fullObj: typeof obj,\n index: number,\n ) => Promise<TOutput>,\n): Promise<{ [key in keyof TInput]: TOutput }> {\n const entries = await Promise.all(\n getKeys(obj).map(async (key, index) => ({\n key,\n value: await applyFunc(obj[key], key as StringKeys<TInput>, obj, index),\n })),\n );\n\n const result = entries.reduce(\n (accumulator, { key, value }) =>\n Object.assign(accumulator, {\n [key]: value,\n }),\n {},\n );\n\n return result as { [key in keyof TInput]: TOutput };\n}\n\n/**\n * Convert a TypeScript enum to a value-to-value map and then call `apply`.\n */\nexport function applyEnum<TEnum extends string, TOutput>(\n enm: { [key in string]: TEnum },\n applyFunc: (value: TEnum, key: TEnum, fullObj: typeof enm, index: number) => TOutput,\n): { [key in TEnum]: TOutput } {\n const obj = createEnum<TEnum, TEnum>(Object.values(enm));\n return apply(obj, applyFunc) as any;\n}\n","import * as either from 'fp-ts/lib/Either.js';\nimport { pipe } from 'fp-ts/lib/function.js';\nimport * as t from 'io-ts';\n\n/**\n * Determine the codec paths that are invalid.\n */\nfunction getPaths<A>(validation: t.Validation<A>): string[] {\n return pipe(\n validation,\n either.fold(\n (errors) =>\n errors.map((error) => {\n const lastContext = error.context.at(-1);\n const fullPath = error.context.map(({ key }) => key).join('.');\n return `${fullPath} expected type '${lastContext?.type.name}'`;\n }),\n () => ['no errors'],\n ),\n );\n}\n\n/**\n * Get custom error messages for the errors.\n */\nfunction getCustomErrors<A>(\n validation: t.Validation<A>,\n customErrorFromContext: (validationContext: t.Context) => string,\n): string[] {\n return pipe(\n validation,\n either.fold(\n (errors) => errors.map((error) => customErrorFromContext(error.context)),\n () => ['no errors'],\n ),\n );\n}\n\nexport const CODEC_ERROR_MESSAGE = 'Failed to decode codec:';\n\n/**\n * Decode a codec, returning the decoded value or throwing an error.\n */\nexport function decodeCodec<TCodec extends t.Any>(\n codec: TCodec,\n txt: unknown,\n parse = true,\n customErrorFromContext: ((validationContext: t.Context) => string) | undefined = undefined,\n): t.TypeOf<TCodec> {\n const decoded = codec.decode(parse && typeof txt === 'string' ? JSON.parse(txt) : txt);\n\n if (either.isLeft(decoded)) {\n const errorPaths = getPaths(decoded);\n const customError =\n customErrorFromContext !== undefined\n ? JSON.stringify(getCustomErrors(decoded, customErrorFromContext), null, 2)\n : undefined;\n\n throw new Error(\n `${CODEC_ERROR_MESSAGE} ${JSON.stringify(errorPaths, null, 2)}${customError ?? ''}`,\n );\n }\n\n return decoded.right;\n}\n","import { unsafeCoerce } from 'fp-ts/lib/function.js';\nimport * as t from 'io-ts';\n\n/**\n * A record with optional keys.\n */\nexport interface DictionaryC<D extends t.Mixed, C extends t.Mixed> extends t.DictionaryType<\n D,\n C,\n {\n [K in t.TypeOf<D>]?: t.TypeOf<C>;\n },\n {\n [K in t.OutputOf<D>]?: t.OutputOf<C>;\n },\n unknown\n> {}\n\n/**\n * Helper to encode/decode a record with partial keys.\n */\nexport const dictionary = <D extends t.Mixed, C extends t.Mixed>(\n keys: D,\n values: C,\n name?: string,\n): DictionaryC<D, C> => unsafeCoerce(t.record(t.union([keys, t.undefined]), values, name));\n","import * as t from 'io-ts';\n\n/**\n * Brand for strings of fixed length.\n */\nexport type FixedLengthStringBrand<N extends number> = {\n /** The expected length of the string. */\n readonly length: N;\n /** Unique symbol to ensure uniqueness of this type across modules/packages. */\n readonly FixedLengthString: unique symbol;\n};\n\n/**\n * Codec for strings constrained to a fixed length.\n */\nexport const FixedLengthString = <N extends number>(\n len: N,\n): t.BrandC<t.StringC, FixedLengthStringBrand<N>> =>\n t.brand(\n t.string,\n (value): value is t.Branded<string, FixedLengthStringBrand<N>> => value.length === len,\n 'FixedLengthString',\n );\n\n/**\n * Branded fixed-length string type.\n */\nexport type FixedLengthString<N extends number> = t.TypeOf<\n t.BrandC<t.StringC, FixedLengthStringBrand<N>>\n>;\n","import * as t from 'io-ts';\n\n/**\n * Brand for arrays with bounded length.\n */\nexport interface FixedLengthArrayBrand<T> extends Array<T> {\n /** Unique symbol to ensure uniqueness of this type across modules/packages. */\n readonly fixedLengthArray: unique symbol;\n /** The minimum length of the array. */\n readonly min: number;\n /** The maximum length of the array. */\n readonly max: number;\n}\n\n/**\n * Codec for arrays constrained to a fixed length range.\n */\nexport const FixedLengthArray = <C extends t.Mixed>(\n min: number,\n max: number,\n codec: C,\n): t.BrandC<t.ArrayC<C>, FixedLengthArrayBrand<C>> =>\n t.brand(\n t.array(codec),\n (value: Array<C>): value is t.Branded<Array<C>, FixedLengthArrayBrand<C>> =>\n min <= value.length && value.length <= max,\n 'fixedLengthArray',\n );\n\n/**\n * Branded fixed-length array type.\n */\nexport type FixedLengthArray<C extends t.Mixed> = t.TypeOf<\n t.BrandC<t.ArrayC<C>, FixedLengthArrayBrand<C>>\n>;\n","import * as t from 'io-ts';\n\n/**\n * Like `t.record`, but where the keys are all optional to include.\n */\nexport interface PartialRecordC<D extends t.Mixed, C extends t.Mixed> extends t.DictionaryType<\n D,\n C,\n {\n [K in t.TypeOf<D>]?: t.TypeOf<C>;\n },\n {\n [K in t.OutputOf<D>]?: t.OutputOf<C>;\n },\n unknown\n> {}\n\n/**\n * Create an `io-ts` compatible partial record.\n */\nexport const partialRecord = <D extends t.Mixed, C extends t.Mixed>(\n domain: D,\n codomain: C,\n name?: string,\n): PartialRecordC<D, C> =>\n t.record(t.union([domain, t.undefined]), codomain, name) as unknown as PartialRecordC<D, C>;\n","/**\n * Checks an error message to see if it is an `io-ts` codec error.\n */\nexport function isCodecError(err: Error): boolean {\n return err.message.startsWith('Failed to decode codec');\n}\n","import * as t from 'io-ts';\n\n/**\n * Brand for non-empty strings.\n */\ntype NonEmptyStringBrand = {\n /** Unique symbol to ensure uniqueness of this type across modules/packages. */\n readonly NonEmptyString: symbol;\n};\n\n/**\n * Codec for non-empty trimmed strings.\n */\nexport const NonEmptyString = t.brand(\n t.string,\n (value): value is t.Branded<string, NonEmptyStringBrand> => value.trim().length !== 0,\n 'NonEmptyString',\n);\n\n/**\n * Branded non-empty string type.\n */\nexport type NonEmptyString = t.TypeOf<typeof NonEmptyString>;\n","import * as t from 'io-ts';\nimport type { JSONSchema7 } from 'json-schema';\n\n/**\n * `io-ts` types compatible with JSON Schema.\n */\ntype MappableType =\n | t.NumberType\n | t.StringType\n | t.NullType\n | t.BooleanType\n | t.LiteralType<any>\n | t.KeyofType<any>\n | t.InterfaceType<any>\n | t.DictionaryType<any, any>\n | t.PartialType<any>\n | t.UnionType<any>\n | t.ArrayType<any>\n | t.TupleType<any>\n | t.IntersectionType<any>\n | t.RefinementType<any>;\n\n/**\n * Convert an `io-ts` codec to a JSON Schema (v7).\n */\nexport const toJsonSchema = (\n rawType: any,\n strict = false,\n alwaysIncludeRequired = false,\n): JSONSchema7 => {\n const type = rawType as MappableType;\n\n if (type._tag === 'StringType') {\n return { type: 'string' };\n }\n\n if (type._tag === 'NumberType') {\n return { type: 'number' };\n }\n\n if (type._tag === 'NullType') {\n return { type: 'null' };\n }\n\n if (type._tag === 'BooleanType') {\n return { type: 'boolean' };\n }\n\n if (type._tag === 'LiteralType') {\n return { const: type.value };\n }\n\n if (type._tag === 'KeyofType') {\n return { type: 'string', enum: Object.keys(type.keys) };\n }\n\n if (type._tag === 'UnionType') {\n return {\n anyOf: type.types.map((subtype: any) => toJsonSchema(subtype, strict, alwaysIncludeRequired)),\n };\n }\n\n if (type._tag === 'IntersectionType' && !alwaysIncludeRequired) {\n return {\n allOf: type.types.map((subtype: any) => toJsonSchema(subtype, strict, alwaysIncludeRequired)),\n };\n }\n\n if (type._tag === 'IntersectionType' && alwaysIncludeRequired) {\n const results = type.types.map((subtype: any) =>\n toJsonSchema(subtype, strict, alwaysIncludeRequired),\n );\n\n if (!results.every((result: any) => result.type === 'object')) {\n throw new Error('InterfaceType must have all children as type=object');\n }\n\n return {\n type: 'object',\n required: results.map((result: any) => result.required).flat(),\n properties: results.reduce(\n (accumulator: any, result: any) => ({ ...accumulator, ...result.properties }),\n {},\n ),\n ...(strict ? { additionalProperties: false } : {}),\n };\n }\n\n if (type._tag === 'InterfaceType') {\n return {\n type: 'object',\n required: Object.keys(type.props),\n properties: Object.fromEntries(\n Object.entries(type.props).map(([key, subtype]) => [\n key,\n toJsonSchema(subtype as t.Type<any>, strict, alwaysIncludeRequired),\n ]),\n ),\n ...(strict ? { additionalProperties: false } : {}),\n };\n }\n\n if (type._tag === 'DictionaryType') {\n return {\n type: 'object',\n additionalProperties: toJsonSchema(type.codomain, strict, alwaysIncludeRequired),\n };\n }\n\n if (type._tag === 'PartialType') {\n return {\n type: 'object',\n ...(alwaysIncludeRequired ? { required: Object.keys(type.props) } : {}),\n properties: Object.fromEntries(\n Object.entries(type.props).map(([key, subtype]) => {\n const result = toJsonSchema(subtype as t.Type<any>, strict, alwaysIncludeRequired);\n return [\n key,\n alwaysIncludeRequired && result.type\n ? {\n ...result,\n type: [result.type as any, 'null'],\n }\n : result,\n ];\n }),\n ),\n ...(strict ? { additionalProperties: false } : {}),\n };\n }\n\n if (type._tag === 'ArrayType') {\n return {\n type: 'array',\n items: toJsonSchema(type.type, strict, alwaysIncludeRequired),\n };\n }\n\n if (type._tag === 'TupleType') {\n return {\n type: 'array',\n items: type.types.map((subtype: any) => toJsonSchema(subtype, strict, alwaysIncludeRequired)),\n };\n }\n\n if (type._tag === 'RefinementType') {\n if (type.name === 'Int') {\n return { type: 'integer' };\n }\n\n return {\n ...toJsonSchema(type.type, strict, alwaysIncludeRequired),\n description: `Predicate: ${type.predicate.name || type.name}`,\n };\n }\n\n return unhandledType(type as never);\n};\n\nconst unhandledType = (_shouldBeNever: never) => ({});\n","import * as t from 'io-ts';\n\n/**\n * Creates a default value for an `io-ts` codec.\n */\nexport const createDefaultCodec = <C extends t.Mixed>(codec: C): t.TypeOf<C> => {\n if (codec instanceof t.UnionType) {\n const arrayType = codec.types.find((type: any) => type instanceof t.ArrayType);\n if (arrayType) {\n return createDefaultCodec(arrayType);\n }\n\n const objectType = codec.types.find(\n (type: any) =>\n type instanceof t.InterfaceType ||\n type instanceof t.PartialType ||\n type instanceof t.IntersectionType ||\n type instanceof t.ArrayType,\n );\n if (objectType) {\n return createDefaultCodec(objectType);\n }\n\n const hasNull = codec.types.some(\n (type: any) => type instanceof t.NullType || type.name === 'null',\n );\n if (hasNull) {\n return null as t.TypeOf<C>;\n }\n\n return createDefaultCodec(codec.types[0]);\n }\n\n if (codec instanceof t.InterfaceType || codec instanceof t.PartialType) {\n const defaults: Record<string, any> = {};\n Object.entries(codec.props).forEach(([key, type]) => {\n defaults[key] = createDefaultCodec(type as any);\n });\n return defaults as t.TypeOf<C>;\n }\n\n if (codec instanceof t.IntersectionType) {\n return codec.types.reduce(\n (accumulator: t.TypeOf<C>, type: any) => ({\n ...accumulator,\n ...createDefaultCodec(type),\n }),\n {},\n );\n }\n\n if (codec instanceof t.ArrayType) {\n const elementType = codec.type;\n const isObjectType =\n elementType instanceof t.InterfaceType ||\n elementType instanceof t.PartialType ||\n elementType instanceof t.IntersectionType;\n\n return (isObjectType ? [createDefaultCodec(elementType)] : []) as t.TypeOf<C>;\n }\n\n if (codec instanceof t.LiteralType) {\n return codec.value as t.TypeOf<C>;\n }\n\n if (codec instanceof t.ObjectType) {\n return {} as t.TypeOf<C>;\n }\n\n switch (codec.name) {\n case 'string':\n return '' as t.TypeOf<C>;\n case 'number':\n return 0 as t.TypeOf<C>;\n case 'boolean':\n return false as t.TypeOf<C>;\n case 'null':\n return null as t.TypeOf<C>;\n case 'undefined':\n return undefined as t.TypeOf<C>;\n default:\n return null as t.TypeOf<C>;\n }\n};\n","import { makeEnum } from './enum.js';\n\n/**\n * The HTTP method types.\n */\nexport const HttpMethod = makeEnum({\n /** A GET request. */\n Get: 'GET',\n /** A POST request. */\n Post: 'POST',\n /** A DELETE request. */\n Delete: 'DELETE',\n /** A PUT request. */\n Put: 'PUT',\n /** A PATCH request. */\n Patch: 'PATCH',\n});\n\n/**\n * The HTTP method string union.\n */\nexport type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];\n","import type { ObjByString } from './types.js';\n\n/**\n * `Object.entries` that preserves entry types.\n */\nexport function getEntries<TKey extends keyof TObj, TObj extends ObjByString>(\n obj: TObj,\n): [TKey, TObj[TKey]][] {\n return Object.entries(obj) as any;\n}\n","/**\n * `Object.values` that preserves value types.\n */\nexport function getValues<TValue>(obj: {\n [key in string | number | symbol]: TValue;\n}): TValue[] {\n return Object.values(obj) as TValue[];\n}\n","/**\n * A typed version of lodash's `groupBy`.\n */\nexport function groupBy<TItem, TKey>(\n iterable: TItem[],\n getKey: (item: TItem) => TKey,\n): Map<TKey, TItem[]> {\n return iterable.reduce((groupedItems, item) => {\n const groupedKey = getKey(item);\n return groupedItems.set(groupedKey, [...(groupedItems.get(groupedKey) ?? []), item]);\n }, new Map<TKey, TItem[]>());\n}\n","/**\n * Identify whether a string looks like a GraphQL interface/type/input\n * declaration.\n */\nexport const INTERFACE_REGEX = /(interface|type|input) [a-zA-Z0-9]* (implements .+?|){([\\s\\S]+?)}/;\n\n/**\n * A `gql` is simply a string branded with the associated GraphQL type.\n */\nexport type Gql<TGraphQLType extends object> = string & {\n /** The TypeScript type definition that relates to the gql string. */\n graphQLType: TGraphQLType;\n};\n\n/**\n * Template tag for GraphQL fragments with a small amount of interpolation\n * support for interface bodies.\n */\nexport function gql<TGraphQLType extends object>(\n strings: TemplateStringsArray,\n ...expressions: (string | number)[]\n): Gql<TGraphQLType> {\n if (expressions.length === 0) {\n return strings[0] as Gql<TGraphQLType>;\n }\n\n const count = strings.length - 1;\n let result = '';\n for (let index = 0; index < count; index += 1) {\n const expression = expressions[index]!;\n const text = typeof expression === 'string' ? expression : expression.toString();\n const useExpression = INTERFACE_REGEX.test(text)\n ? (INTERFACE_REGEX.exec(text) || [])[3]\n : expression;\n result += (strings[index] ?? '') + (useExpression ?? '');\n }\n\n result += strings[count] ?? '';\n return result as Gql<TGraphQLType>;\n}\n","import { getEntries } from './getEntries.js';\n\n/**\n * Invert an object so the values look up the keys. Arrays are expanded and map\n * back to arrays of keys.\n */\nexport function invert<TKey extends string, TValue extends string | string[]>(\n obj: { [key in TKey]?: TValue },\n throwOnDuplicate = true,\n): {\n [key in TValue extends (infer Item)[] ? Item : TValue]: TValue extends any[] ? TKey[] : TKey;\n} {\n const result: any = {};\n\n getEntries(obj).forEach(([key, instance]: [TKey, TValue | undefined]) => {\n if (instance === undefined) {\n throw new Error('inverse found undefined value, this is not supported');\n }\n\n if (Array.isArray(instance)) {\n instance.forEach((listKey) => {\n if (!result[listKey]) {\n result[listKey] = [key];\n } else {\n result[listKey].push(key);\n }\n });\n return;\n }\n\n if (result[instance] && throwOnDuplicate) {\n throw new Error(\n `Encountered duplicate value inverting object: \"${instance}: ${key} and ${result[instance]}\"`,\n );\n }\n\n result[instance] = key;\n });\n\n return result;\n}\n\n/**\n * Safely invert an object into `{ [value]: key[] }`.\n */\nexport function invertSafe<TKey extends string, TValue extends string>(obj: {\n [key in TKey]: TValue | TValue[];\n}): {\n [key in TValue]: TKey[];\n} {\n const result: any = {};\n\n getEntries(obj).forEach(([key, instance]) => {\n if (instance === undefined) {\n throw new Error('inverse found undefined value, this is not supported');\n }\n\n if (Array.isArray(instance)) {\n instance.forEach((listKey) => {\n if (!result[listKey]) {\n result[listKey] = [key];\n } else {\n result[listKey].push(key);\n }\n });\n return;\n }\n\n if (!result[instance]) {\n result[instance] = [key];\n return;\n }\n\n result[instance].push(key);\n });\n\n return result;\n}\n","import * as t from 'io-ts';\n\nimport { invert } from './invert.js';\n\n/**\n * Build an `io-ts` codec over the values of an enum-like object.\n */\nexport function valuesOf<TEnum extends string>(enm: {\n [key in string]: TEnum;\n}): t.KeyofC<{ [key in TEnum]: unknown }> {\n return t.keyof(invert(enm) as any);\n}\n","/**\n * The full match returned when `regex.exec` finds a match.\n */\nexport interface RegExpMatch {\n /** The full regex match. */\n fullMatch: string;\n /** The index in the text where the match was found. */\n matchIndex: number;\n /** Whether the match satisfies an optional stricter regex. */\n isStrict?: boolean;\n}\n\n/**\n * Definition for finding all regex matches and mapping capture groups to keys.\n */\nexport interface FindAllRegExp<TMatchKeys extends string> {\n /** The regex to test. */\n value: RegExp;\n /**\n * A stricter regex used to annotate matches that satisfy a more exact\n * standard.\n */\n strict?: RegExp;\n /** Capture group names mapped by index. */\n matches: readonly TMatchKeys[];\n /** When true, skip validation of matches being the expected length. */\n skipMatchValidation?: boolean;\n}\n\n/**\n * Use a regex with the global flag to find all matches and return the list with\n * capture groups mapped to named properties.\n */\nexport function findAllWithRegex<TMatchKeys extends string>(\n regex: FindAllRegExp<TMatchKeys>,\n text: string,\n): ({ [key in TMatchKeys]: string } & RegExpMatch)[] {\n if (!regex.value.flags.includes('g')) {\n throw new Error('Regex.value must have a g flag');\n }\n\n const matchParams = ['fullMatch', ...regex.matches];\n const results: ({ [key in TMatchKeys]: string } & RegExpMatch)[] = [];\n\n let match = regex.value.exec(text);\n let index = 0;\n\n while (match) {\n if (matchParams.length !== match.length && !regex.skipMatchValidation) {\n throw new Error(\n `Mismatch in match length at index [${index}]: \"${match.length}\" vs expected: \"${matchParams.length}\"`,\n );\n }\n\n const result = match.reduce(\n (accumulator, matchResult, matchIndex) =>\n Object.assign(accumulator, {\n [matchParams[matchIndex] as string]: matchResult,\n }),\n {},\n ) as { [key in TMatchKeys]: string } & RegExpMatch;\n\n result.matchIndex = match.index;\n\n if (regex.strict) {\n result.isStrict = regex.strict.test(result.fullMatch);\n }\n\n results.push(result);\n\n match = regex.value.exec(text);\n index += 1;\n }\n\n return results;\n}\n","/**\n * Aggregates multiple objects into a single object by combining values of\n * matching keys into comma-separated strings.\n */\nexport const aggregateObjects = ({\n objs,\n wrap = false,\n}: {\n /** The objects to aggregate in a single one. */\n objs: any[];\n /** Whether to wrap the concatenated values in `[]`. */\n wrap?: boolean;\n}): any => {\n const allKeys = Array.from(\n new Set(objs.flatMap((obj) => (obj && typeof obj === 'object' ? Object.keys(obj) : []))),\n );\n\n return allKeys.reduce(\n (accumulator, key) => {\n const values = objs\n .map((obj) => (wrap ? `[${obj?.[key] ?? ''}]` : (obj?.[key] ?? '')))\n .join(',');\n accumulator[key] = values;\n return accumulator;\n },\n {} as Record<string, any>,\n );\n};\n","import { aggregateObjects } from './aggregateObjects.js';\n\n/**\n * Flattens a nested object into a single-level object with concatenated key\n * names.\n */\nexport const flattenObject = ({\n obj,\n prefix = '',\n}: {\n /** The object to flatten. */\n obj: any;\n /** The prefix to prepend to keys while recursing. */\n prefix?: string;\n}): any =>\n !obj\n ? {}\n : Object.keys(obj ?? []).reduce(\n (accumulator, key) => {\n const newKey = prefix ? `${prefix}_${key}` : key;\n const entry = obj[key];\n\n if (\n Array.isArray(entry) &&\n entry.length > 0 &&\n entry.some((item) => typeof item === 'object' && item !== null)\n ) {\n const objectEntries = entry.filter((item) => typeof item === 'object' && item !== null);\n const flattenedObjects = objectEntries.map((item) => flattenObject({ obj: item }));\n const aggregated = aggregateObjects({ objs: flattenedObjects });\n Object.entries(aggregated).forEach(([aggregatedKey, value]) => {\n accumulator[`${newKey}_${aggregatedKey}`] = value;\n });\n } else if (typeof entry === 'object' && entry !== null && !Array.isArray(entry)) {\n Object.assign(accumulator, flattenObject({ obj: entry, prefix: newKey }));\n } else {\n accumulator[newKey] = Array.isArray(entry)\n ? entry\n .map((item) => {\n if (typeof item === 'string') {\n return item.replaceAll(',', '');\n }\n\n return item ?? '';\n })\n .join(',')\n : typeof entry === 'string'\n ? entry.replaceAll(',', '')\n : (entry ?? '');\n }\n\n return accumulator;\n },\n {} as Record<string, any>,\n );\n","/**\n * Type representing a transposed array of objects.\n */\ntype TransposedObjectArray<T, K extends keyof T> = {\n [P in K]: Array<T[P]>;\n} & {\n /** Properties not selected for transposition. */\n rest: Array<Omit<T, K>>;\n};\n\n/**\n * Transpose an array of objects by converting selected properties into arrays\n * while keeping the remaining properties grouped in `rest`.\n */\nexport const transposeObjectArray = <T extends object, K extends keyof T>({\n objects,\n properties,\n options = { includeOtherProperties: true },\n}: {\n /** Array of objects to transpose. */\n objects: T[];\n /** Property keys to transpose into arrays. */\n properties: K[];\n /** Options for how to transpose the array. */\n options?: {\n /** Whether to include non-transposed properties in the final result. */\n includeOtherProperties?: boolean;\n };\n}): TransposedObjectArray<T, K> =>\n objects.reduce(\n (accumulator, item) => {\n const result = { ...accumulator } as TransposedObjectArray<T, K>;\n\n properties.forEach((property) => {\n const currentArray = (accumulator[property] || []) as T[K][];\n result[property] = [...currentArray, item[property]] as any;\n });\n\n const restObject = {} as Omit<T, K>;\n Object.entries(item).forEach(([key, value]) => {\n if (!properties.includes(key as K)) {\n (restObject as any)[key] = value;\n }\n });\n\n if (options.includeOtherProperties) {\n result.rest = [...(accumulator.rest || []), restObject];\n }\n\n return result;\n },\n {} as TransposedObjectArray<T, K>,\n );\n","/**\n * `Object.fromEntries` that preserves entry types.\n */\nexport function fromEntries<const TEntries extends ReadonlyArray<readonly [PropertyKey, unknown]>>(\n entries: TEntries,\n): { [K in TEntries[number] as K[0]]: K[1] } {\n return Object.fromEntries(entries) as { [K in TEntries[number] as K[0]]: K[1] };\n}\n","import type { Either, Right } from 'fp-ts/lib/Either.js';\nimport * as either from 'fp-ts/lib/Either.js';\nimport { pipe } from 'fp-ts/lib/function.js';\nimport * as t from 'io-ts';\n\n/**\n * Creates a type guard function that checks if a codec matches a specific tag.\n */\nconst getIsCodec =\n <T extends t.Any>(tag: string) =>\n (codec: t.Any): codec is T =>\n (codec as any)._tag === tag;\n\nconst isInterfaceCodec = getIsCodec<t.InterfaceType<t.Props>>('InterfaceType');\nconst isPartialCodec = getIsCodec<t.PartialType<t.Props>>('PartialType');\n\n/**\n * Extract property definitions from various codec types.\n */\nconst getProps = (codec: t.HasProps): t.Props => {\n switch (codec._tag) {\n case 'RefinementType':\n case 'ReadonlyType':\n return getProps(codec.type);\n case 'InterfaceType':\n case 'StrictType':\n case 'PartialType':\n return codec.props;\n case 'IntersectionType':\n return codec.types.reduce<t.Props>((props, type) => Object.assign(props, getProps(type)), {});\n default:\n return {};\n }\n};\n\n/**\n * Generate a string representation of props for type naming.\n */\nconst getNameFromProps = (props: t.Props): string =>\n Object.keys(props)\n .map((key) => `${key}: ${props[key]!.name}`)\n .join(', ');\n\n/**\n * Wrap a type name with `Partial<>`.\n */\nconst getPartialTypeName = (inner: string): string => `Partial<${inner}>`;\n\n/**\n * Generate a human-readable type name for the no-excess wrapper.\n */\nconst getNoExcessTypeName = (codec: t.Any): string => {\n if (isInterfaceCodec(codec)) {\n return `{| ${getNameFromProps(codec.props)} |}`;\n }\n\n if (isPartialCodec(codec)) {\n return getPartialTypeName(`{| ${getNameFromProps(codec.props)} |}`);\n }\n\n return `Excess<${codec.name}>`;\n};\n\n/**\n * Compare an object's keys against expected properties and return either the\n * object or a list of excess keys.\n */\nconst stripKeys = <T = any>(obj: T, props: t.Props): Either<string[], T> => {\n const keys = Object.getOwnPropertyNames(obj);\n const propKeys = Object.getOwnPropertyNames(props);\n\n propKeys.forEach((propKey) => {\n const index = keys.indexOf(propKey);\n if (index !== -1) {\n keys.splice(index, 1);\n }\n });\n\n return keys.length ? either.left(keys) : either.right(obj);\n};\n\n/**\n * Wrap an `io-ts` codec so validation fails when excess properties are present.\n */\nexport const noExcess = <C extends t.HasProps>(\n codec: C,\n name: string = getNoExcessTypeName(codec),\n): NoExcessType<C> => {\n const props: t.Props = getProps(codec);\n\n return new NoExcessType<C>(\n name,\n (value): value is C => either.isRight(stripKeys(value, props)) && codec.is(value),\n (value, context) => {\n const unknownRecordValidation = t.UnknownRecord.validate(value, context);\n if (either.isLeft(unknownRecordValidation)) {\n return unknownRecordValidation;\n }\n\n const codecValidation = codec.validate(value, context);\n if (either.isLeft(codecValidation)) {\n return codecValidation;\n }\n\n return pipe(\n stripKeys<C>(codecValidation.right, props),\n either.mapLeft((keys) =>\n keys.map((key) => ({\n value: codecValidation.right[key],\n context,\n message: `excess key \"${key}\" found`,\n })),\n ),\n );\n },\n (value) => codec.encode((stripKeys(value, props) as Right<any>).right),\n codec,\n );\n};\n\n/**\n * A wrapper type used with `io-ts` to ensure there are not any excess keys.\n */\nexport class NoExcessType<C extends t.Any, A = C['_A'], O = A, I = unknown> extends t.Type<\n A,\n O,\n I\n> {\n public readonly _tag = 'NoExcessType' as const;\n\n public constructor(\n name: string,\n is: NoExcessType<C, A, O, I>['is'],\n validate: NoExcessType<C, A, O, I>['validate'],\n encode: NoExcessType<C, A, O, I>['encode'],\n public readonly type: C,\n ) {\n super(name, is, validate, encode);\n }\n}\n"],"mappings":";;;;;;;AAuBA,SAAgB,WAAW,YAAyC;AAElE,QAAO,WAAW,QAAQ,aAAa,UAAU;AAC/C,cAAY,SAAS;AACrB,SAAO;IAH+B,EAAE,CAI1B;;;;;AAMlB,SAAgB,WACd,GAAG,YACiB;CACpB,MAAM,mBAAmB,WAAW,KAAK,cACvC,MAAM,QAAQ,UAAU,GAAG,WAAW,UAAU,GAAG,UACpD;AAED,QAAO,OAAO,OAAO,EAAE,EAAE,GAAG,iBAAiB;;;;;AAM/C,SAAgB,WACd,KACA,YACa;AACb,QAAQ,OAAO,KAAK,IAAI,CACrB,QAAQ,QAAQ,WAAW,IAAI,MAAM,KAAK,IAAI,CAAC,CAC/C,KAAK,QAAQ,IAAI;;;;;;AAOtB,SAAgB,SACd,OACG;AACH,QAAO;;;;;;;AC1DT,SAAgB,cAA4B,KAAyB;AACnE,QAAO,OAAO,KAAK,IAAI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aAAsB,KAAQ,UAAwC;CAC1E,MAAM,OAAO,OAAO,oBAAoB,IAAI;AAC3B,QAAO,oBAAoB,MAAM,CAEzC,SAAS,YAAY;EAC5B,MAAM,QAAQ,KAAK,QAAQ,QAAQ;AACnC,MAAI,UAAU,GACZ,MAAK,OAAO,OAAO,EAAE;GAEvB;AAEF,QAAO,KAAK,SAAS,OAAO,KAAK,KAAK,GAAG,OAAO,MAAM,IAAI;;;;;AAM5D,MAAa,YACX,OACA,OAAe,oBAAoB,MAAM,KACrB;CACpB,MAAM,QAAiB,SAAS,MAAM;AAEtC,QAAO,IAAI,aACT,OACC,UAAsB,OAAO,QAAQ,UAAU,OAAO,MAAM,CAAC,IAAI,MAAM,GAAG,MAAM,GAChF,OAAO,YAAY;EAClB,MAAM,0BAA0B,EAAE,cAAc,SAAS,OAAO,QAAQ;AACxE,MAAI,OAAO,OAAO,wBAAwB,CACxC,QAAO;EAGT,MAAM,kBAAkB,MAAM,SAAS,OAAO,QAAQ;AACtD,MAAI,OAAO,OAAO,gBAAgB,CAChC,QAAO;AAGT,SAAO,KACL,UAAa,gBAAgB,OAAO,MAAM,EAC1C,OAAO,SAAS,SACd,KAAK,KAAK,SAAS;GACjB,OAAO,gBAAgB,MAAM;GAC7B;GACA,SAAS,eAAe,IAAI;GAC7B,EAAE,CACJ,CACF;KAEF,UAAU,MAAM,OAAQ,UAAU,OAAO,MAAM,CAAgB,MAAM,EACtE,MACD;;;;;AAMH,IAAa,eAAb,cAAoF,EAAE,KAIpF;CACA,OAAuB;CAEvB,YACE,MACA,IACA,UACA,QACA,MACA;AACA,QAAM,MAAM,IAAI,UAAU,OAAO;AAFjB,OAAA,OAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/enum.ts","../src/getKeys.ts","../src/apply.ts","../src/codecTools/decodeCodec.ts","../src/codecTools/dictionary.ts","../src/codecTools/FixedLengthString.ts","../src/codecTools/FixedLengthArray.ts","../src/codecTools/partialRecord.ts","../src/codecTools/isCodecError.ts","../src/codecTools/NonEmptyString.ts","../src/codecTools/toJsonSchema.ts","../src/codecTools/createDefaultCodec.ts","../src/enums.ts","../src/getEntries.ts","../src/getValues.ts","../src/groupBy.ts","../src/gql.ts","../src/invert.ts","../src/valuesOf.ts","../src/findAllWithRegex.ts","../src/aggregateObjects.ts","../src/flattenObject.ts","../src/transposeObjectArray.ts","../src/fromEntries.ts","../src/noExcess.ts"],"sourcesContent":["import type { ObjByString } from './types.js';\n\n// TODO: https://linear.app/transcend/issue/LAK-2351 – Remove deprecated enum utils\n\n/**\n * An enumerated value.\n * @deprecated - Enum utils are deprecated\n */\nexport type Enumerate<T = string, TKey extends string = string> = {\n [key in TKey]: T;\n};\n\n/**\n * A TypeScript enum with string values.\n * @deprecated - Enum utils are deprecated\n */\nexport type TypescriptEnum = { [key in string]: string } | { [key in number]: string };\n\n/**\n * An input when defining an enum can be an object of string -> string or a list\n * of strings.\n * @deprecated - Enum utils are deprecated\n */\nexport type EnumInput<T, TKey extends string = string> = Enumerate<T, TKey> | string[];\n\n/**\n * Convert a list of strings to an enum-like object.\n * @deprecated - Enum utils are deprecated\n */\nexport function listToEnum(attributes: string[]): Enumerate<string> {\n const initialValue: Enumerate<string> = {};\n return attributes.reduce((accumulator, value) => {\n accumulator[value] = value;\n return accumulator;\n }, initialValue);\n}\n\n/**\n * Merge enum-like inputs into a single enum object.\n * @deprecated - Enum utils are deprecated\n */\nexport function createEnum<T = string, TKey extends string = string>(\n ...attributes: EnumInput<T, TKey>[]\n): Enumerate<T, TKey> {\n const objectAttributes = attributes.map((attribute) =>\n Array.isArray(attribute) ? listToEnum(attribute) : attribute,\n );\n\n return Object.assign({}, ...objectAttributes);\n}\n\n/**\n * Filter an enum and return the keys that remain.\n * @deprecated - Enum utils are deprecated\n */\nexport function filterEnum<T extends ObjByString>(\n obj: T,\n filterFunc: (value: T[keyof T], key: keyof T, calculatedEnum: Enumerate<T[keyof T]>) => boolean,\n): (keyof T)[] {\n return (Object.keys(obj) as (keyof T)[])\n .filter((key) => filterFunc(obj[key], key, obj))\n .map((key) => key);\n}\n\n/**\n * Make an enum compatible with type inference without changing its runtime\n * shape.\n * @deprecated – Enum utils are deprecated\n */\nexport function makeEnum<T extends { [index: string]: Value | Value[] }, Value extends string>(\n value: T,\n): T {\n return value;\n}\n","import type { StringKeys } from './types.js';\n\n/**\n * `Object.keys` for string keys only.\n */\nexport function getStringKeys<T extends {}>(obj: T): StringKeys<T>[] {\n return Object.keys(obj).filter((key) => typeof key === 'string') as StringKeys<T>[];\n}\n\n/**\n * `Object.keys` that preserves key types.\n */\nexport function getKeys<T extends {}>(obj: T): (keyof T)[] {\n return Object.keys(obj) as (keyof T)[];\n}\n","import { createEnum } from './enum.js';\nimport { getKeys } from './getKeys.js';\nimport type { ObjByString, StringKeys } from './types.js';\n\n/**\n * Apply a function to each value of an object while preserving the key types.\n */\nexport function apply<TInput extends ObjByString, TOutput>(\n obj: TInput,\n applyFunc: (\n value: TInput[keyof TInput],\n key: StringKeys<TInput>,\n fullObj: typeof obj,\n index: number,\n ) => TOutput,\n): { [key in keyof TInput]: TOutput } {\n const result = Object.keys(obj).reduce(\n (accumulator, key, index) =>\n Object.assign(accumulator, {\n [key]: applyFunc(obj[key], key as StringKeys<TInput>, obj, index),\n }),\n {},\n );\n\n return result as { [key in keyof TInput]: TOutput };\n}\n\n/**\n * Async version of `apply`.\n */\nexport async function asyncApply<TInput extends ObjByString, TOutput>(\n obj: TInput,\n applyFunc: (\n value: TInput[keyof TInput],\n key: StringKeys<TInput>,\n fullObj: typeof obj,\n index: number,\n ) => Promise<TOutput>,\n): Promise<{ [key in keyof TInput]: TOutput }> {\n const entries = await Promise.all(\n getKeys(obj).map(async (key, index) => ({\n key,\n value: await applyFunc(obj[key], key as StringKeys<TInput>, obj, index),\n })),\n );\n\n const result = entries.reduce(\n (accumulator, { key, value }) =>\n Object.assign(accumulator, {\n [key]: value,\n }),\n {},\n );\n\n return result as { [key in keyof TInput]: TOutput };\n}\n\n/**\n * Convert a TypeScript enum to a value-to-value map and then call `apply`.\n */\nexport function applyEnum<TEnum extends string, TOutput>(\n enm: { [key in string]: TEnum },\n applyFunc: (value: TEnum, key: TEnum, fullObj: typeof enm, index: number) => TOutput,\n): { [key in TEnum]: TOutput } {\n const obj = createEnum<TEnum, TEnum>(Object.values(enm));\n return apply(obj, applyFunc) as any;\n}\n","import * as either from 'fp-ts/lib/Either.js';\nimport { pipe } from 'fp-ts/lib/function.js';\nimport * as t from 'io-ts';\n\n/**\n * Determine the codec paths that are invalid.\n */\nfunction getPaths<A>(validation: t.Validation<A>): string[] {\n return pipe(\n validation,\n either.fold(\n (errors) =>\n errors.map((error) => {\n const lastContext = error.context.at(-1);\n const fullPath = error.context.map(({ key }) => key).join('.');\n return `${fullPath} expected type '${lastContext?.type.name}'`;\n }),\n () => ['no errors'],\n ),\n );\n}\n\n/**\n * Get custom error messages for the errors.\n */\nfunction getCustomErrors<A>(\n validation: t.Validation<A>,\n customErrorFromContext: (validationContext: t.Context) => string,\n): string[] {\n return pipe(\n validation,\n either.fold(\n (errors) => errors.map((error) => customErrorFromContext(error.context)),\n () => ['no errors'],\n ),\n );\n}\n\nexport const CODEC_ERROR_MESSAGE = 'Failed to decode codec:';\n\n/**\n * Decode a codec, returning the decoded value or throwing an error.\n */\nexport function decodeCodec<TCodec extends t.Any>(\n codec: TCodec,\n txt: unknown,\n parse = true,\n customErrorFromContext: ((validationContext: t.Context) => string) | undefined = undefined,\n): t.TypeOf<TCodec> {\n const decoded = codec.decode(parse && typeof txt === 'string' ? JSON.parse(txt) : txt);\n\n if (either.isLeft(decoded)) {\n const errorPaths = getPaths(decoded);\n const customError =\n customErrorFromContext !== undefined\n ? JSON.stringify(getCustomErrors(decoded, customErrorFromContext), null, 2)\n : undefined;\n\n throw new Error(\n `${CODEC_ERROR_MESSAGE} ${JSON.stringify(errorPaths, null, 2)}${customError ?? ''}`,\n );\n }\n\n return decoded.right;\n}\n","import { unsafeCoerce } from 'fp-ts/lib/function.js';\nimport * as t from 'io-ts';\n\n/**\n * A record with optional keys.\n */\nexport interface DictionaryC<D extends t.Mixed, C extends t.Mixed> extends t.DictionaryType<\n D,\n C,\n {\n [K in t.TypeOf<D>]?: t.TypeOf<C>;\n },\n {\n [K in t.OutputOf<D>]?: t.OutputOf<C>;\n },\n unknown\n> {}\n\n/**\n * Helper to encode/decode a record with partial keys.\n */\nexport const dictionary = <D extends t.Mixed, C extends t.Mixed>(\n keys: D,\n values: C,\n name?: string,\n): DictionaryC<D, C> => unsafeCoerce(t.record(t.union([keys, t.undefined]), values, name));\n","import * as t from 'io-ts';\n\n/**\n * Brand for strings of fixed length.\n */\nexport type FixedLengthStringBrand<N extends number> = {\n /** The expected length of the string. */\n readonly length: N;\n /** Unique symbol to ensure uniqueness of this type across modules/packages. */\n readonly FixedLengthString: unique symbol;\n};\n\n/**\n * Codec for strings constrained to a fixed length.\n */\nexport const FixedLengthString = <N extends number>(\n len: N,\n): t.BrandC<t.StringC, FixedLengthStringBrand<N>> =>\n t.brand(\n t.string,\n (value): value is t.Branded<string, FixedLengthStringBrand<N>> => value.length === len,\n 'FixedLengthString',\n );\n\n/**\n * Branded fixed-length string type.\n */\nexport type FixedLengthString<N extends number> = t.TypeOf<\n t.BrandC<t.StringC, FixedLengthStringBrand<N>>\n>;\n","import * as t from 'io-ts';\n\n/**\n * Brand for arrays with bounded length.\n */\nexport interface FixedLengthArrayBrand<T> extends Array<T> {\n /** Unique symbol to ensure uniqueness of this type across modules/packages. */\n readonly fixedLengthArray: unique symbol;\n /** The minimum length of the array. */\n readonly min: number;\n /** The maximum length of the array. */\n readonly max: number;\n}\n\n/**\n * Codec for arrays constrained to a fixed length range.\n */\nexport const FixedLengthArray = <C extends t.Mixed>(\n min: number,\n max: number,\n codec: C,\n): t.BrandC<t.ArrayC<C>, FixedLengthArrayBrand<C>> =>\n t.brand(\n t.array(codec),\n (value: Array<C>): value is t.Branded<Array<C>, FixedLengthArrayBrand<C>> =>\n min <= value.length && value.length <= max,\n 'fixedLengthArray',\n );\n\n/**\n * Branded fixed-length array type.\n */\nexport type FixedLengthArray<C extends t.Mixed> = t.TypeOf<\n t.BrandC<t.ArrayC<C>, FixedLengthArrayBrand<C>>\n>;\n","import * as t from 'io-ts';\n\n/**\n * Like `t.record`, but where the keys are all optional to include.\n */\nexport interface PartialRecordC<D extends t.Mixed, C extends t.Mixed> extends t.DictionaryType<\n D,\n C,\n {\n [K in t.TypeOf<D>]?: t.TypeOf<C>;\n },\n {\n [K in t.OutputOf<D>]?: t.OutputOf<C>;\n },\n unknown\n> {}\n\n/**\n * Create an `io-ts` compatible partial record.\n */\nexport const partialRecord = <D extends t.Mixed, C extends t.Mixed>(\n domain: D,\n codomain: C,\n name?: string,\n): PartialRecordC<D, C> =>\n t.record(t.union([domain, t.undefined]), codomain, name) as unknown as PartialRecordC<D, C>;\n","/**\n * Checks an error message to see if it is an `io-ts` codec error.\n */\nexport function isCodecError(err: Error): boolean {\n return err.message.startsWith('Failed to decode codec');\n}\n","import * as t from 'io-ts';\n\n/**\n * Brand for non-empty strings.\n */\ntype NonEmptyStringBrand = {\n /** Unique symbol to ensure uniqueness of this type across modules/packages. */\n readonly NonEmptyString: symbol;\n};\n\n/**\n * Codec for non-empty trimmed strings.\n */\nexport const NonEmptyString = t.brand(\n t.string,\n (value): value is t.Branded<string, NonEmptyStringBrand> => value.trim().length !== 0,\n 'NonEmptyString',\n);\n\n/**\n * Branded non-empty string type.\n */\nexport type NonEmptyString = t.TypeOf<typeof NonEmptyString>;\n","import * as t from 'io-ts';\nimport type { JSONSchema7 } from 'json-schema';\n\n/**\n * `io-ts` types compatible with JSON Schema.\n */\ntype MappableType =\n | t.NumberType\n | t.StringType\n | t.NullType\n | t.BooleanType\n | t.LiteralType<any>\n | t.KeyofType<any>\n | t.InterfaceType<any>\n | t.DictionaryType<any, any>\n | t.PartialType<any>\n | t.UnionType<any>\n | t.ArrayType<any>\n | t.TupleType<any>\n | t.IntersectionType<any>\n | t.RefinementType<any>;\n\n/**\n * Convert an `io-ts` codec to a JSON Schema (v7).\n */\nexport const toJsonSchema = (\n rawType: any,\n strict = false,\n alwaysIncludeRequired = false,\n): JSONSchema7 => {\n const type = rawType as MappableType;\n\n if (type._tag === 'StringType') {\n return { type: 'string' };\n }\n\n if (type._tag === 'NumberType') {\n return { type: 'number' };\n }\n\n if (type._tag === 'NullType') {\n return { type: 'null' };\n }\n\n if (type._tag === 'BooleanType') {\n return { type: 'boolean' };\n }\n\n if (type._tag === 'LiteralType') {\n return { const: type.value };\n }\n\n if (type._tag === 'KeyofType') {\n return { type: 'string', enum: Object.keys(type.keys) };\n }\n\n if (type._tag === 'UnionType') {\n return {\n anyOf: type.types.map((subtype: any) => toJsonSchema(subtype, strict, alwaysIncludeRequired)),\n };\n }\n\n if (type._tag === 'IntersectionType' && !alwaysIncludeRequired) {\n return {\n allOf: type.types.map((subtype: any) => toJsonSchema(subtype, strict, alwaysIncludeRequired)),\n };\n }\n\n if (type._tag === 'IntersectionType' && alwaysIncludeRequired) {\n const results = type.types.map((subtype: any) =>\n toJsonSchema(subtype, strict, alwaysIncludeRequired),\n );\n\n if (!results.every((result: any) => result.type === 'object')) {\n throw new Error('InterfaceType must have all children as type=object');\n }\n\n return {\n type: 'object',\n required: results.map((result: any) => result.required).flat(),\n properties: results.reduce(\n (accumulator: any, result: any) => ({ ...accumulator, ...result.properties }),\n {},\n ),\n ...(strict ? { additionalProperties: false } : {}),\n };\n }\n\n if (type._tag === 'InterfaceType') {\n return {\n type: 'object',\n required: Object.keys(type.props),\n properties: Object.fromEntries(\n Object.entries(type.props).map(([key, subtype]) => [\n key,\n toJsonSchema(subtype as t.Type<any>, strict, alwaysIncludeRequired),\n ]),\n ),\n ...(strict ? { additionalProperties: false } : {}),\n };\n }\n\n if (type._tag === 'DictionaryType') {\n return {\n type: 'object',\n additionalProperties: toJsonSchema(type.codomain, strict, alwaysIncludeRequired),\n };\n }\n\n if (type._tag === 'PartialType') {\n return {\n type: 'object',\n ...(alwaysIncludeRequired ? { required: Object.keys(type.props) } : {}),\n properties: Object.fromEntries(\n Object.entries(type.props).map(([key, subtype]) => {\n const result = toJsonSchema(subtype as t.Type<any>, strict, alwaysIncludeRequired);\n return [\n key,\n alwaysIncludeRequired && result.type\n ? {\n ...result,\n type: [result.type as any, 'null'],\n }\n : result,\n ];\n }),\n ),\n ...(strict ? { additionalProperties: false } : {}),\n };\n }\n\n if (type._tag === 'ArrayType') {\n return {\n type: 'array',\n items: toJsonSchema(type.type, strict, alwaysIncludeRequired),\n };\n }\n\n if (type._tag === 'TupleType') {\n return {\n type: 'array',\n items: type.types.map((subtype: any) => toJsonSchema(subtype, strict, alwaysIncludeRequired)),\n };\n }\n\n if (type._tag === 'RefinementType') {\n if (type.name === 'Int') {\n return { type: 'integer' };\n }\n\n return {\n ...toJsonSchema(type.type, strict, alwaysIncludeRequired),\n description: `Predicate: ${type.predicate.name || type.name}`,\n };\n }\n\n return unhandledType(type as never);\n};\n\nconst unhandledType = (_shouldBeNever: never) => ({});\n","import * as t from 'io-ts';\n\n/**\n * Creates a default value for an `io-ts` codec.\n */\nexport const createDefaultCodec = <C extends t.Mixed>(codec: C): t.TypeOf<C> => {\n if (codec instanceof t.UnionType) {\n const arrayType = codec.types.find((type: any) => type instanceof t.ArrayType);\n if (arrayType) {\n return createDefaultCodec(arrayType);\n }\n\n const objectType = codec.types.find(\n (type: any) =>\n type instanceof t.InterfaceType ||\n type instanceof t.PartialType ||\n type instanceof t.IntersectionType ||\n type instanceof t.ArrayType,\n );\n if (objectType) {\n return createDefaultCodec(objectType);\n }\n\n const hasNull = codec.types.some(\n (type: any) => type instanceof t.NullType || type.name === 'null',\n );\n if (hasNull) {\n return null as t.TypeOf<C>;\n }\n\n return createDefaultCodec(codec.types[0]);\n }\n\n if (codec instanceof t.InterfaceType || codec instanceof t.PartialType) {\n const defaults: Record<string, any> = {};\n Object.entries(codec.props).forEach(([key, type]) => {\n defaults[key] = createDefaultCodec(type as any);\n });\n return defaults as t.TypeOf<C>;\n }\n\n if (codec instanceof t.IntersectionType) {\n return codec.types.reduce(\n (accumulator: t.TypeOf<C>, type: any) => ({\n ...accumulator,\n ...createDefaultCodec(type),\n }),\n {},\n );\n }\n\n if (codec instanceof t.ArrayType) {\n const elementType = codec.type;\n const isObjectType =\n elementType instanceof t.InterfaceType ||\n elementType instanceof t.PartialType ||\n elementType instanceof t.IntersectionType;\n\n return (isObjectType ? [createDefaultCodec(elementType)] : []) as t.TypeOf<C>;\n }\n\n if (codec instanceof t.LiteralType) {\n return codec.value as t.TypeOf<C>;\n }\n\n if (codec instanceof t.ObjectType) {\n return {} as t.TypeOf<C>;\n }\n\n switch (codec.name) {\n case 'string':\n return '' as t.TypeOf<C>;\n case 'number':\n return 0 as t.TypeOf<C>;\n case 'boolean':\n return false as t.TypeOf<C>;\n case 'null':\n return null as t.TypeOf<C>;\n case 'undefined':\n return undefined as t.TypeOf<C>;\n default:\n return null as t.TypeOf<C>;\n }\n};\n","import { makeEnum } from './enum.js';\n\n/**\n * The HTTP method types.\n */\nexport const HttpMethod = {\n /** A GET request. */\n Get: 'GET',\n /** A POST request. */\n Post: 'POST',\n /** A DELETE request. */\n Delete: 'DELETE',\n /** A PUT request. */\n Put: 'PUT',\n /** A PATCH request. */\n Patch: 'PATCH',\n} as const;\n\n/**\n * The HTTP method string union.\n */\nexport type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];\n","import type { ObjByString } from './types.js';\n\n/**\n * `Object.entries` that preserves entry types.\n */\nexport function getEntries<TKey extends keyof TObj, TObj extends ObjByString>(\n obj: TObj,\n): [TKey, TObj[TKey]][] {\n return Object.entries(obj) as any;\n}\n","/**\n * `Object.values` that preserves value types.\n */\nexport function getValues<TValue>(obj: {\n [key in string | number | symbol]: TValue;\n}): TValue[] {\n return Object.values(obj) as TValue[];\n}\n","/**\n * A typed version of lodash's `groupBy`.\n */\nexport function groupBy<TItem, TKey>(\n iterable: TItem[],\n getKey: (item: TItem) => TKey,\n): Map<TKey, TItem[]> {\n return iterable.reduce((groupedItems, item) => {\n const groupedKey = getKey(item);\n return groupedItems.set(groupedKey, [...(groupedItems.get(groupedKey) ?? []), item]);\n }, new Map<TKey, TItem[]>());\n}\n","/**\n * Identify whether a string looks like a GraphQL interface/type/input\n * declaration.\n */\nexport const INTERFACE_REGEX = /(interface|type|input) [a-zA-Z0-9]* (implements .+?|){([\\s\\S]+?)}/;\n\n/**\n * A `gql` is simply a string branded with the associated GraphQL type.\n */\nexport type Gql<TGraphQLType extends object> = string & {\n /** The TypeScript type definition that relates to the gql string. */\n graphQLType: TGraphQLType;\n};\n\n/**\n * Template tag for GraphQL fragments with a small amount of interpolation\n * support for interface bodies.\n */\nexport function gql<TGraphQLType extends object>(\n strings: TemplateStringsArray,\n ...expressions: (string | number)[]\n): Gql<TGraphQLType> {\n if (expressions.length === 0) {\n return strings[0] as Gql<TGraphQLType>;\n }\n\n const count = strings.length - 1;\n let result = '';\n for (let index = 0; index < count; index += 1) {\n const expression = expressions[index]!;\n const text = typeof expression === 'string' ? expression : expression.toString();\n const useExpression = INTERFACE_REGEX.test(text)\n ? (INTERFACE_REGEX.exec(text) || [])[3]\n : expression;\n result += (strings[index] ?? '') + (useExpression ?? '');\n }\n\n result += strings[count] ?? '';\n return result as Gql<TGraphQLType>;\n}\n","import { getEntries } from './getEntries.js';\n\n/**\n * Invert an object so the values look up the keys. Arrays are expanded and map\n * back to arrays of keys.\n */\nexport function invert<TKey extends string, TValue extends string | string[]>(\n obj: { [key in TKey]?: TValue },\n throwOnDuplicate = true,\n): {\n [key in TValue extends (infer Item)[] ? Item : TValue]: TValue extends any[] ? TKey[] : TKey;\n} {\n const result: any = {};\n\n getEntries(obj).forEach(([key, instance]: [TKey, TValue | undefined]) => {\n if (instance === undefined) {\n throw new Error('inverse found undefined value, this is not supported');\n }\n\n if (Array.isArray(instance)) {\n instance.forEach((listKey) => {\n if (!result[listKey]) {\n result[listKey] = [key];\n } else {\n result[listKey].push(key);\n }\n });\n return;\n }\n\n if (result[instance] && throwOnDuplicate) {\n throw new Error(\n `Encountered duplicate value inverting object: \"${instance}: ${key} and ${result[instance]}\"`,\n );\n }\n\n result[instance] = key;\n });\n\n return result;\n}\n\n/**\n * Safely invert an object into `{ [value]: key[] }`.\n */\nexport function invertSafe<TKey extends string, TValue extends string>(obj: {\n [key in TKey]: TValue | TValue[];\n}): {\n [key in TValue]: TKey[];\n} {\n const result: any = {};\n\n getEntries(obj).forEach(([key, instance]) => {\n if (instance === undefined) {\n throw new Error('inverse found undefined value, this is not supported');\n }\n\n if (Array.isArray(instance)) {\n instance.forEach((listKey) => {\n if (!result[listKey]) {\n result[listKey] = [key];\n } else {\n result[listKey].push(key);\n }\n });\n return;\n }\n\n if (!result[instance]) {\n result[instance] = [key];\n return;\n }\n\n result[instance].push(key);\n });\n\n return result;\n}\n","import * as t from 'io-ts';\n\nimport { invert } from './invert.js';\n\n/**\n * Build an `io-ts` codec over the values of an enum-like object.\n */\nexport function valuesOf<TEnum extends string>(enm: {\n [key in string]: TEnum;\n}): t.KeyofC<{ [key in TEnum]: unknown }> {\n return t.keyof(invert(enm) as any);\n}\n","/**\n * The full match returned when `regex.exec` finds a match.\n */\nexport interface RegExpMatch {\n /** The full regex match. */\n fullMatch: string;\n /** The index in the text where the match was found. */\n matchIndex: number;\n /** Whether the match satisfies an optional stricter regex. */\n isStrict?: boolean;\n}\n\n/**\n * Definition for finding all regex matches and mapping capture groups to keys.\n */\nexport interface FindAllRegExp<TMatchKeys extends string> {\n /** The regex to test. */\n value: RegExp;\n /**\n * A stricter regex used to annotate matches that satisfy a more exact\n * standard.\n */\n strict?: RegExp;\n /** Capture group names mapped by index. */\n matches: readonly TMatchKeys[];\n /** When true, skip validation of matches being the expected length. */\n skipMatchValidation?: boolean;\n}\n\n/**\n * Use a regex with the global flag to find all matches and return the list with\n * capture groups mapped to named properties.\n */\nexport function findAllWithRegex<TMatchKeys extends string>(\n regex: FindAllRegExp<TMatchKeys>,\n text: string,\n): ({ [key in TMatchKeys]: string } & RegExpMatch)[] {\n if (!regex.value.flags.includes('g')) {\n throw new Error('Regex.value must have a g flag');\n }\n\n const matchParams = ['fullMatch', ...regex.matches];\n const results: ({ [key in TMatchKeys]: string } & RegExpMatch)[] = [];\n\n let match = regex.value.exec(text);\n let index = 0;\n\n while (match) {\n if (matchParams.length !== match.length && !regex.skipMatchValidation) {\n throw new Error(\n `Mismatch in match length at index [${index}]: \"${match.length}\" vs expected: \"${matchParams.length}\"`,\n );\n }\n\n const result = match.reduce(\n (accumulator, matchResult, matchIndex) =>\n Object.assign(accumulator, {\n [matchParams[matchIndex] as string]: matchResult,\n }),\n {},\n ) as { [key in TMatchKeys]: string } & RegExpMatch;\n\n result.matchIndex = match.index;\n\n if (regex.strict) {\n result.isStrict = regex.strict.test(result.fullMatch);\n }\n\n results.push(result);\n\n match = regex.value.exec(text);\n index += 1;\n }\n\n return results;\n}\n","/**\n * Aggregates multiple objects into a single object by combining values of\n * matching keys into comma-separated strings.\n */\nexport const aggregateObjects = ({\n objs,\n wrap = false,\n}: {\n /** The objects to aggregate in a single one. */\n objs: any[];\n /** Whether to wrap the concatenated values in `[]`. */\n wrap?: boolean;\n}): any => {\n const allKeys = Array.from(\n new Set(objs.flatMap((obj) => (obj && typeof obj === 'object' ? Object.keys(obj) : []))),\n );\n\n return allKeys.reduce(\n (accumulator, key) => {\n const values = objs\n .map((obj) => (wrap ? `[${obj?.[key] ?? ''}]` : (obj?.[key] ?? '')))\n .join(',');\n accumulator[key] = values;\n return accumulator;\n },\n {} as Record<string, any>,\n );\n};\n","import { aggregateObjects } from './aggregateObjects.js';\n\n/**\n * Flattens a nested object into a single-level object with concatenated key\n * names.\n */\nexport const flattenObject = ({\n obj,\n prefix = '',\n}: {\n /** The object to flatten. */\n obj: any;\n /** The prefix to prepend to keys while recursing. */\n prefix?: string;\n}): any =>\n !obj\n ? {}\n : Object.keys(obj ?? []).reduce(\n (accumulator, key) => {\n const newKey = prefix ? `${prefix}_${key}` : key;\n const entry = obj[key];\n\n if (\n Array.isArray(entry) &&\n entry.length > 0 &&\n entry.some((item) => typeof item === 'object' && item !== null)\n ) {\n const objectEntries = entry.filter((item) => typeof item === 'object' && item !== null);\n const flattenedObjects = objectEntries.map((item) => flattenObject({ obj: item }));\n const aggregated = aggregateObjects({ objs: flattenedObjects });\n Object.entries(aggregated).forEach(([aggregatedKey, value]) => {\n accumulator[`${newKey}_${aggregatedKey}`] = value;\n });\n } else if (typeof entry === 'object' && entry !== null && !Array.isArray(entry)) {\n Object.assign(accumulator, flattenObject({ obj: entry, prefix: newKey }));\n } else {\n accumulator[newKey] = Array.isArray(entry)\n ? entry\n .map((item) => {\n if (typeof item === 'string') {\n return item.replaceAll(',', '');\n }\n\n return item ?? '';\n })\n .join(',')\n : typeof entry === 'string'\n ? entry.replaceAll(',', '')\n : (entry ?? '');\n }\n\n return accumulator;\n },\n {} as Record<string, any>,\n );\n","/**\n * Type representing a transposed array of objects.\n */\ntype TransposedObjectArray<T, K extends keyof T> = {\n [P in K]: Array<T[P]>;\n} & {\n /** Properties not selected for transposition. */\n rest: Array<Omit<T, K>>;\n};\n\n/**\n * Transpose an array of objects by converting selected properties into arrays\n * while keeping the remaining properties grouped in `rest`.\n */\nexport const transposeObjectArray = <T extends object, K extends keyof T>({\n objects,\n properties,\n options = { includeOtherProperties: true },\n}: {\n /** Array of objects to transpose. */\n objects: T[];\n /** Property keys to transpose into arrays. */\n properties: K[];\n /** Options for how to transpose the array. */\n options?: {\n /** Whether to include non-transposed properties in the final result. */\n includeOtherProperties?: boolean;\n };\n}): TransposedObjectArray<T, K> =>\n objects.reduce(\n (accumulator, item) => {\n const result = { ...accumulator } as TransposedObjectArray<T, K>;\n\n properties.forEach((property) => {\n const currentArray = (accumulator[property] || []) as T[K][];\n result[property] = [...currentArray, item[property]] as any;\n });\n\n const restObject = {} as Omit<T, K>;\n Object.entries(item).forEach(([key, value]) => {\n if (!properties.includes(key as K)) {\n (restObject as any)[key] = value;\n }\n });\n\n if (options.includeOtherProperties) {\n result.rest = [...(accumulator.rest || []), restObject];\n }\n\n return result;\n },\n {} as TransposedObjectArray<T, K>,\n );\n","/**\n * `Object.fromEntries` that preserves entry types.\n */\nexport function fromEntries<const TEntries extends ReadonlyArray<readonly [PropertyKey, unknown]>>(\n entries: TEntries,\n): { [K in TEntries[number] as K[0]]: K[1] } {\n return Object.fromEntries(entries) as { [K in TEntries[number] as K[0]]: K[1] };\n}\n","import type { Either, Right } from 'fp-ts/lib/Either.js';\nimport * as either from 'fp-ts/lib/Either.js';\nimport { pipe } from 'fp-ts/lib/function.js';\nimport * as t from 'io-ts';\n\n/**\n * Creates a type guard function that checks if a codec matches a specific tag.\n */\nconst getIsCodec =\n <T extends t.Any>(tag: string) =>\n (codec: t.Any): codec is T =>\n (codec as any)._tag === tag;\n\nconst isInterfaceCodec = getIsCodec<t.InterfaceType<t.Props>>('InterfaceType');\nconst isPartialCodec = getIsCodec<t.PartialType<t.Props>>('PartialType');\n\n/**\n * Extract property definitions from various codec types.\n */\nconst getProps = (codec: t.HasProps): t.Props => {\n switch (codec._tag) {\n case 'RefinementType':\n case 'ReadonlyType':\n return getProps(codec.type);\n case 'InterfaceType':\n case 'StrictType':\n case 'PartialType':\n return codec.props;\n case 'IntersectionType':\n return codec.types.reduce<t.Props>((props, type) => Object.assign(props, getProps(type)), {});\n default:\n return {};\n }\n};\n\n/**\n * Generate a string representation of props for type naming.\n */\nconst getNameFromProps = (props: t.Props): string =>\n Object.keys(props)\n .map((key) => `${key}: ${props[key]!.name}`)\n .join(', ');\n\n/**\n * Wrap a type name with `Partial<>`.\n */\nconst getPartialTypeName = (inner: string): string => `Partial<${inner}>`;\n\n/**\n * Generate a human-readable type name for the no-excess wrapper.\n */\nconst getNoExcessTypeName = (codec: t.Any): string => {\n if (isInterfaceCodec(codec)) {\n return `{| ${getNameFromProps(codec.props)} |}`;\n }\n\n if (isPartialCodec(codec)) {\n return getPartialTypeName(`{| ${getNameFromProps(codec.props)} |}`);\n }\n\n return `Excess<${codec.name}>`;\n};\n\n/**\n * Compare an object's keys against expected properties and return either the\n * object or a list of excess keys.\n */\nconst stripKeys = <T = any>(obj: T, props: t.Props): Either<string[], T> => {\n const keys = Object.getOwnPropertyNames(obj);\n const propKeys = Object.getOwnPropertyNames(props);\n\n propKeys.forEach((propKey) => {\n const index = keys.indexOf(propKey);\n if (index !== -1) {\n keys.splice(index, 1);\n }\n });\n\n return keys.length ? either.left(keys) : either.right(obj);\n};\n\n/**\n * Wrap an `io-ts` codec so validation fails when excess properties are present.\n */\nexport const noExcess = <C extends t.HasProps>(\n codec: C,\n name: string = getNoExcessTypeName(codec),\n): NoExcessType<C> => {\n const props: t.Props = getProps(codec);\n\n return new NoExcessType<C>(\n name,\n (value): value is C => either.isRight(stripKeys(value, props)) && codec.is(value),\n (value, context) => {\n const unknownRecordValidation = t.UnknownRecord.validate(value, context);\n if (either.isLeft(unknownRecordValidation)) {\n return unknownRecordValidation;\n }\n\n const codecValidation = codec.validate(value, context);\n if (either.isLeft(codecValidation)) {\n return codecValidation;\n }\n\n return pipe(\n stripKeys<C>(codecValidation.right, props),\n either.mapLeft((keys) =>\n keys.map((key) => ({\n value: codecValidation.right[key],\n context,\n message: `excess key \"${key}\" found`,\n })),\n ),\n );\n },\n (value) => codec.encode((stripKeys(value, props) as Right<any>).right),\n codec,\n );\n};\n\n/**\n * A wrapper type used with `io-ts` to ensure there are not any excess keys.\n */\nexport class NoExcessType<C extends t.Any, A = C['_A'], O = A, I = unknown> extends t.Type<\n A,\n O,\n I\n> {\n public readonly _tag = 'NoExcessType' as const;\n\n public constructor(\n name: string,\n is: NoExcessType<C, A, O, I>['is'],\n validate: NoExcessType<C, A, O, I>['validate'],\n encode: NoExcessType<C, A, O, I>['encode'],\n public readonly type: C,\n ) {\n super(name, is, validate, encode);\n }\n}\n"],"mappings":";;;;;;;;AA6BA,SAAgB,WAAW,YAAyC;AAElE,QAAO,WAAW,QAAQ,aAAa,UAAU;AAC/C,cAAY,SAAS;A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S,eAAe,IAAI;GAC7B,EAAE,CACJ,CACF;KAEF,UAAU,MAAM,OAAQ,UAAU,OAAO,MAAM,CAAgB,MAAM,EACtE,MACD;;;;;AAMH,IAAa,eAAb,cAAoF,EAAE,KAIpF;CACA,OAAuB;CAEvB,YACE,MACA,IACA,UACA,QACA,MACA;AACA,QAAM,MAAM,IAAI,UAAU,OAAO;AAFjB,OAAA,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transcend-io/type-utils",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Typed runtime and compile-time utilities for the Transcend developer tools monorepo.",
5
5
  "homepage": "https://github.com/transcend-io/tools/tree/main/packages/type-utils",
6
6
  "license": "Apache-2.0",
@@ -33,11 +33,11 @@
33
33
  "devDependencies": {
34
34
  "@arethetypeswrong/cli": "^0.18.2",
35
35
  "@types/json-schema": "^7.0.15",
36
- "@types/node": "^22.19.15",
36
+ "@types/node": "^24.0.0",
37
37
  "publint": "^0.3.18",
38
38
  "tsdown": "^0.21.2",
39
- "typescript": "^5.9.3",
40
- "vitest": "^4.0.18"
39
+ "typescript": "^6.0.0",
40
+ "vitest": "^4.1.11"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=22.12.0"