Options
All
  • Public
  • Public/Protected
  • All
Menu

Package lenses

@typed/lenses

A pretty basic Lenses library.

Index

Type aliases

GetPath

GetPath<O, K>: K extends [] ? O : { complete: Head<K> extends keyof O ? O[Head<K>] : never; continue: Head<K> extends keyof O ? GetPath<O[Head<K>], Tail<K>> : never }[[] extends Tail<K> ? "complete" : "continue"]

Type parameters

  • O

  • K: ReadonlyArray<PropertyKey>

LensInput

LensInput<A>: A extends Lens<infer R, any> ? R : never

Type parameters

  • A

LensOutput

LensOutput<A>: A extends Lens<any, infer R> ? R : never

Type parameters

  • A

PathLensKeys

PathLensKeys<A>: A extends PathLens<infer Keys> ? Keys : never

Type parameters

  • A

PathToRecord

PathToRecord<K, R>: Tail<K> extends [] ? {} : {}

Type parameters

  • K: ReadonlyArray<PropertyKey>

  • R

PipeLenses

PipeLenses<A>: A extends ReadonlyArray<PropLens<any>> ? PathLens<GetPropKeys<A>> : GetPipedLenses<LensInput<Head<A>>, LensOutput<Head<A>>, Tail<A>>

Type parameters

  • A: Lenses

PropLensKey

PropLensKey<A>: A extends PropLens<infer K> ? K : never

Type parameters

  • A

Functions

Const fromPath

Const fromProp

pipe

pipe2

  • pipe2<A, B, C>(ab: Lens<A, B>, bc: Lens<B, C>): Lens<A, C>

Generated using TypeDoc