Hyperlinkv0.8.0-beta.28

SchemaAST

SchemaAST.KeyValueCombinerclasseffect/SchemaAST.ts:1904
KeyValueCombiner

Represents a bidirectional merge strategy for index signature key-value pairs.

Details

Used by IndexSignature when the same key appears multiple times (e.g. from Schema.extend or overlapping records). Provides separate decode and encode combiners that determine how duplicate entries are merged.

export class KeyValueCombiner {
  readonly decode: Combiner.Combiner<readonly [key: PropertyKey, value: any]> | undefined
  readonly encode: Combiner.Combiner<readonly [key: PropertyKey, value: any]> | undefined

  constructor(
    decode: Combiner.Combiner<readonly [key: PropertyKey, value: any]> | undefined,
    encode: Combiner.Combiner<readonly [key: PropertyKey, value: any]> | undefined
  ) {
    this.decode = decode
    this.encode = encode
  }
  /** @internal */
  flip(): KeyValueCombiner {
    return new KeyValueCombiner(this.encode, this.decode)
  }
}
Referenced by 2 symbols