# object-set-type

> A Set implementation which supports Objects.

Latest version **2.3.0** (published 2026-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install object-set-type
pnpm add object-set-type
yarn add object-set-type
bun add object-set-type
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2026-02-07 |
| First published | 2018-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 2 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Laszlo Szikszai |
| Maintainers | szikszail |
| Keywords | Set, Object |

## Links

- npm: https://www.npmjs.com/package/object-set-type
- Repository: https://github.com/szikszail/object-set-type
- Homepage: https://github.com/szikszail/object-set-type#readme
- Issues: https://github.com/szikszail/object-set-type/issues
- npm.io page: https://npm.io/package/object-set-type

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [deep-eql](https://npm.io/package/deep-eql.md) ^5.0.2

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.3.0 (latest) — 2026-02-07
- 2.2.2 — 2023-07-27
- 2.2.1 — 2022-03-10
- 2.2.0 — 2022-03-09
- 2.1.2 — 2022-01-07
- 2.1.1 — 2021-12-09
- 2.1.0 — 2021-11-27
- 2.0.3 — 2021-09-20
- 2.0.2 — 2021-09-20
- 2.0.1 — 2021-01-22
- 2.0.0 — 2021-01-22
- 1.0.1 — 2018-01-06
- 1.0.0 — 2018-01-06

## README

# object-set-type

![Downloads](https://img.shields.io/npm/dw/object-set-type?style=flat-square) ![Version@npm](https://img.shields.io/npm/v/object-set-type?label=version%40npm&style=flat-square) ![Version@git](https://img.shields.io/github/package-json/v/szikszail/object-set-type/main?label=version%40git&style=flat-square) ![CI](https://img.shields.io/github/actions/workflow/status/szikszail/object-set-type/ci.yml?branch=main&label=ci&style=flat-square) ![Docs](https://img.shields.io/github/actions/workflow/status/szikszail/object-set-type/docs.yml?branch=main&label=docs&style=flat-square)

A Set implementation that supports **Objects** and **custom conditions**.

## Usage

```js
const ObjectSet = require('object-set-type');

const set = new ObjectSet();
set.add(1);
set.add('Hello');
set.add({
    a: 1
});
set.add({
    a: 1
});

console.log(set.size); // 3
Array.from(set); // 1, "Hello", {a: 1}
```

## Custom comparison logic

The `equals(a,b)` method is responsible for comparing two items, and the set logic is based on this. This method can be overwritten to support custom uniqueness logic, e.g., handle objects, but compare only specific properties.

# Documentation

For detailed documentation see the [TypeDocs documentation](https://szikszail.github.io/object-set-type/).

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