less redundancy using as const
This commit is contained in:
parent
13fdbf8201
commit
1ebe2256da
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "pashto-inflector",
|
||||
"version": "5.8.3",
|
||||
"version": "5.8.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "pashto-inflector",
|
||||
"version": "5.8.3",
|
||||
"version": "5.8.4",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "pashto-inflector",
|
||||
"version": "5.8.3",
|
||||
"version": "5.8.4",
|
||||
"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",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lingdocs/ps-react",
|
||||
"version": "5.8.3",
|
||||
"version": "5.8.4",
|
||||
"description": "Pashto inflector library module with React components",
|
||||
"main": "dist/components/library.js",
|
||||
"module": "dist/components/library.js",
|
||||
|
|
|
@ -72,7 +72,7 @@ import {
|
|||
dictionaryEntryBooleanFields,
|
||||
dictionaryEntryNumberFields,
|
||||
dictionaryEntryTextFields,
|
||||
} from "./src/fields";
|
||||
} from "../types";
|
||||
import {
|
||||
validateEntry,
|
||||
standardizeEntry,
|
||||
|
@ -162,7 +162,7 @@ import {
|
|||
import shuffleArray from "./src/shuffle-array";
|
||||
import defaultTextOptions from "./src/default-text-options";
|
||||
import * as grammarUnits from "./src/grammar-units";
|
||||
import * as Types from "../types";
|
||||
import type * as Types from "../types";
|
||||
import * as typePredicates from "./src/type-predicates";
|
||||
import * as blockUtils from "./src/phrase-building/blocks-utils";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lingdocs/inflect",
|
||||
"version": "5.8.3",
|
||||
"version": "5.8.4",
|
||||
"description": "Pashto inflector library",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/lib/library.d.ts",
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
import * as T from "../../types";
|
||||
|
||||
export const dictionaryEntryTextFields: T.DictionaryEntryTextField[] = [
|
||||
"p",
|
||||
"f",
|
||||
"e",
|
||||
"c",
|
||||
"infap",
|
||||
"infaf",
|
||||
"infbp",
|
||||
"infbf",
|
||||
"app",
|
||||
"apf",
|
||||
"ppp",
|
||||
"ppf",
|
||||
"psp",
|
||||
"psf",
|
||||
"ssp",
|
||||
"ssf",
|
||||
"prp",
|
||||
"prf",
|
||||
"pprtp",
|
||||
"pprtf",
|
||||
"tppp",
|
||||
"tppf",
|
||||
"ec",
|
||||
"ep",
|
||||
];
|
||||
|
||||
export const dictionaryEntryBooleanFields: T.DictionaryEntryBooleanField[] = [
|
||||
"noInf", "shortIntrans", "noOo", "sepOo", "diacExcept",
|
||||
];
|
||||
export const dictionaryEntryNumberFields: T.DictionaryEntryNumberField[] = [
|
||||
"ts", "r", "i", "l", "separationAtP", "separationAtF",
|
||||
];
|
39
src/types.ts
39
src/types.ts
|
@ -145,9 +145,42 @@ export type DictionaryEntryNoFVars = DictionaryEntry & { __brand: "name for a di
|
|||
export type PsStringNoFVars = PsString & { __brand: "name for a ps string with all the phonetics variations removed" };
|
||||
export type FStringNoFVars = string & { __brand: "name for a phonetics string with all the phonetics variations removed" };
|
||||
|
||||
export type DictionaryEntryTextField = "p" | "f" | "e" | "c" | "infap" | "infaf" | "infbp" | "infbf" | "app" | "apf" | "ppp" | "ppf" | "psp" | "psf" | "ssp" | "ssf" | "prp" | "prf" | "pprtp" | "pprtf" | "tppp" | "tppf" | "ec" | "ep";
|
||||
export type DictionaryEntryBooleanField = "noInf" | "shortIntrans" | "noOo" | "sepOo" | "diacExcept";
|
||||
export type DictionaryEntryNumberField = "ts" | "r" | "i" | "l" | "separationAtP" | "separationAtF";
|
||||
|
||||
export const dictionaryEntryTextFields = [
|
||||
"p",
|
||||
"f",
|
||||
"e",
|
||||
"c",
|
||||
"infap",
|
||||
"infaf",
|
||||
"infbp",
|
||||
"infbf",
|
||||
"app",
|
||||
"apf",
|
||||
"ppp",
|
||||
"ppf",
|
||||
"psp",
|
||||
"psf",
|
||||
"ssp",
|
||||
"ssf",
|
||||
"prp",
|
||||
"prf",
|
||||
"pprtp",
|
||||
"pprtf",
|
||||
"tppp",
|
||||
"tppf",
|
||||
"ec",
|
||||
"ep",
|
||||
] as const;
|
||||
export type DictionaryEntryTextField = typeof dictionaryEntryTextFields[number];
|
||||
export const dictionaryEntryBooleanFields = [
|
||||
"noInf", "shortIntrans", "noOo", "sepOo", "diacExcept",
|
||||
] as const;
|
||||
export const dictionaryEntryNumberFields = [
|
||||
"ts", "r", "i", "l", "separationAtP", "separationAtF",
|
||||
] as const;
|
||||
export type DictionaryEntryBooleanField = typeof dictionaryEntryBooleanFields[number];
|
||||
export type DictionaryEntryNumberField = typeof dictionaryEntryNumberFields[number];
|
||||
export type DictionaryEntryField = DictionaryEntryTextField | DictionaryEntryBooleanField | DictionaryEntryNumberField;
|
||||
|
||||
// TODO: make
|
||||
|
|
Loading…
Reference in New Issue