taraskevizer 9.2.1 → 9.2.3

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/bin.js CHANGED
@@ -1,61 +1,60 @@
1
1
  #!/usr/bin/env node
2
2
  import { dicts, TaraskConfig, tarask, pipelines, htmlConfigOptions, wrappers, } from './index.js';
3
- const prefix = '\x1b[34m[taraskevizer]\x1b[0m ';
4
3
  const printWithPrefix = (msg) => {
5
- process.stdout.write(prefix + msg + '\n');
4
+ process.stdout.write("[taraskevizer]" + msg + '\n');
6
5
  };
7
6
  process.argv.splice(0, 2);
8
7
  const checkForOptions = (options) => process.argv[0] && options.includes(process.argv[0].toLowerCase());
9
8
  if (checkForOptions(['-v', '--version'])) {
10
- printWithPrefix("9.2.1");
9
+ printWithPrefix("9.2.3");
11
10
  process.exit(0);
12
11
  }
13
12
  if (checkForOptions(['-h', '--help'])) {
14
- printWithPrefix(`Usage: tarask [options] text
13
+ printWithPrefix(`Usage: tarask [options] text
15
14
  If text is not passed, interactive mode will be enabled
16
15
 
17
16
  EXAMPLES
18
17
 
19
18
  Convert and latinize a word
20
- tarask --latin 'планета'
21
- Will print "p<fix>l</fix>a<fix>ne</fix>ta"
19
+ tarask --latin 'планета'
20
+ Will print "planeta"
22
21
 
23
22
  Read from one file and write converted text to another
24
- tarask < ./cyr-text.txt > ./lat-text.txt
23
+ tarask < ./cyr-text.txt > ./lat-text.txt
25
24
 
26
25
  Enter interactive mode
27
- tarask
28
- Will print "[taraskevizer] Enter the text:" and wait until you press Enter
26
+ tarask
27
+ Will print "[taraskevizer] Enter the text:" and wait until you press Enter
29
28
 
30
29
  OPTIONS
31
30
 
32
- General:
33
- -h --help
34
- -v --version
31
+ General:
32
+ -h --help
33
+ -v --version
35
34
 
36
- Alphabet:
37
- -l --latin
38
- -lj --latin-ji
39
- -a --arabic
35
+ Alphabet:
36
+ -l --latin
37
+ -lj --latin-ji
38
+ -a --arabic
40
39
 
41
- When to replace і(i) by й(j) after vowels:
42
- -jr --jrandom
43
- -ja --jalways
40
+ When to replace і(i) by й(j) after vowels:
41
+ -jr --jrandom
42
+ -ja --jalways
44
43
 
45
- Replace ґ(g) by г(h) in cyrillic alphabet:
46
- --h
44
+ Replace ґ(g) by г(h) in cyrillic alphabet:
45
+ --h
47
46
 
48
- Variations:
49
- -nv --no-variations
50
- -fv --first-variation
47
+ Variations:
48
+ -nv --no-variations
49
+ -fv --first-variation
51
50
 
52
- Mode (only one can be used):
53
- -html --html
54
- -abc --alphabet-only
51
+ Mode (only one can be used):
52
+ -html --html
53
+ -abc --alphabet-only
55
54
 
56
- Other:
57
- -nec --not-escape-caps
58
- -nc --no-color
55
+ Other:
56
+ -nec --not-escape-caps
57
+ -nc --no-color
59
58
  `);
60
59
  process.exit(0);
61
60
  }
@@ -1,16 +1,16 @@
1
1
  /**
2
- * A pipeline in Taraskevizer is basically
3
- * an array of steps of type {@link steps.TaraskStep}.
2
+ * You can use builtin pipelines from this module or create your own.
4
3
  *
5
- * You can use pre-made pipelines from this module or create your own.
6
- *
7
- * If you want to create a pipeline based on a pre-made one
4
+ * If you want to create a pipeline based on a builtin one
8
5
  * and do it more safely, it's recommended to use
9
6
  * `.map` if you need replacing only or
10
7
  * `.flatMap` if you also need to add or remove steps.
11
8
  *
12
9
  * This way you will depend less on the
13
- * internal structure of the pre-made pipeline.
10
+ * internal structure of the builtin pipeline.
11
+ *
12
+ * For cases when you need to replace only {@link steps.taraskevize} in {@link tar}
13
+ * and have better tree-shaking, you can use {@link _createPipeline}.
14
14
  *
15
15
  * @module
16
16
  */
@@ -21,6 +21,7 @@ import { type TaraskStep } from './steps';
21
21
  type AbcOnlyStorage = {
22
22
  doEscapeCapitalized: boolean;
23
23
  };
24
+ export type Pipeline = TaraskStep<any>[];
24
25
  /**
25
26
  * Pipeline for changing only the alphabet.
26
27
  *
@@ -38,9 +39,9 @@ export declare const abc: (TaraskStep<import("./steps").SpecialSyntaxStorage> |
38
39
  *
39
40
  * Used by {@link tar} and {@link phonetic}.
40
41
  *
41
- * @param steps - Steps used instead of [{@link steps.taraskevize}].
42
+ * @param subPipeline - Steps used instead of [{@link subPipeline.taraskevize}].
42
43
  */
43
- export declare const _createPipeline: (steps: TaraskStep<any>[]) => (TaraskStep<import("./steps").SplittedTextStorage> | TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage> | TaraskStep<import("./steps").TrimStorage>)[];
44
+ export declare const _createPipeline: (subPipeline: Pipeline) => (TaraskStep<import("./steps").SplittedTextStorage> | TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage> | TaraskStep<import("./steps").TrimStorage>)[];
44
45
  /**
45
46
  * Pipeline for taraskevizing.
46
47
  */
package/dist/pipelines.js CHANGED
@@ -20,14 +20,14 @@ export const abc = [
20
20
  }),
21
21
  ];
22
22
 
23
- export const _createPipeline = (steps) => [
23
+ export const _createPipeline = (subPipeline) => [
24
24
  trim,
25
25
  resolveSpecialSyntax,
26
26
  prepare,
27
27
  whitespacesToSpaces,
28
28
  storeSplittedAbcConvertedOrig,
29
29
  toLowerCase,
30
- ...steps,
30
+ ...subPipeline,
31
31
  replaceIbyJ,
32
32
  convertAlphabetLowerCase,
33
33
  storeSplittedText,
package/dist/tarask.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TaraskConfig } from './config';
2
- import type { TaraskStep } from './steps';
2
+ import type { Pipeline } from './pipelines';
3
3
  /**
4
4
  * @returns converted text
5
5
  *
@@ -7,4 +7,4 @@ import type { TaraskStep } from './steps';
7
7
  * tarask("планета", pipelines.tar);
8
8
  * // "плянэта"
9
9
  */
10
- export declare const tarask: (text: string, pipeline: TaraskStep<any>[], cfg?: Readonly<TaraskConfig>) => string;
10
+ export declare const tarask: (text: string, pipeline: Pipeline, cfg?: Readonly<TaraskConfig>) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taraskevizer",
3
- "version": "9.2.1",
3
+ "version": "9.2.3",
4
4
  "author": "GooseOb",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,12 +10,12 @@
10
10
  "module": "dist/index.js",
11
11
  "devDependencies": {
12
12
  "@digitak/esrun": "^3.2.26",
13
- "@types/node": "^20.16.5",
14
- "bun-types": "^1.1.27",
13
+ "@types/node": "^20.16.11",
14
+ "bun-types": "^1.1.30",
15
15
  "husky": "^9.1.6",
16
16
  "prettier": "^3.3.3",
17
- "typedoc": "^0.26.7",
18
- "typescript": "^5.6.2"
17
+ "typedoc": "^0.26.9",
18
+ "typescript": "^5.6.3"
19
19
  },
20
20
  "bin": {
21
21
  "tarask": "dist/bin.js"