taraskevizer 5.1.0 → 5.1.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/README.md CHANGED
@@ -1,16 +1,31 @@
1
- ## Install
1
+ # Install
2
+
3
+ With npm:
2
4
 
3
5
  ```bash
4
- $ npm i taraskevizer
6
+ npm install taraskevizer
5
7
  ```
6
8
 
7
- ## Usage
9
+ With yarn:
10
+
11
+ ```bash
12
+ yarn add taraskevizer
13
+ ```
14
+
15
+ With bun:
16
+
17
+ ```bash
18
+ bun add taraskevizer
19
+ ```
20
+
21
+ # Usage
8
22
 
9
23
  ```js
10
24
  import { Taraskevizer, ALPHABET, J, VARIATION } from 'taraskevizer';
11
25
 
12
26
  const taraskevizer = new Taraskevizer();
13
- taraskevizer.convert('планета'); // "плянэта"
27
+ taraskevizer.convert('планета');
28
+ // "плянэта"
14
29
 
15
30
  const taraskevizer = new Taraskevizer({
16
31
  general: {
@@ -23,7 +38,8 @@ const taraskevizer = new Taraskevizer({
23
38
  h: false,
24
39
  },
25
40
  });
26
- taraskevizer.convert('планета і Гродна'); // "пл\x1b[32mя\x1b[0mн\x1b[32mэ\x1b[0mта \x1b[32mй\x1b[0m \x1b[35mГорадня\x1b[0m"
41
+ taraskevizer.convert('планета і Гродна');
42
+ // "пл\x1b[32mя\x1b[0mн\x1b[32mэ\x1b[0mта \x1b[32mй\x1b[0m \x1b[35mГорадня\x1b[0m"
27
43
 
28
44
  const taraskevizer = new Taraskevizer({
29
45
  general: {
@@ -33,14 +49,15 @@ const taraskevizer = new Taraskevizer({
33
49
  g: false, // ignored, because alphabet is set to latin
34
50
  },
35
51
  });
36
- taraskevizer.convertToHtml('энергія планеты'); // "en<tarF>erg</tarF>ija p<tarF>lan</tarF>ety"
52
+ taraskevizer.convertToHtml('энергія планеты');
53
+ // "en<tarF>erg</tarF>ija p<tarF>lan</tarF>ety"
37
54
 
38
55
  // properties can be rewritten after creating an object
39
56
  taraskevizer.abc = ALPHABET.ARABIC;
40
57
  taraskevizer.html.g = true;
41
58
  ```
42
59
 
43
- ### Function signatures are in [this file](./dist/index.d.ts) (not available if project is not built)
60
+ # Options
44
61
 
45
62
  ## general
46
63
 
@@ -86,7 +103,7 @@ Type: `(text: string) => string`
86
103
  Default value: internal function `taraskevize`
87
104
 
88
105
  Can be overridden in order to make additional changes to the text.
89
- This function usually uses private api via `Taraskevizer._.`
106
+ This function usually uses private api via `__tarask__`
90
107
 
91
108
  ## html
92
109
 
@@ -137,9 +154,9 @@ Default value: `0`
137
154
  | 1 | first | Горадня |
138
155
  | 2 | all | (Гродна\|Горадня) |
139
156
 
140
- ## HTML tags
157
+ # HTML tags
141
158
 
142
- ### tarF
159
+ ## tarF
143
160
 
144
161
  Difference between an input and an output word.
145
162
 
@@ -149,7 +166,7 @@ Difference between an input and an output word.
149
166
  пл<tarF>я</tarF>н
150
167
  ```
151
168
 
152
- ### tarL
169
+ ## tarL
153
170
 
154
171
  A part of a word wrapped in this tag is variable,
155
172
  variations are mentioned in a `data-l` attribute
@@ -161,7 +178,7 @@ and are separated by commas
161
178
  <tarL data-l="Горадня">Гродна</tarL>
162
179
  ```
163
180
 
164
- ### tarH
181
+ ## tarH
165
182
 
166
183
  Can be replaced by `ґ`(`g`) letter. appears only if alphabet is cyrillic
167
184
 
@@ -171,7 +188,7 @@ Can be replaced by `ґ`(`g`) letter. appears only if alphabet is cyrillic
171
188
  <tarH>Г</tarH>валт
172
189
  ```
173
190
 
174
- ## Special Syntax
191
+ # Special Syntax
175
192
 
176
193
  | | fix | no fix | change only alphabet |
177
194
  | ----------- | ------------ | ------------ | -------------------- |
@@ -182,14 +199,28 @@ Can be replaced by `ґ`(`g`) letter. appears only if alphabet is cyrillic
182
199
 
183
200
  ## Install
184
201
 
202
+ With npm:
203
+
204
+ ```bash
205
+ npm install -g taraskevizer
206
+ ```
207
+
208
+ With yarn:
209
+
210
+ ```bash
211
+ yarn global add taraskevizer
212
+ ```
213
+
214
+ With bun:
215
+
185
216
  ```bash
186
- $ npm i -g taraskevizer
217
+ bun add -g taraskevizer
187
218
  ```
188
219
 
189
220
  ## Usage
190
221
 
191
222
  ```bash
192
- $ tarask "планета"
223
+ tarask "планета"
193
224
  ```
194
225
 
195
226
  ## Options
package/dist/index.cjs CHANGED
@@ -2203,7 +2203,7 @@ var Taraskevizer = class {
2203
2203
  [replaceWithDict($3.toLowerCase(), letters[abc])],
2204
2204
  [$3]
2205
2205
  );
2206
- noFixArr.push($2 === "." ? $3 : `<${$3}>`);
2206
+ noFixArr.push($2 === "." ? $3 : LEFT_ANGLE_BRACKET + $3 + ">");
2207
2207
  return NOFIX_CHAR;
2208
2208
  }).replace(/г'(?![еёіюя])/g, "ґ").replace(/([\n\t])/g, " $1 ").replace(/ - /g, " — ").replace(new RegExp("(\\p{P}|\\p{S}|\\d)", "gu"), " $1 ").replace(/ ['`’] (?=\S)/g, "ʼ").replace(/\(/g, "&#40");
2209
2209
  let splittedOrig, splitted;
package/dist/index.js CHANGED
@@ -2172,7 +2172,7 @@ var Taraskevizer = class {
2172
2172
  [replaceWithDict($3.toLowerCase(), letters[abc])],
2173
2173
  [$3]
2174
2174
  );
2175
- noFixArr.push($2 === "." ? $3 : `<${$3}>`);
2175
+ noFixArr.push($2 === "." ? $3 : LEFT_ANGLE_BRACKET + $3 + ">");
2176
2176
  return NOFIX_CHAR;
2177
2177
  }).replace(/г'(?![еёіюя])/g, "ґ").replace(/([\n\t])/g, " $1 ").replace(/ - /g, " — ").replace(new RegExp("(\\p{P}|\\p{S}|\\d)", "gu"), " $1 ").replace(/ ['`’] (?=\S)/g, "ʼ").replace(/\(/g, "&#40");
2178
2178
  let splittedOrig, splitted;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taraskevizer",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
4
4
  "author": "GooseOb",
5
5
  "repository": {
6
6
  "type": "git",