mask-privacy 3.5.0 → 3.5.1
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/fpe.ts +3 -3
- package/src/index.ts +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -481,7 +481,7 @@ declare class DLPConfidenceScorer {
|
|
|
481
481
|
* Provides format-preserving encryption, local/distributed vaulting,
|
|
482
482
|
* and framework-agnostic tool interception hooks.
|
|
483
483
|
*/
|
|
484
|
-
declare const VERSION = "3.5.
|
|
484
|
+
declare const VERSION = "3.5.1";
|
|
485
485
|
|
|
486
486
|
/**
|
|
487
487
|
* Detect PII entities in text and return a list of objects with metadata.
|
package/dist/index.d.ts
CHANGED
|
@@ -481,7 +481,7 @@ declare class DLPConfidenceScorer {
|
|
|
481
481
|
* Provides format-preserving encryption, local/distributed vaulting,
|
|
482
482
|
* and framework-agnostic tool interception hooks.
|
|
483
483
|
*/
|
|
484
|
-
declare const VERSION = "3.5.
|
|
484
|
+
declare const VERSION = "3.5.1";
|
|
485
485
|
|
|
486
486
|
/**
|
|
487
487
|
* Detect PII entities in text and return a list of objects with metadata.
|
package/dist/index.js
CHANGED
|
@@ -372,7 +372,7 @@ async function generateFPEToken(rawText, entityType = "UNKNOWN") {
|
|
|
372
372
|
else if (_SSN_RE.test(text)) type = "US_SSN";
|
|
373
373
|
else if (_CC_RE.test(text)) type = "CREDIT_CARD";
|
|
374
374
|
else if (_ROUTING_RE.test(text)) type = "US_ROUTING_NUMBER";
|
|
375
|
-
else if (_ES_ID_RE.test(text)) type = "
|
|
375
|
+
else if (_ES_ID_RE.test(text)) type = "ES_ID";
|
|
376
376
|
else if (_IBAN_RE.test(text)) type = "INTL_BANK_IBAN";
|
|
377
377
|
else if (_PHONE_RE.test(text)) type = "PHONE_NUMBER";
|
|
378
378
|
}
|
|
@@ -402,7 +402,7 @@ async function generateFPEToken(rawText, entityType = "UNKNOWN") {
|
|
|
402
402
|
const countryCode = text.length >= 2 && /[a-zA-Z]{2}/.test(text.slice(0, 2)) ? text.slice(0, 2).toUpperCase() : "US";
|
|
403
403
|
return `${countryCode}00${(await _hmacHex(text, 8)).toUpperCase()}`;
|
|
404
404
|
}
|
|
405
|
-
if (type === "ES_DNI") {
|
|
405
|
+
if (type === "ES_ID" || type === "ES_DNI") {
|
|
406
406
|
const digits = `000${await _hmacDigits(text, 5)}`;
|
|
407
407
|
return digits + _computeEsIdCheck(parseInt(digits, 10));
|
|
408
408
|
}
|
|
@@ -430,7 +430,7 @@ var init_fpe = __esm({
|
|
|
430
430
|
init_fpe_utils();
|
|
431
431
|
_masterKey = null;
|
|
432
432
|
_EMAIL_RE = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
433
|
-
_PHONE_RE = /(?<!\d)(?:\+?1?[\s\-.]?\(?\d{3}\)?[\s\-.]?\d{3}[\s\-.]?\d{4}|\d{3}[\s\-.]?\d{4})(?!\d)/;
|
|
433
|
+
_PHONE_RE = /(?<!\d)(?:\+?1?[\s\-.]?\(?\d{3}\)?[\s\-.]?\d{3}[\s\-.]?\d{4}|\d{3}[\s\-.]?\d{4}|\+\d{2,3}[\s\-.]?\d{3}[\s\-.]?\d{3}[\s\-.]?\d{3,4})(?!\d)/;
|
|
434
434
|
_SSN_RE = /^\d{3}-\d{2}-\d{4}$/;
|
|
435
435
|
_CC_RE = /^(?:\d{4}[ \-]?){3}\d{4}$/;
|
|
436
436
|
_ROUTING_RE = /^\d{9}$/;
|
|
@@ -59646,7 +59646,7 @@ init_handlers();
|
|
|
59646
59646
|
init_scorer();
|
|
59647
59647
|
|
|
59648
59648
|
// src/index.ts
|
|
59649
|
-
var VERSION = "3.5.
|
|
59649
|
+
var VERSION = "3.5.1";
|
|
59650
59650
|
async function detectEntitiesWithConfidence(text, options = {}) {
|
|
59651
59651
|
const scanner = getScanner();
|
|
59652
59652
|
return await scanner.scanAndReturnEntities(text, options);
|