# @types/iterate-object

> TypeScript definitions for iterate-object

Latest version **1.3.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/iterate-object
pnpm add @types/iterate-object
yarn add @types/iterate-object
bun add @types/iterate-object
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.3.3 |
| Published | 2023-11-07 |
| First published | 2022-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51432 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/iterate-object
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iterate-object
- npm.io page: https://npm.io/package/@types/iterate-object

## Recent versions

- 1.3.3 (latest) — 2023-11-07
- 1.3.0 (ts4.1) — 2022-10-19
- 1.3.2 — 2023-10-18
- 1.3.1 — 2023-09-26

## README

# Installation
> `npm install --save @types/iterate-object`

# Summary
This package contains type definitions for iterate-object (https://github.com/IonicaBizau/node-iterate-object).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iterate-object.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/iterate-object/index.d.ts)
````ts
export = iterateObject;

type ArrayEntries<T extends unknown[], N extends 1 | 2 | 3> = {
    [P in keyof T]: N extends 1 ? [value: T[P]]
        : N extends 2 ? [value: T[P], index: P]
        : N extends 3 ? [value: T[P], index: P, arr: T]
        : never;
}[number];

type KeyValueEntries<
    T extends Record<string, unknown>,
    N extends 1 | 2 | 3,
> = {
    [P in keyof T]: N extends 1 ? [value: T[P]]
        : N extends 2 ? [value: T[P], key: P]
        : N extends 3 ? [value: T[P], key: P, obj: T]
        : never;
}[keyof T];

declare function iterateObject<O extends unknown[]>(
    obj: O,
    fn: (...args: ArrayEntries<O, 3>) => void,
): void;
declare function iterateObject<O extends unknown[]>(
    obj: O,
    // tslint:disable-next-line:unified-signatures
    fn: (...args: ArrayEntries<O, 2>) => void,
): void;
declare function iterateObject<O extends unknown[]>(
    obj: O,
    // tslint:disable-next-line:unified-signatures
    fn: (...args: ArrayEntries<O, 1>) => void,
): void;
declare function iterateObject<O extends Record<string, unknown>>(
    obj: O,
    fn: (...args: KeyValueEntries<O, 3>) => void,
): void;
declare function iterateObject<O extends Record<string, unknown>>(
    obj: O,
    // tslint:disable-next-line:unified-signatures
    fn: (...args: KeyValueEntries<O, 2>) => void,
): void;
declare function iterateObject<O extends Record<string, unknown>>(
    obj: O,
    // tslint:disable-next-line:unified-signatures
    fn: (...args: KeyValueEntries<O, 1>) => void,
): void;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [Jimmy Cuadra](https://github.com/jimmycuadra).

---
_Source: https://npm.io/package/@types/iterate-object · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
