# @types/redact-secrets

> TypeScript definitions for redact-secrets

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

## Install

```sh
npm install @types/redact-secrets
pnpm add @types/redact-secrets
yarn add @types/redact-secrets
bun add @types/redact-secrets
```

## 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.0.3 |
| Published | 2023-11-07 |
| First published | 2020-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51437 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.0.3 (latest) — 2023-11-07
- 1.0.1 (ts4.1) — 2022-11-23
- 1.0.0 (ts3.0) — 2020-05-28
- 1.0.2 — 2023-10-18

## README

# Installation
> `npm install --save @types/redact-secrets`

# Summary
This package contains type definitions for redact-secrets (https://github.com/watson/redact-secrets#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redact-secrets.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redact-secrets/index.d.ts)
````ts
interface Redactor {
    /**
     * @param obj The object to redact.
     * @returns A clone of the given `obj` with its secret values redacted.
     */
    map<TObj extends Record<string, any>>(obj: TObj): TObj;
    /**
     * Redacts the secret values of the `obj` in-place.
     *
     * @param obj The object to redact.
     */
    forEach(obj: Record<string, unknown>): void;
}

/**
 * Create a redactor instance.
 *
 * @param redacted The string used as a replacement variable for values that are redacted.
 *
 * @example
 * const makeRedact = require('redact-secrets')
 *
 * const redact = makeRedact('[REDACTED]')
 *
 * const obj = {
 *   username: 'watson',
 *   password: 'hhGu38gf',
 *   extra: {
 *     id: 1,
 *     token: 'some-secret-stuff'
 *     card: '1234 1234 1234 1234'
 *   }
 * }
 *
 * console.log(redact.map(obj))
 * // {
 * //   username: 'watson',
 * //   password: '[REDACTED]',
 * //   extra: {
 * //     id: 1,
 * //     token: '[REDACTED]'
 * //     card: '[REDACTED]'
 * //   }
 * // }
 */
declare function Redact(redacted: string): Redactor;

export = Redact;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [wrumsby](https://github.com/wrumsby).

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