chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -76,9 +76,7 @@ function redactPemBlock(block: string): string {
|
||||
function redactMatch(match: string, groups: string[]): string {
|
||||
if (match.includes("PRIVATE KEY-----")) return redactPemBlock(match);
|
||||
const token =
|
||||
groups
|
||||
.filter((value) => typeof value === "string" && value.length > 0)
|
||||
.at(-1) ?? match;
|
||||
groups.filter((value) => typeof value === "string" && value.length > 0).at(-1) ?? match;
|
||||
const masked = maskToken(token);
|
||||
if (token === match) return masked;
|
||||
return match.replace(token, masked);
|
||||
@@ -102,10 +100,7 @@ function resolveConfigRedaction(): RedactOptions {
|
||||
};
|
||||
}
|
||||
|
||||
export function redactSensitiveText(
|
||||
text: string,
|
||||
options?: RedactOptions,
|
||||
): string {
|
||||
export function redactSensitiveText(text: string, options?: RedactOptions): string {
|
||||
if (!text) return text;
|
||||
const resolved = options ?? resolveConfigRedaction();
|
||||
if (normalizeMode(resolved.mode) === "off") return text;
|
||||
|
||||
Reference in New Issue
Block a user