@ipfy/homoglyph 1.0.0
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/LICENSE +21 -0
- package/NOTICE +45 -0
- package/README.md +143 -0
- package/dist/homoglyph.js +867 -0
- package/dist/homoglyph.min.js +1 -0
- package/dist/index.cjs +898 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +867 -0
- package/package.json +69 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface HomoglyphCharacter {
|
|
2
|
+
char: string;
|
|
3
|
+
index: number;
|
|
4
|
+
prototype: string;
|
|
5
|
+
script: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface HomoglyphFinding {
|
|
9
|
+
type: string;
|
|
10
|
+
label: string | null;
|
|
11
|
+
scripts: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface HomoglyphResult {
|
|
15
|
+
detected: boolean;
|
|
16
|
+
rejectable: boolean;
|
|
17
|
+
input: string | null;
|
|
18
|
+
valueType:
|
|
19
|
+
| "empty"
|
|
20
|
+
| "non-string"
|
|
21
|
+
| "domain"
|
|
22
|
+
| "email"
|
|
23
|
+
| "url"
|
|
24
|
+
| "unparsed";
|
|
25
|
+
source: "domain" | "email" | "url" | null;
|
|
26
|
+
domain: string | null;
|
|
27
|
+
asciiName: string | null;
|
|
28
|
+
reason: string | null;
|
|
29
|
+
scripts: string[];
|
|
30
|
+
characters: HomoglyphCharacter[];
|
|
31
|
+
findings: HomoglyphFinding[];
|
|
32
|
+
unicodeVersion: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const UNICODE_VERSION: string;
|
|
36
|
+
export const METADATA_FIELD: string;
|
|
37
|
+
|
|
38
|
+
export function detect(value: unknown): HomoglyphResult;
|
|
39
|
+
export function warn(input: unknown): HomoglyphResult;
|
|
40
|
+
export function reject(input: unknown): HomoglyphResult;
|
|
41
|
+
|
|
42
|
+
export interface HomoglyphAPI {
|
|
43
|
+
detect(value: unknown): HomoglyphResult;
|
|
44
|
+
warn(input: unknown): HomoglyphResult;
|
|
45
|
+
reject(input: unknown): HomoglyphResult;
|
|
46
|
+
unicodeVersion: string;
|
|
47
|
+
metadataField: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare const Homoglyph: HomoglyphAPI;
|
|
51
|
+
export default Homoglyph;
|