taraskevizer 1.1.0 → 1.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/dist/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ type Promisify<T> = T extends (...args: infer TArgs) => infer TReturn ? (...args: TArgs) => Promise<TReturn> : never;
2
+ type DeepPartial<T> = T extends object ? {
3
+ [P in keyof T]?: DeepPartial<T[P]>;
4
+ } : T;
1
5
  type Alphabet = 0 | 1 | 2;
2
6
  type J = 0 | 1 | 2;
3
7
  type HtmlOptions = {
@@ -8,8 +12,7 @@ type TaraskOptions = {
8
12
  j: J;
9
13
  html: false | HtmlOptions;
10
14
  };
11
- type Promisify<T> = T extends (...args: infer TArgs) => infer TReturn ? (...args: TArgs) => Promise<TReturn> : never;
12
- type Tarask = (text: string, options?: TaraskOptions) => string;
15
+ type Tarask = (text: string, options?: DeepPartial<TaraskOptions>) => string;
13
16
  type TaraskAsync = Promisify<Tarask>;
14
17
  type Dict = Record<string, RegExp>;
15
18
  type AlphabetDependentDict = {
package/dist/index.js CHANGED
@@ -1323,8 +1323,7 @@ var rawWordlist = {
1323
1323
  "($&|акмяны)": /акмяне(?= )/,
1324
1324
  "($&|аліта)": /аліўтс(?= )/,
1325
1325
  "($&|анікшты)": /анікшчэй(?= )/,
1326
- "($&|араны)": /варэны(?= )/,
1327
- " (варэн|аран)": / варэн/,
1326
+ " (варэ|ара)": / варэ(?=н(ы|а[мх]|амі) )/,
1328
1327
  // '($&|белая вака)':/балтайі воке(?= )/,
1329
1328
  "($&|біржы)": /біржай(?= )/,
1330
1329
  "($&|бірштаны)": /бірштанас(?= )/,
@@ -1998,6 +1997,9 @@ var additionalReplacements = {
1998
1997
  };
1999
1998
  var taraskSync = (text, options) => {
2000
1999
  const { abc = 0, j = 0, html = false } = options || {};
2000
+ if (typeof html === "object") {
2001
+ html.g || (html.g = false);
2002
+ }
2001
2003
  const noFix = [];
2002
2004
  const LEFT_ANGLE_BRACKET = html ? "&lt;" : "<";
2003
2005
  text = ` ${text.trim()} `.replace(/<([,.]?)((?:.|\s)*?)>/g, ($0, $1, $2) => {
package/dist/index.mjs CHANGED
@@ -1296,8 +1296,7 @@ var rawWordlist = {
1296
1296
  "($&|акмяны)": /акмяне(?= )/,
1297
1297
  "($&|аліта)": /аліўтс(?= )/,
1298
1298
  "($&|анікшты)": /анікшчэй(?= )/,
1299
- "($&|араны)": /варэны(?= )/,
1300
- " (варэн|аран)": / варэн/,
1299
+ " (варэ|ара)": / варэ(?=н(ы|а[мх]|амі) )/,
1301
1300
  // '($&|белая вака)':/балтайі воке(?= )/,
1302
1301
  "($&|біржы)": /біржай(?= )/,
1303
1302
  "($&|бірштаны)": /бірштанас(?= )/,
@@ -1971,6 +1970,9 @@ var additionalReplacements = {
1971
1970
  };
1972
1971
  var taraskSync = (text, options) => {
1973
1972
  const { abc = 0, j = 0, html = false } = options || {};
1973
+ if (typeof html === "object") {
1974
+ html.g || (html.g = false);
1975
+ }
1974
1976
  const noFix = [];
1975
1977
  const LEFT_ANGLE_BRACKET = html ? "&lt;" : "<";
1976
1978
  text = ` ${text.trim()} `.replace(/<([,.]?)((?:.|\s)*?)>/g, ($0, $1, $2) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "taraskevizer",
3
3
  "author": "GooseOb",
4
4
  "license": "MIT",
5
- "version": "1.1.0",
5
+ "version": "1.1.2",
6
6
  "private": false,
7
7
  "homepage": "https://gooseob.github.io/taraskevizatar/",
8
8
  "main": "dist/index.js",
@@ -14,6 +14,7 @@
14
14
  ],
15
15
  "scripts": {
16
16
  "build": "tsup --config build-config/index.js",
17
+ "dev:build": "tsup --config build-config/dev.js && npm run test",
17
18
  "test": "node test",
18
19
  "prepare": "husky install"
19
20
  },
@@ -29,7 +30,6 @@
29
30
  "belarusian"
30
31
  ],
31
32
  "devDependencies": {
32
- "@digitak/esrun": "^3.2.24",
33
33
  "husky": "^8.0.3",
34
34
  "prettier": "^3.0.0",
35
35
  "tsup": "^6.5.0",