From edeffc3c6a562a35bd58c7b331f5d366f68d5bd2 Mon Sep 17 00:00:00 2001 From: adueck Date: Sat, 14 Jan 2023 18:50:43 +0500 Subject: [PATCH] more flexible concatPsString --- package-lock.json | 4 ++-- package.json | 2 +- src/components/package.json | 2 +- src/lib/package.json | 2 +- src/lib/src/p-text-helpers.test.ts | 1 + src/lib/src/p-text-helpers.ts | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a7c0d8..50447d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pashto-inflector", - "version": "5.4.0", + "version": "5.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pashto-inflector", - "version": "5.4.0", + "version": "5.4.1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 978e3e2..87a8588 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pashto-inflector", - "version": "5.4.0", + "version": "5.4.1", "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", diff --git a/src/components/package.json b/src/components/package.json index 872199b..ab6a8c7 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/ps-react", - "version": "5.4.0", + "version": "5.4.1", "description": "Pashto inflector library module with React components", "main": "dist/components/library.js", "module": "dist/components/library.js", diff --git a/src/lib/package.json b/src/lib/package.json index fba2bdb..1e51aa5 100644 --- a/src/lib/package.json +++ b/src/lib/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/inflect", - "version": "5.4.0", + "version": "5.4.1", "description": "Pashto inflector library", "main": "dist/index.js", "types": "dist/lib/library.d.ts", diff --git a/src/lib/src/p-text-helpers.test.ts b/src/lib/src/p-text-helpers.test.ts index 5c89ce7..bdfd775 100644 --- a/src/lib/src/p-text-helpers.test.ts +++ b/src/lib/src/p-text-helpers.test.ts @@ -33,6 +33,7 @@ import { test(`concatPsString should work`, () => { const input = concatPsString( { p: "لیکل", f: "leekul" }, + undefined, { p: "ی", f: "ey" }, " ", { p: "دی", f: "dey" }, diff --git a/src/lib/src/p-text-helpers.ts b/src/lib/src/p-text-helpers.ts index fc58c1e..0ecff65 100644 --- a/src/lib/src/p-text-helpers.ts +++ b/src/lib/src/p-text-helpers.ts @@ -54,7 +54,7 @@ export function concatPsString(...items: Array)[]; - const hasLengthOptions = itemsWOutPersInfs.some((x) => (typeof x !== "string") && ("long" in x)); + const hasLengthOptions = itemsWOutPersInfs.some((x) => x && (typeof x !== "string") && ("long" in x)); if (hasLengthOptions) { const forceLength = ( arr: Array | string | undefined>,