source: frontend/node_modules/tr46/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.1 KB
Line 
1# tr46
2
3An JavaScript implementation of [Unicode Technical Standard #46: Unicode IDNA Compatibility Processing](https://unicode.org/reports/tr46/).
4
5
6## Installation
7
8[Node.js](http://nodejs.org) ≥ 8 is required. To install, type this at the command line:
9```shell
10npm install tr46
11# or
12yarn add tr46
13```
14
15
16## API
17
18### `toASCII(domainName[, options])`
19
20Converts a string of Unicode symbols to a case-folded Punycode string of ASCII symbols.
21
22Available options:
23* [`checkBidi`](#checkBidi)
24* [`checkHyphens`](#checkHyphens)
25* [`checkJoiners`](#checkJoiners)
26* [`processingOption`](#processingOption)
27* [`useSTD3ASCIIRules`](#useSTD3ASCIIRules)
28* [`verifyDNSLength`](#verifyDNSLength)
29
30### `toUnicode(domainName[, options])`
31
32Converts a case-folded Punycode string of ASCII symbols to a string of Unicode symbols.
33
34Available options:
35* [`checkBidi`](#checkBidi)
36* [`checkHyphens`](#checkHyphens)
37* [`checkJoiners`](#checkJoiners)
38* [`processingOption`](#processingOption)
39* [`useSTD3ASCIIRules`](#useSTD3ASCIIRules)
40
41
42## Options
43
44### `checkBidi`
45Type: `Boolean`
46Default value: `false`
47When set to `true`, any bi-directional text within the input will be checked for validation.
48
49### `checkHyphens`
50Type: `Boolean`
51Default value: `false`
52When set to `true`, the positions of any hyphen characters within the input will be checked for validation.
53
54### `checkJoiners`
55Type: `Boolean`
56Default value: `false`
57When set to `true`, any word joiner characters within the input will be checked for validation.
58
59### `processingOption`
60Type: `String`
61Default value: `"nontransitional"`
62When set to `"transitional"`, symbols within the input will be validated according to the older IDNA2003 protocol. When set to `"nontransitional"`, the current IDNA2008 protocol will be used.
63
64### `useSTD3ASCIIRules`
65Type: `Boolean`
66Default value: `false`
67When set to `true`, input will be validated according to [STD3 Rules](http://unicode.org/reports/tr46/#STD3_Rules).
68
69### `verifyDNSLength`
70Type: `Boolean`
71Default value: `false`
72When set to `true`, the length of each DNS label within the input will be checked for validation.
Note: See TracBrowser for help on using the repository browser.