type and function for getting the entry from FullEntry form

This commit is contained in:
adueck 2022-11-09 13:49:54 +05:00
parent eb271bf08b
commit 5805ee423b
7 changed files with 14 additions and 5 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.1.9", "version": "5.1.10",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.1.9", "version": "5.1.10",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "pashto-inflector", "name": "pashto-inflector",
"version": "5.1.9", "version": "5.1.10",
"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",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/ps-react", "name": "@lingdocs/ps-react",
"version": "5.1.9", "version": "5.1.10",
"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",

View File

@ -105,6 +105,7 @@ import {
blank, blank,
kidsBlank, kidsBlank,
ensureNonComboVerbInfo, ensureNonComboVerbInfo,
entryOfFull,
} from "./src/misc-helpers"; } from "./src/misc-helpers";
import { import {
simplifyPhonetics, simplifyPhonetics,
@ -237,6 +238,7 @@ export {
kidsBlank, kidsBlank,
isPashtoScript, isPashtoScript,
getInflectionPattern, getInflectionPattern,
entryOfFull,
// protobuf helpers // protobuf helpers
readDictionary, readDictionary,
writeDictionary, writeDictionary,

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/inflect", "name": "@lingdocs/inflect",
"version": "5.1.9", "version": "5.1.10",
"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",

View File

@ -14,6 +14,10 @@ export const blank: T.PsString = {
}; };
export const kidsBlank: T.PsString = { p: "___", f: "___" }; export const kidsBlank: T.PsString = { p: "___", f: "___" };
export function entryOfFull(e: T.FullEntry): T.DictionaryEntry {
return "entry" in e ? e.entry : e;
}
// just for type safety // just for type safety
export function noPersInfs(s: T.OptionalPersonInflections<T.LengthOptions<T.PsString>>): T.LengthOptions<T.PsString>; export function noPersInfs(s: T.OptionalPersonInflections<T.LengthOptions<T.PsString>>): T.LengthOptions<T.PsString>;
export function noPersInfs(s: T.FullForm<T.PsString>): T.SingleOrLengthOpts<T.PsString>; export function noPersInfs(s: T.FullForm<T.PsString>): T.SingleOrLengthOpts<T.PsString>;

View File

@ -500,6 +500,9 @@ export type VerbEntry = {
complement?: DictionaryEntry, complement?: DictionaryEntry,
}; };
/** A dictionary entry that will include the complement / verb entry structure if it's a verb */
export type FullEntry = VerbEntry | DictionaryEntry;
export enum InflectionPattern { export enum InflectionPattern {
None = 0, None = 0,
Basic = 1, Basic = 1,