things passed to remove accents were stripping out anything other than the ps

This commit is contained in:
lingdocs 2022-03-25 16:00:29 +05:00
parent 02d20e8c00
commit 54a8f602f3
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@lingdocs/pashto-inflector",
"version": "1.5.4",
"version": "1.5.5",
"author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com",

View File

@ -112,10 +112,10 @@ export function removeAccents(s: T.PsString): T.PsString;
export function removeAccents(s: string): string;
export function removeAccents(s: T.PsString | string): T.PsString | string {
if (typeof s !== "string") {
return makePsString(
s.p,
removeAccents(s.f),
);
return {
...s,
f: removeAccents(s.f),
};
}
return s.replace(/á|é|í|ó|ú|Ú/, (match) => {
const r = accentReplacer.find((x) => x.accented === match);