# json-shape

> Tiny naive LRU cache.

Latest version **0.0.1** (published 2019-11-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-shape
pnpm add json-shape
yarn add json-shape
bun add json-shape
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-11-26 |
| First published | 2019-11-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | estrattonbailey |
| Maintainers | estrattonbailey |

## Links

- npm: https://www.npmjs.com/package/json-shape
- Repository: https://github.com/truework/json-shape
- Homepage: https://github.com/truework/json-shape#readme
- Issues: https://github.com/truework/json-shape/issues
- npm.io page: https://npm.io/package/json-shape

## Recent versions

- 0.0.1 (latest) — 2019-11-26

## README

# json-shape

Tiny JSON util that deeply overwrites values with metadata. **250 bytes gzipped.**

### Install

```
npm i json-shape --save
```

### What is this?

When reporting errors, it's sometimes useful to send along data associated with
the broken UI, HTTP request, or acting user. To avoid revealing Personal
Identifying Information (PII), you need to redact certain values. Or, instead of
keeping track of which values are PII and which aren't, you could just redact
all values, returning metadata about the value that can then be used to debug.

# Usage
Here's an example from the tests:

```javascript
import redact from "redact";

const o = shape({
  a: {
    b: 'b',
    c: [
      '',
      {
        b: 1,
      }
    ]
  }
});

t.deepEqual(o, {
  a: {
    b: ['string', { length: 1, truthy: true }],
    c: [
      ['string', { length: 0, truthy: false }],
      {
        b: ['number', { truthy: true }]
      }
    ]
  }
});
```

### License

MIT License © [Truework](https://www.truework.com/)

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