Options
All
  • Public
  • Public/Protected
  • All
Menu

Module object/pathSet

Index

References

Functions

References

Renames and re-exports pathSet

Functions

  • pathSet<K, V, O>(path: [K], value: V, obj: O): ReplaceType<O, K, V>
  • pathSet<K, V>(path: [K], value: V): <O>(obj: O) => ReplaceType<O, K, V>
  • pathSet<K>(path: [K]): { <V, O>(value: V, obj: O): ReplaceType<O, K, V>; <V>(value: V): <O>(obj: O) => ReplaceType<O, K, V> }
  • pathSet<O>(path: Paths, value: any, obj: O): O
  • pathSet(path: Paths, value: any): <O>(obj: O) => O
  • pathSet(path: Paths): { <O>(value: any, obj: O): O; (value: any): <O>(obj: O) => O }
  • Returns the result of "setting" the portion of the given data structure focused by the given paths to the given value.

    Note: If property in the object is equal to value by reference then function just returns object without changes

    example
     pathSet(['a', 'b'], 3, {}) //=> { a: { b: 3 } }
    

    Type parameters

    • K: string | number | symbol

    • V

    • O

    Parameters

    • path: [K]
    • value: V
    • obj: O

    Returns ReplaceType<O, K, V>

  • Returns the result of "setting" the portion of the given data structure focused by the given paths to the given value.

    Note: If property in the object is equal to value by reference then function just returns object without changes

    example
     pathSet(['a', 'b'], 3, {}) //=> { a: { b: 3 } }
    

    Type parameters

    • K: string | number | symbol

    • V

    Parameters

    • path: [K]
    • value: V

    Returns <O>(obj: O) => ReplaceType<O, K, V>

  • Returns the result of "setting" the portion of the given data structure focused by the given paths to the given value.

    Note: If property in the object is equal to value by reference then function just returns object without changes

    example
     pathSet(['a', 'b'], 3, {}) //=> { a: { b: 3 } }
    

    Type parameters

    • K: string | number | symbol

    Parameters

    • path: [K]

    Returns { <V, O>(value: V, obj: O): ReplaceType<O, K, V>; <V>(value: V): <O>(obj: O) => ReplaceType<O, K, V> }

      • Type parameters

        • V

        • O

        Parameters

        • value: V
        • obj: O

        Returns ReplaceType<O, K, V>

      • Type parameters

        • V

        Parameters

        • value: V

        Returns <O>(obj: O) => ReplaceType<O, K, V>

  • Returns the result of "setting" the portion of the given data structure focused by the given paths to the given value.

    Note: If property in the object is equal to value by reference then function just returns object without changes

    example
     pathSet(['a', 'b'], 3, {}) //=> { a: { b: 3 } }
    

    Type parameters

    • O

    Parameters

    • path: Paths
    • value: any
    • obj: O

    Returns O

  • Returns the result of "setting" the portion of the given data structure focused by the given paths to the given value.

    Note: If property in the object is equal to value by reference then function just returns object without changes

    example
     pathSet(['a', 'b'], 3, {}) //=> { a: { b: 3 } }
    

    Parameters

    Returns <O>(obj: O) => O

      • <O>(obj: O): O
      • Type parameters

        • O

        Parameters

        • obj: O

        Returns O

  • Returns the result of "setting" the portion of the given data structure focused by the given paths to the given value.

    Note: If property in the object is equal to value by reference then function just returns object without changes

    example
     pathSet(['a', 'b'], 3, {}) //=> { a: { b: 3 } }
    

    Parameters

    Returns { <O>(value: any, obj: O): O; (value: any): <O>(obj: O) => O }

      • <O>(value: any, obj: O): O
      • (value: any): <O>(obj: O) => O
      • Type parameters

        • O

        Parameters

        • value: any
        • obj: O

        Returns O

      • Parameters

        • value: any

        Returns <O>(obj: O) => O

          • <O>(obj: O): O
          • Type parameters

            • O

            Parameters

            • obj: O

            Returns O

Generated using TypeDoc