2.0.2 • Published 7 months ago

@types/safe-flat v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/safe-flat

Summary

This package contains type definitions for safe-flat (https://github.com/jessie-codes/safe-flat).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/safe-flat.

index.d.ts

// Type definitions for safe-flat 2.0
// Project: https://github.com/jessie-codes/safe-flat
// Definitions by: GP <https://github.com/paambaati>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
 * Flattens an object to one level deep.
 * Optionally takes a custom delimiter, otherwise uses `.` by default.
 * Circular references within the object will be replaced with `[Circular]`.
 *
 * @param object Object to flatten
 * @param delimiter (Optional) Delimiter.
 */
export function flatten(a: Record<string | number, unknown>, delimiter?: string): Record<string, unknown>;

/**
 * Unflattens an object back to its original nested form.
 * Optionally takes a custom delimiter, otherwise uses `.` by default.
 * Circular references denoted by `[Circular]` are treated as strings.
 *
 * @param object Object to flatten
 * @param delimiter (Optional) Delimiter.
 */
export function unflatten(object: Record<string, unknown>, delimiter?: string): Record<string | number, unknown>;

Additional Details

  • Last updated: Wed, 01 Dec 2021 18:01:08 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by GP.