@types/set-value

  • Version 4.0.1
  • Published
  • 6.79 kB
  • No dependencies
  • MIT license

Install

npm i @types/set-value
yarn add @types/set-value
pnpm add @types/set-value

Overview

TypeScript definitions for set-value

Index

Functions

function set

set: {
<T extends object, K extends keyof T>(
object: T,
path: K,
value: T[K],
options?: set.Options
): void;
(object: object, path: set.InputType, value: any, options?: set.Options): void;
};
  • Parameter object

    The object to set value on

    Parameter path

    The of the property to set.

    Parameter value

    The value to set on object[prop]

    Parameter options

Interfaces

interface Options

interface Options {}

    property merge

    merge?: boolean | MergeFunc | undefined;
    • Allows you to update plain object values, instead of overwriting them. undefined

    property preservePaths

    preservePaths?: boolean | undefined;
    • Do not split properties that include a /. By default, set-value assumes that properties with a / are not intended to be split. This option allows you to disable default behavior. Note that this option cannot be used if options.separator is set to /. true

    property separator

    separator?: string | undefined;
    • Custom separator to use for splitting object paths. .

    property split

    split?: SplitFunc | undefined;
    • Custom .split() function to use.

    Type Aliases

    type InputType

    type InputType = string | symbol | ReadonlyArray<string | symbol>;

      type MergeFunc

      type MergeFunc = <TObject, TSource>(
      object: TObject,
      source: TSource
      ) => TObject & TSource;

        type SplitFunc

        type SplitFunc = (input: string, options?: Options) => string;

          Package Files (1)

          Dependencies (0)

          No dependencies.

          Dev Dependencies (0)

          No dev dependencies.

          Peer Dependencies (0)

          No peer dependencies.

          Badge

          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/set-value.

          • Markdown
            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/set-value)
          • HTML
            <a href="https://www.jsdocs.io/package/@types/set-value"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>