more flexible concatPsString
This commit is contained in:
parent
61c4ab8bc7
commit
edeffc3c6a
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "pashto-inflector",
|
"name": "pashto-inflector",
|
||||||
"version": "5.4.0",
|
"version": "5.4.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pashto-inflector",
|
"name": "pashto-inflector",
|
||||||
"version": "5.4.0",
|
"version": "5.4.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "pashto-inflector",
|
"name": "pashto-inflector",
|
||||||
"version": "5.4.0",
|
"version": "5.4.1",
|
||||||
"author": "lingdocs.com",
|
"author": "lingdocs.com",
|
||||||
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
|
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
|
||||||
"homepage": "https://verbs.lingdocs.com",
|
"homepage": "https://verbs.lingdocs.com",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lingdocs/ps-react",
|
"name": "@lingdocs/ps-react",
|
||||||
"version": "5.4.0",
|
"version": "5.4.1",
|
||||||
"description": "Pashto inflector library module with React components",
|
"description": "Pashto inflector library module with React components",
|
||||||
"main": "dist/components/library.js",
|
"main": "dist/components/library.js",
|
||||||
"module": "dist/components/library.js",
|
"module": "dist/components/library.js",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lingdocs/inflect",
|
"name": "@lingdocs/inflect",
|
||||||
"version": "5.4.0",
|
"version": "5.4.1",
|
||||||
"description": "Pashto inflector library",
|
"description": "Pashto inflector library",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/lib/library.d.ts",
|
"types": "dist/lib/library.d.ts",
|
||||||
|
|
|
@ -33,6 +33,7 @@ import {
|
||||||
test(`concatPsString should work`, () => {
|
test(`concatPsString should work`, () => {
|
||||||
const input = concatPsString(
|
const input = concatPsString(
|
||||||
{ p: "لیکل", f: "leekul" },
|
{ p: "لیکل", f: "leekul" },
|
||||||
|
undefined,
|
||||||
{ p: "ی", f: "ey" },
|
{ p: "ی", f: "ey" },
|
||||||
" ",
|
" ",
|
||||||
{ p: "دی", f: "dey" },
|
{ p: "دی", f: "dey" },
|
||||||
|
|
|
@ -54,7 +54,7 @@ export function concatPsString(...items: Array<T.PsString | T.LengthOptions<T.Ps
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const itemsWOutPersInfs = items as (string | T.SingleOrLengthOpts<T.PsString>)[];
|
const itemsWOutPersInfs = items as (string | T.SingleOrLengthOpts<T.PsString>)[];
|
||||||
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) {
|
if (hasLengthOptions) {
|
||||||
const forceLength = (
|
const forceLength = (
|
||||||
arr: Array<T.SingleOrLengthOpts<T.PsString> | string | undefined>,
|
arr: Array<T.SingleOrLengthOpts<T.PsString> | string | undefined>,
|
||||||
|
|
Loading…
Reference in New Issue