# tiny-immutable-set

> Minimal, immutable deep set

Latest version **1.3.1** (published 2024-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-immutable-set
pnpm add tiny-immutable-set
yarn add tiny-immutable-set
bun add tiny-immutable-set
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2024-02-02 |
| First published | 2020-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 36 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2 |
| Author | Steven Pautz |
| Maintainers | spautz |
| Keywords | immutable set, tiny-set, lodash set, deep set |

## Links

- npm: https://www.npmjs.com/package/tiny-immutable-set
- Repository: https://github.com/spautz/tiny-immutable-set
- Homepage: https://github.com/spautz/tiny-immutable-set/tree/main/packages/tiny-immutable-set#readme
- Issues: https://github.com/spautz/tiny-immutable-set/issues
- npm.io page: https://npm.io/package/tiny-immutable-set

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2024-02-02
- 1.3.0 — 2024-01-28
- 1.2.1 — 2023-05-17
- 1.2.0 — 2023-05-04
- 1.1.2 — 2021-06-18
- 1.1.1 — 2021-02-28
- 1.1.0 — 2021-02-27
- 1.0.2 — 2021-01-10
- 1.0.1 — 2020-11-03
- 1.0.0 — 2020-09-14
- 0.1.0 — 2020-08-22

## README

# tiny-immutable-set

A minimal, immutable, deep set utility for Javascript objects and arrays.

Inspired by, and based on, [NickGard's tiny-get](https://github.com/NickGard/tiny-get)

[![npm version](https://img.shields.io/npm/v/tiny-immutable-set.svg)](https://www.npmjs.com/package/tiny-immutable-set)
[![build status](https://github.com/spautz/tiny-immutable-set/workflows/CI/badge.svg)](https://github.com/spautz/tiny-immutable-set/actions)
[![test coverage](https://img.shields.io/coveralls/github/spautz/tiny-immutable-set/main.svg)](https://coveralls.io/github/spautz/tiny-immutable-set?branch=main)
[![dependencies status](https://img.shields.io/librariesio/release/npm/tiny-immutable-set.svg)](https://libraries.io/github/spautz/tiny-immutable-set)
[![gzip size](https://img.shields.io/bundlephobia/minzip/tiny-immutable-set.svg)](https://bundlephobia.com/package/tiny-immutable-set@latest)

## Usage

```typescript
import { set } from 'tiny-immutable-set';

const newState = set(state, 'deep.path', newValue);
```

The original `state` is not modified.

## Notes

- If you're using [lodash](https://lodash.com) then you don't need this: [see this thread for alternatives](https://github.com/lodash/lodash/issues/1696#issuecomment-328335502).
- Unlike most other setter utilities, this is slightly faster if you use a string for the path, instead of an array: `set(obj, "deep.path[123]", newVal)` instead of `set(obj, ["deep", "path", 123], newVal)`.
- The small bundle size of this library comes with a slight speed tradeoff. This library is a little slower than
  immutable-assign and immutable.js, but a little faster than Immer and seamless-immutable.
  [See full benchmark here.](./benchmark)

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