@types/redact-secrets
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -5,11 +5,50 @@ // Type definitions for redact-secrets 1.0 | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.7 | ||
interface Redactor { | ||
map: (obj: any) => any; | ||
forEach: (obj: any) => void; | ||
/** | ||
* @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; |
{ | ||
"name": "@types/redact-secrets", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "TypeScript definitions for redact-secrets", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redact-secrets", | ||
"license": "MIT", | ||
@@ -22,4 +23,4 @@ "contributors": [ | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "86d8fe513e3661c3616f779a7712a9d96ee85284979034888fb73e69d12e049c", | ||
"typeScriptVersion": "3.0" | ||
"typesPublisherContentHash": "0dbc571b2c9cc3407376dca892900894c6f8245d293434e6a998653653ad3f52", | ||
"typeScriptVersion": "4.1" | ||
} |
@@ -9,5 +9,62 @@ # Installation | ||
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 | ||
// Type definitions for redact-secrets 1.0 | ||
// Project: https://github.com/watson/redact-secrets#readme | ||
// Definitions by: wrumsby <https://github.com/wrumsby> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
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: Thu, 28 May 2020 01:34:46 GMT | ||
* Last updated: Wed, 23 Nov 2022 18:11:55 GMT | ||
* Dependencies: none | ||
@@ -14,0 +71,0 @@ * Global values: none |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5232
50
0
74