Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/set-value

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/set-value

TypeScript definitions for set-value

  • 4.0.3
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/set-value

Summary

This package contains type definitions for set-value (https://github.com/jonschlinkert/set-value).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/set-value.

index.d.ts

export = set;

// Technically, everything will fall to the last overload,
// but the first one can be useful for signature help.

/**
 * @param object The object to set `value` on
 * @param path The of the property to set.
 * @param value The value to set on `object[prop]`
 * @param [options]
 */

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

declare namespace set {
    interface Options {
        /**
         * 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 `/`.
         * @default true
         */
        preservePaths?: boolean | undefined;
        /**
         * Custom separator to use for splitting object paths.
         * @default `.`
         */
        separator?: string | undefined;
        /**
         * Custom `.split()` function to use.
         */
        split?: SplitFunc | undefined;
        /**
         * Allows you to update plain object values, instead of overwriting them.
         * @default  `undefined`
         */
        merge?: boolean | MergeFunc | undefined;
    }

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

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

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

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Daniel Rosenwasser, and Piotr Błażejewicz.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc