shevchenko 3.1.0-alpha.5 → 3.1.0-alpha.6

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.
Files changed (70) hide show
  1. package/dist/cjs/anthroponym-declension/anthroponym-inflector.js +1 -1
  2. package/dist/cjs/anthroponym-declension/bootstrap.js +1 -1
  3. package/dist/cjs/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.js +1 -1
  4. package/dist/cjs/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.js +1 -1
  5. package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-class-transformer.js +1 -1
  6. package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-classifer.js +1 -1
  7. package/dist/cjs/anthroponym-declension/family-name-classifier/model-bundle-loader.js +1 -1
  8. package/dist/cjs/anthroponym-declension/family-name-classifier/model-config.js +1 -1
  9. package/dist/cjs/anthroponym-declension/family-name-classifier/word-transformer.js +1 -1
  10. package/dist/cjs/anthroponym-declension/family-name-inflector.js +1 -1
  11. package/dist/cjs/anthroponym-declension/given-name-inflector.js +1 -1
  12. package/dist/cjs/anthroponym-declension/name-inflector.js +1 -1
  13. package/dist/cjs/anthroponym-declension/patronymic-name-inflector.js +1 -1
  14. package/dist/cjs/extension.js +9 -1
  15. package/dist/cjs/gender-detection/detect-gender.js +1 -1
  16. package/dist/cjs/gender-detection/given-names-genders.json.js +1 -1
  17. package/dist/cjs/index.js +1 -1
  18. package/dist/cjs/input-validation.js +27 -41
  19. package/dist/cjs/language/alphabet.js +1 -1
  20. package/dist/cjs/language/grammatical-case.js +1 -1
  21. package/dist/cjs/language/grammatical-gender.js +1 -1
  22. package/dist/cjs/language/letter-case.js +1 -1
  23. package/dist/cjs/language/linguistics.js +1 -1
  24. package/dist/cjs/language/word-class.js +1 -1
  25. package/dist/cjs/shevchenko.js +1 -1
  26. package/dist/cjs/word-declension/append-command-runner.js +1 -1
  27. package/dist/cjs/word-declension/bootstrap.js +1 -1
  28. package/dist/cjs/word-declension/command-runner-factory.js +1 -1
  29. package/dist/cjs/word-declension/declension-rule-inflector.js +1 -1
  30. package/dist/cjs/word-declension/declension-types.js +1 -1
  31. package/dist/cjs/word-declension/replace-command-runner.js +1 -1
  32. package/dist/cjs/word-declension/rules/artifacts/declension-rules.json.js +1 -1
  33. package/dist/cjs/word-declension/word-inflector.js +1 -1
  34. package/dist/es/anthroponym-declension/anthroponym-inflector.js +1 -1
  35. package/dist/es/anthroponym-declension/bootstrap.js +1 -1
  36. package/dist/es/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.js +1 -1
  37. package/dist/es/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.js +1 -1
  38. package/dist/es/anthroponym-declension/family-name-classifier/family-name-class-transformer.js +1 -1
  39. package/dist/es/anthroponym-declension/family-name-classifier/family-name-classifer.js +1 -1
  40. package/dist/es/anthroponym-declension/family-name-classifier/model-bundle-loader.js +1 -1
  41. package/dist/es/anthroponym-declension/family-name-classifier/model-config.js +1 -1
  42. package/dist/es/anthroponym-declension/family-name-classifier/word-transformer.js +1 -1
  43. package/dist/es/anthroponym-declension/family-name-inflector.js +1 -1
  44. package/dist/es/anthroponym-declension/given-name-inflector.js +1 -1
  45. package/dist/es/anthroponym-declension/name-inflector.js +1 -1
  46. package/dist/es/anthroponym-declension/patronymic-name-inflector.js +1 -1
  47. package/dist/es/extension.d.ts +2 -2
  48. package/dist/es/extension.js +9 -2
  49. package/dist/es/gender-detection/detect-gender.js +1 -1
  50. package/dist/es/gender-detection/given-names-genders.json.js +1 -1
  51. package/dist/es/index.js +1 -1
  52. package/dist/es/input-validation.d.ts +2 -2
  53. package/dist/es/input-validation.js +27 -41
  54. package/dist/es/language/alphabet.js +1 -1
  55. package/dist/es/language/grammatical-case.js +1 -1
  56. package/dist/es/language/grammatical-gender.js +1 -1
  57. package/dist/es/language/letter-case.js +1 -1
  58. package/dist/es/language/linguistics.js +1 -1
  59. package/dist/es/language/word-class.js +1 -1
  60. package/dist/es/shevchenko.js +1 -1
  61. package/dist/es/word-declension/append-command-runner.js +1 -1
  62. package/dist/es/word-declension/bootstrap.js +1 -1
  63. package/dist/es/word-declension/command-runner-factory.js +1 -1
  64. package/dist/es/word-declension/declension-rule-inflector.js +1 -1
  65. package/dist/es/word-declension/declension-types.js +1 -1
  66. package/dist/es/word-declension/replace-command-runner.js +1 -1
  67. package/dist/es/word-declension/rules/artifacts/declension-rules.json.js +1 -1
  68. package/dist/es/word-declension/word-inflector.js +1 -1
  69. package/dist/umd/shevchenko.min.js +89 -89
  70. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -18,6 +18,13 @@ function registerExtension(extensionFactory) {
18
18
  const extension = extensionFactory({ wordInflector: bootstrap.wordInflector });
19
19
  registeredExtensions.push(extension);
20
20
  }
21
+ function getCustomFieldNames() {
22
+ const fieldNames = [];
23
+ for (const extension of registeredExtensions) {
24
+ fieldNames.push(...extension.fieldNames);
25
+ }
26
+ return fieldNames;
27
+ }
21
28
  async function afterInflect(grammaticalCase, input) {
22
29
  var _a;
23
30
  const output = {};
@@ -31,4 +38,5 @@ async function afterInflect(grammaticalCase, input) {
31
38
  }
32
39
 
33
40
  exports.afterInflect = afterInflect;
41
+ exports.getCustomFieldNames = getCustomFieldNames;
34
42
  exports.registerExtension = registerExtension;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -11,6 +11,7 @@
11
11
 
12
12
  Object.defineProperty(exports, '__esModule', { value: true });
13
13
 
14
+ var extension = require('./extension.js');
14
15
  require('./language/alphabet.js');
15
16
  require('./language/word-class.js');
16
17
  require('./language/grammatical-case.js');
@@ -18,31 +19,30 @@ var grammaticalGender = require('./language/grammatical-gender.js');
18
19
 
19
20
  class InputValidationError extends TypeError {
20
21
  }
22
+ const fieldNames = ['givenName', 'patronymicName', 'familyName'];
21
23
  /**
22
24
  * Validates if a given value is a valid input for declension.
23
25
  *
24
26
  * @throws {InputValidationError}
25
27
  */
26
- function validateDeclensionInput(value) {
27
- if (!isObject(value)) {
28
+ function validateDeclensionInput(input) {
29
+ if (!isObject(input)) {
28
30
  throw new InputValidationError('The input type must be an object.');
29
31
  }
30
- if (!isIn(value.gender, Object.values(grammaticalGender.GrammaticalGender))) {
31
- throw new InputValidationError(`The "gender" parameter must be one of the following: "${grammaticalGender.GrammaticalGender.MASCULINE}", "${grammaticalGender.GrammaticalGender.FEMININE}".`);
32
+ const isGenderValid = Object.values(grammaticalGender.GrammaticalGender).includes(input.gender);
33
+ if (!isGenderValid) {
34
+ throw new InputValidationError(`The "gender" parameter must be one of the following:` +
35
+ ` "${Object.values(grammaticalGender.GrammaticalGender).join('", "')}".`);
32
36
  }
33
- if (!isDefined(value.givenName) &&
34
- !isDefined(value.patronymicName) &&
35
- !isDefined(value.familyName)) {
36
- throw new InputValidationError('At least one of the following parameters must present: "givenName", "patronymicName", "familyName".');
37
+ const mergedFieldNames = [...fieldNames, ...extension.getCustomFieldNames()];
38
+ const hasFields = mergedFieldNames.some((fieldName) => fieldName in input && typeof input[fieldName] !== 'undefined');
39
+ if (!hasFields) {
40
+ throw new InputValidationError(`At least one of the following parameters must present: "${mergedFieldNames.join('", "')}".`);
37
41
  }
38
- if (isDefined(value.givenName) && !isString(value.givenName)) {
39
- throw new InputValidationError('The "givenName" parameter must be a string.');
40
- }
41
- if (isDefined(value.patronymicName) && !isString(value.patronymicName)) {
42
- throw new InputValidationError('The "patronymicName" parameter must be a string.');
43
- }
44
- if (isDefined(value.familyName) && !isString(value.familyName)) {
45
- throw new InputValidationError('The "familyName" parameter must be a string.');
42
+ for (const fieldName of mergedFieldNames) {
43
+ if (fieldName in input && typeof input[fieldName] !== 'string') {
44
+ throw new InputValidationError(`The "${fieldName}" parameter must be a string.`);
45
+ }
46
46
  }
47
47
  }
48
48
  /**
@@ -50,36 +50,22 @@ function validateDeclensionInput(value) {
50
50
  *
51
51
  * @throws {InputValidationError}
52
52
  */
53
- function validateGenderDetectionInput(value) {
54
- if (!isObject(value)) {
53
+ function validateGenderDetectionInput(input) {
54
+ if (!isObject(input)) {
55
55
  throw new InputValidationError('The input type must be an object.');
56
56
  }
57
- if (!isDefined(value.givenName) &&
58
- !isDefined(value.patronymicName) &&
59
- !isDefined(value.familyName)) {
60
- throw new InputValidationError('At least one of the following parameters must present: "givenName", "patronymicName", "familyName".');
61
- }
62
- if (isDefined(value.givenName) && !isString(value.givenName)) {
63
- throw new InputValidationError('The "givenName" parameter must be a string.');
64
- }
65
- if (isDefined(value.patronymicName) && !isString(value.patronymicName)) {
66
- throw new InputValidationError('The "patronymicName" parameter must be a string.');
57
+ const hasFields = fieldNames.some((fieldName) => fieldName in input && typeof input[fieldName] !== 'undefined');
58
+ if (!hasFields) {
59
+ throw new InputValidationError(`At least one of the following parameters must present: "${fieldNames.join('", "')}".`);
67
60
  }
68
- if (isDefined(value.familyName) && !isString(value.familyName)) {
69
- throw new InputValidationError('The "familyName" parameter must be a string.');
61
+ for (const fieldName of fieldNames) {
62
+ if (fieldName in input && typeof input[fieldName] !== 'string') {
63
+ throw new InputValidationError(`The "${fieldName}" parameter must be a string.`);
64
+ }
70
65
  }
71
66
  }
72
- function isDefined(value) {
73
- return typeof value !== 'undefined';
74
- }
75
67
  function isObject(value) {
76
- return value != null && typeof value === 'object';
77
- }
78
- function isString(value) {
79
- return typeof value === 'string';
80
- }
81
- function isIn(value, values) {
82
- return values.includes(value);
68
+ return typeof value === 'object' && value != null;
83
69
  }
84
70
 
85
71
  exports.InputValidationError = InputValidationError;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  import { DeclensionInput, DeclensionOutput } from './contracts';
2
2
  import { GrammaticalCase } from './language';
3
3
  import { WordInflector } from './word-declension';
4
- type FieldName = keyof Omit<DeclensionInput, 'gender'>;
4
+ export type FieldName = keyof Omit<DeclensionInput, 'gender'>;
5
5
  export type AfterInflectHook = <T extends DeclensionInput>(grammaticalCase: GrammaticalCase, input: T) => Promise<DeclensionOutput<T>>;
6
6
  export type ShevchenkoExtension = {
7
7
  fieldNames: FieldName[];
@@ -12,5 +12,5 @@ export type ExtensionContext = {
12
12
  wordInflector: WordInflector;
13
13
  };
14
14
  export declare function registerExtension(extensionFactory: ExtensionFactory): void;
15
+ export declare function getCustomFieldNames(): FieldName[];
15
16
  export declare function afterInflect<T extends DeclensionInput>(grammaticalCase: GrammaticalCase, input: T): Promise<DeclensionOutput<T>>;
16
- export {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.0-alpha.4
4
+ * @version 3.1.0-alpha.6
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -14,6 +14,13 @@ function registerExtension(extensionFactory) {
14
14
  const extension = extensionFactory({ wordInflector });
15
15
  registeredExtensions.push(extension);
16
16
  }
17
+ function getCustomFieldNames() {
18
+ const fieldNames = [];
19
+ for (const extension of registeredExtensions) {
20
+ fieldNames.push(...extension.fieldNames);
21
+ }
22
+ return fieldNames;
23
+ }
17
24
  async function afterInflect(grammaticalCase, input) {
18
25
  var _a;
19
26
  const output = {};
@@ -26,4 +33,4 @@ async function afterInflect(grammaticalCase, input) {
26
33
  return output;
27
34
  }
28
35
 
29
- export { afterInflect, registerExtension };
36
+ export { afterInflect, getCustomFieldNames, registerExtension };