@types/get-value

  • Version 3.0.1
  • Published
  • 4.58 kB
  • No dependencies
  • MIT license

Install

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

Overview

TypeScript definitions for get-value

Index

Functions

function get

get: {
<T>(obj: T): T;
(obj: object, key: string | string[], options?: get.Options): any;
};

    Interfaces

    interface Options

    interface Options {}

      property default

      default?: any;
      • The default value to return when get-value cannot result a value from the given object.

        default: undefined

      property isValid

      isValid?: <K extends string>(key: K, object: Record<K, any>) => boolean;
      • If defined, this function is called on each resolved value. Useful if you want to do .hasOwnProperty or Object.prototype.propertyIsEnumerable.

      property join

      join?: (segs: string[]) => string;
      • Customize how the object path is created when iterating over path segments.

        default: Array.join

      property joinChar

      joinChar?: string;
      • The character to use when re-joining the string to check for keys with dots in them (this is probably not needed when options.join is used). This can be a different value than the separator, since the separator can be a string or regex.

        default: "."

      property separator

      separator?: string | RegExp;
      • The separator to use for spliting the string. (this is probably not needed when options.split is used).

        default: "."

      property split

      split?: (s: string) => string[];
      • Custom function to use for splitting the string into object path segments.

        default: String.split

      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/get-value.

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