@flexorch/audit 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -838,7 +838,7 @@ function applyMask(text, findings, strategy = "redact") {
|
|
|
838
838
|
const tag = type.toUpperCase();
|
|
839
839
|
let replacement;
|
|
840
840
|
if (strategy === "redact") {
|
|
841
|
-
replacement = `[
|
|
841
|
+
replacement = `[MASKED_${tag}]`;
|
|
842
842
|
} else if (strategy === "replace") {
|
|
843
843
|
replacement = synthetic(type, value);
|
|
844
844
|
} else if (strategy === "token") {
|
|
@@ -853,7 +853,7 @@ function applyMask(text, findings, strategy = "redact") {
|
|
|
853
853
|
}
|
|
854
854
|
|
|
855
855
|
// src/index.ts
|
|
856
|
-
var version = "0.
|
|
856
|
+
var version = "0.8.2";
|
|
857
857
|
function computeQualityScore(completeness, avgLength, garbageRatio) {
|
|
858
858
|
const lengthScore = Math.min(avgLength / 500, 1);
|
|
859
859
|
const noiseScore = Math.max(0, 1 - garbageRatio * 10);
|
package/dist/index.d.cts
CHANGED
|
@@ -51,10 +51,10 @@ declare function applyMask(text: string, findings: PiiFinding[], strategy?: Mask
|
|
|
51
51
|
* result.noise // { garbage_ratio, encoding_ok }
|
|
52
52
|
*
|
|
53
53
|
* const clean = mask(text, result.pii, { strategy: "redact" })
|
|
54
|
-
* // "Contact: [
|
|
54
|
+
* // "Contact: [MASKED_EMAIL]"
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
|
-
declare const version = "0.
|
|
57
|
+
declare const version = "0.8.2";
|
|
58
58
|
type QualityGrade = "A" | "B" | "C" | "D";
|
|
59
59
|
interface PiiSummaryEntry {
|
|
60
60
|
type: string;
|
|
@@ -139,7 +139,7 @@ declare function auditStream(texts: AsyncIterable<string>, options?: AuditOption
|
|
|
139
139
|
*
|
|
140
140
|
* @example
|
|
141
141
|
* const clean = redactForLlm("TCKN: 12345678950, email: ali@example.com", { locale: "tr" })
|
|
142
|
-
* // "TCKN: [
|
|
142
|
+
* // "TCKN: [MASKED_NATIONAL_ID_TR], email: [MASKED_EMAIL]"
|
|
143
143
|
*/
|
|
144
144
|
declare function redactForLlm(text: string, options?: AuditOptions & MaskOptions): string;
|
|
145
145
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -51,10 +51,10 @@ declare function applyMask(text: string, findings: PiiFinding[], strategy?: Mask
|
|
|
51
51
|
* result.noise // { garbage_ratio, encoding_ok }
|
|
52
52
|
*
|
|
53
53
|
* const clean = mask(text, result.pii, { strategy: "redact" })
|
|
54
|
-
* // "Contact: [
|
|
54
|
+
* // "Contact: [MASKED_EMAIL]"
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
|
-
declare const version = "0.
|
|
57
|
+
declare const version = "0.8.2";
|
|
58
58
|
type QualityGrade = "A" | "B" | "C" | "D";
|
|
59
59
|
interface PiiSummaryEntry {
|
|
60
60
|
type: string;
|
|
@@ -139,7 +139,7 @@ declare function auditStream(texts: AsyncIterable<string>, options?: AuditOption
|
|
|
139
139
|
*
|
|
140
140
|
* @example
|
|
141
141
|
* const clean = redactForLlm("TCKN: 12345678950, email: ali@example.com", { locale: "tr" })
|
|
142
|
-
* // "TCKN: [
|
|
142
|
+
* // "TCKN: [MASKED_NATIONAL_ID_TR], email: [MASKED_EMAIL]"
|
|
143
143
|
*/
|
|
144
144
|
declare function redactForLlm(text: string, options?: AuditOptions & MaskOptions): string;
|
|
145
145
|
/**
|
package/dist/index.js
CHANGED
|
@@ -800,7 +800,7 @@ function applyMask(text, findings, strategy = "redact") {
|
|
|
800
800
|
const tag = type.toUpperCase();
|
|
801
801
|
let replacement;
|
|
802
802
|
if (strategy === "redact") {
|
|
803
|
-
replacement = `[
|
|
803
|
+
replacement = `[MASKED_${tag}]`;
|
|
804
804
|
} else if (strategy === "replace") {
|
|
805
805
|
replacement = synthetic(type, value);
|
|
806
806
|
} else if (strategy === "token") {
|
|
@@ -815,7 +815,7 @@ function applyMask(text, findings, strategy = "redact") {
|
|
|
815
815
|
}
|
|
816
816
|
|
|
817
817
|
// src/index.ts
|
|
818
|
-
var version = "0.
|
|
818
|
+
var version = "0.8.2";
|
|
819
819
|
function computeQualityScore(completeness, avgLength, garbageRatio) {
|
|
820
820
|
const lengthScore = Math.min(avgLength / 500, 1);
|
|
821
821
|
const noiseScore = Math.max(0, 1 - garbageRatio * 10);
|