@stll/anonymize 1.3.0 → 1.4.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.
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
@@ -0,0 +1,99 @@
1
+ //#region src/data/structural-single-cap-prefixes.json
2
+ var _comment = "Structural document-unit words that can precede a single-letter or letter-number marker before a legal form word, e.g. 'Schedule A LLC Members' or 'Exhibit A-1 LLC Agreement'. Lowercased; matched case-insensitively. Organised per-language; runtime unions all languages because match spans do not carry a language tag.";
3
+ var en = [
4
+ "annex",
5
+ "appendix",
6
+ "article",
7
+ "attachment",
8
+ "clause",
9
+ "exhibit",
10
+ "paragraph",
11
+ "part",
12
+ "schedule",
13
+ "section"
14
+ ];
15
+ var cs = [
16
+ "bod",
17
+ "paragraf",
18
+ "podbod",
19
+ "ustanovení",
20
+ "článek"
21
+ ];
22
+ var sk = [
23
+ "bod",
24
+ "hlava",
25
+ "oddiel",
26
+ "odsek",
27
+ "pododdiel",
28
+ "sekcia",
29
+ "časť",
30
+ "článok"
31
+ ];
32
+ var de = [
33
+ "absatz",
34
+ "abschnitt",
35
+ "abteilung",
36
+ "anlage",
37
+ "anhang",
38
+ "artikel",
39
+ "kapitel",
40
+ "klausel",
41
+ "punkt",
42
+ "sektion",
43
+ "unterabschnitt",
44
+ "unterpunkt"
45
+ ];
46
+ var es = [
47
+ "anexo",
48
+ "apartado",
49
+ "artículo",
50
+ "cláusula",
51
+ "sección"
52
+ ];
53
+ var fr = [
54
+ "annexe",
55
+ "article",
56
+ "clause",
57
+ "paragraphe",
58
+ "partie",
59
+ "section"
60
+ ];
61
+ var it = [
62
+ "allegato",
63
+ "appendice",
64
+ "articolo",
65
+ "clausola",
66
+ "paragrafo",
67
+ "sezione"
68
+ ];
69
+ var pl = [
70
+ "aneksem",
71
+ "artykuł",
72
+ "paragraf",
73
+ "punkt",
74
+ "sekcja",
75
+ "załącznik"
76
+ ];
77
+ var pt_br = [
78
+ "anexo",
79
+ "artigo",
80
+ "cláusula",
81
+ "parágrafo",
82
+ "seção"
83
+ ];
84
+ var structural_single_cap_prefixes_default = {
85
+ _comment,
86
+ en,
87
+ cs,
88
+ sk,
89
+ de,
90
+ es,
91
+ fr,
92
+ it,
93
+ pl,
94
+ "pt-br": pt_br
95
+ };
96
+ //#endregion
97
+ export { _comment, cs, de, structural_single_cap_prefixes_default as default, en, es, fr, it, pl, pt_br as "pt-br", sk };
98
+
99
+ //# sourceMappingURL=structural-single-cap-prefixes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-single-cap-prefixes.mjs","names":[],"sources":["../src/data/structural-single-cap-prefixes.json"],"sourcesContent":[""],"mappings":""}
@@ -33,7 +33,22 @@ var triggers_en_default = [
33
33
  {
34
34
  "id": "en-jurisdiction",
35
35
  "label": "address",
36
- "strategy": { "type": "to-next-comma" },
36
+ "strategy": {
37
+ "type": "to-next-comma",
38
+ "maxLength": 30,
39
+ "stopWords": [
40
+ "or",
41
+ "and",
42
+ "in",
43
+ "sitting",
44
+ "shall",
45
+ "that",
46
+ "which",
47
+ "without",
48
+ "for",
49
+ "to"
50
+ ]
51
+ },
37
52
  "triggers": [
38
53
  "State of",
39
54
  "Commonwealth of",
@@ -64,6 +79,38 @@ var triggers_en_default = [
64
79
  "tax identification number",
65
80
  "tax id"
66
81
  ]
82
+ },
83
+ {
84
+ "id": "en-uk-companies-house",
85
+ "label": "registration number",
86
+ "strategy": { "type": "company-id-value" },
87
+ "triggers": [
88
+ "Companies House",
89
+ "Company No.",
90
+ "Company No",
91
+ "CRN"
92
+ ],
93
+ "extensions": ["add-colon", "add-colon-space"],
94
+ "validations": [{
95
+ "type": "matches-pattern",
96
+ "pattern": "^(?:SC|NI|OC|SO|R|FC|GE|GS|IC|IP|LP|NC|NF|NL|NO|NP|NR|NZ|RC|SA|SF|SI|SL|SP|SR|SZ)?\\d{6,8}$"
97
+ }]
98
+ },
99
+ {
100
+ "id": "en-uk-utr",
101
+ "label": "tax identification number",
102
+ "strategy": { "type": "company-id-value" },
103
+ "triggers": [
104
+ "UTR",
105
+ "Unique Tax Reference",
106
+ "Unique Taxpayer Reference",
107
+ "Self Assessment UTR"
108
+ ],
109
+ "extensions": ["add-colon", "add-colon-space"],
110
+ "validations": [{
111
+ "type": "matches-pattern",
112
+ "pattern": "^\\d{10}$"
113
+ }]
67
114
  }
68
115
  ];
69
116
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/anonymize",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "Multi-layer PII detection and anonymization pipeline with regex, NER, deny lists, and coreference resolution",
5
5
  "type": "module",
6
6
  "exports": {
@@ -8,6 +8,11 @@
8
8
  "types": "./dist/index.d.mts",
9
9
  "import": "./dist/index.mjs",
10
10
  "default": "./dist/index.mjs"
11
+ },
12
+ "./constants": {
13
+ "types": "./dist/constants.d.mts",
14
+ "import": "./dist/constants.mjs",
15
+ "default": "./dist/constants.mjs"
11
16
  }
12
17
  },
13
18
  "types": "dist/index.d.mts",
@@ -27,6 +32,7 @@
27
32
  "prepublishOnly": "bun run build",
28
33
  "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json && tsc --noEmit -p tsconfig.wasm.json",
29
34
  "test": "bun test --preload ./src/__test__/setup.ts",
35
+ "test:fast": "bun test --preload ./src/__test__/setup.ts src/__test__/*.test.ts",
30
36
  "lint": "prettier --check . --ignore-path ../../.prettierignore",
31
37
  "format": "prettier --write . --ignore-path ../../.prettierignore"
32
38
  },