less redundancy using as const
This commit is contained in:
parent
13fdbf8201
commit
1ebe2256da
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "pashto-inflector",
|
"name": "pashto-inflector",
|
||||||
"version": "5.8.3",
|
"version": "5.8.4",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pashto-inflector",
|
"name": "pashto-inflector",
|
||||||
"version": "5.8.3",
|
"version": "5.8.4",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "pashto-inflector",
|
"name": "pashto-inflector",
|
||||||
"version": "5.8.3",
|
"version": "5.8.4",
|
||||||
"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.8.3",
|
"version": "5.8.4",
|
||||||
"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",
|
||||||
|
|
|
@ -72,7 +72,7 @@ import {
|
||||||
dictionaryEntryBooleanFields,
|
dictionaryEntryBooleanFields,
|
||||||
dictionaryEntryNumberFields,
|
dictionaryEntryNumberFields,
|
||||||
dictionaryEntryTextFields,
|
dictionaryEntryTextFields,
|
||||||
} from "./src/fields";
|
} from "../types";
|
||||||
import {
|
import {
|
||||||
validateEntry,
|
validateEntry,
|
||||||
standardizeEntry,
|
standardizeEntry,
|
||||||
|
@ -162,7 +162,7 @@ import {
|
||||||
import shuffleArray from "./src/shuffle-array";
|
import shuffleArray from "./src/shuffle-array";
|
||||||
import defaultTextOptions from "./src/default-text-options";
|
import defaultTextOptions from "./src/default-text-options";
|
||||||
import * as grammarUnits from "./src/grammar-units";
|
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 typePredicates from "./src/type-predicates";
|
||||||
import * as blockUtils from "./src/phrase-building/blocks-utils";
|
import * as blockUtils from "./src/phrase-building/blocks-utils";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lingdocs/inflect",
|
"name": "@lingdocs/inflect",
|
||||||
"version": "5.8.3",
|
"version": "5.8.4",
|
||||||
"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",
|
||||||
|
|
|
@ -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 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 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 const dictionaryEntryTextFields = [
|
||||||
export type DictionaryEntryNumberField = "ts" | "r" | "i" | "l" | "separationAtP" | "separationAtF";
|
"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;
|
export type DictionaryEntryField = DictionaryEntryTextField | DictionaryEntryBooleanField | DictionaryEntryNumberField;
|
||||||
|
|
||||||
// TODO: make
|
// TODO: make
|
||||||
|
|
Loading…
Reference in New Issue