Skip to content

Migration Guide

Oleksandr Tolochko edited this page Mar 11, 2023 · 2 revisions

Migration v2 → v3

This section describes the breaking changes required to migrate to v3.

Changes to declension functions

All declension functions are now asynchronous and return the inflected form as a Promise.

Before

shevchenko.inVocative(input); // { gender: "male", firstName: "Тарасе", middleName: "Григоровичу", lastName: "Шевченку" }

After

shevchenko.inVocative(input); // Promise<{ givenName: "Тарасе", patronymicName: "Григоровичу", familyName: "Шевченку" }>

Changes to grammatical gender values

Grammatical gender values have been renamed according to grammatical categories.

Before

shevchenko.Gender.Male;   // 'male'
shevchenko.Gender.Female; // 'female'

After

shevchenko.GrammaticalGender.MASCULINE; // 'masculine'
shevchenko.GrammaticalGender.FEMININE;  // 'feminine'

Changes to anthroponym field names

Name fields have been renamed for better alignment with their Ukrainian counterparts.

Before

const anthroponym = {
  firstName: 'Тарас',
  middleName: 'Григорович',
  lastName: 'Шевченко',
};

After

const anthroponym = {
  givenName: 'Тарас',
  patronymicName: 'Григорович',
  familyName: 'Шевченко'
};