Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "mut-in-many"

Index

Functions

mutInManyUnsafe

  • mutInManyUnsafe<T>(state: T, p1: Path, v1: any): T
  • mutInManyUnsafe<T>(state: T, p1: Path, v1: any, p2: Path, v2: any): T
  • mutInManyUnsafe<T>(state: T, p1: Path, v1: any, p2: Path, v2: any, p3: Path, v3: any): T
  • mutInManyUnsafe<T>(state: T, p1: Path, v1: any, p2: Path, v2: any, p3: Path, v3: any, p4: Path, v4: any): T
  • mutInManyUnsafe<T>(state: T, p1: Path, v1: any, p2: Path, v2: any, p3: Path, v3: any, p4: Path, v4: any, ...xs: any[]): T
  • Similar to mutInUnsafe, but takes any number of path-value pairs as args and applies them in sequence using mutInUnsafe().

    remarks

    All intermediate path keys must already be present in the given data structure until their penultimate key. Missing leaf keys are supported.

    The type parameter T can be used to indicate the type of the state value and will also be used as return type.

    example
    mutInManyUnsafe(
      { a: { b: 1 }, x: { y: { z: 2 } } },
      // pair #1
      "a.b", 10,
      // pair #2
      "x.y.z", 20
    )
    // { a: { b: 10 }, x: { y: { z: 20 } } }

    Type parameters

    • T

    Parameters

    • state: T

      -

    • p1: Path
    • v1: any

    Returns T

  • Type parameters

    • T

    Parameters

    • state: T
    • p1: Path
    • v1: any
    • p2: Path
    • v2: any

    Returns T

  • Type parameters

    • T

    Parameters

    • state: T
    • p1: Path
    • v1: any
    • p2: Path
    • v2: any
    • p3: Path
    • v3: any

    Returns T

  • Type parameters

    • T

    Parameters

    • state: T
    • p1: Path
    • v1: any
    • p2: Path
    • v2: any
    • p3: Path
    • v3: any
    • p4: Path
    • v4: any

    Returns T

  • Type parameters

    • T

    Parameters

    • state: T
    • p1: Path
    • v1: any
    • p2: Path
    • v2: any
    • p3: Path
    • v3: any
    • p4: Path
    • v4: any
    • Rest ...xs: any[]

    Returns T

Generated using TypeDoc