Skip to content

Commit

Permalink
feat: expose internal flatteners (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph authored Nov 11, 2024
1 parent a7443b1 commit 1822c14
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/adjective/declensionAdjective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ export function declensionAdjectiveFlat(
postfix: string,
partOfSpeech?: string,
): string[] {
return getDeclensionAdjectiveFlat(
return _getDeclensionAdjectiveFlat(
declensionAdjective(adj, postfix, partOfSpeech),
);
}

function getDeclensionAdjectiveFlat(result: any): string[] {
/** @internal */
export function _getDeclensionAdjectiveFlat(result: any): string[] {
const forms = [];

for (const key of Object.keys(result)) {
Expand Down
5 changes: 3 additions & 2 deletions src/noun/declensionNoun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function declensionNounFlat(
isSingular: boolean,
isIndeclinable: boolean,
): string[] {
return getDeclensionNounFlat(
return _getDeclensionNounFlat(
declensionNoun(
rawNoun,
rawAdd,
Expand All @@ -35,7 +35,8 @@ export function declensionNounFlat(
);
}

function getDeclensionNounFlat(result: any): string[] {
/** @internal */
export function _getDeclensionNounFlat(result: any): string[] {
if (!result) {
return [];
}
Expand Down
7 changes: 5 additions & 2 deletions src/numeral/declensionNumeral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,13 @@ export function declensionNumeralFlat(
numeralType: string,
): string[] {
const paradigm = declensionNumeral(rawWord, numeralType);
return paradigm ? getDeclensionNumeralFlat(paradigm) : [];
return paradigm ? _getDeclensionNumeralFlat(paradigm) : [];
}

function getDeclensionNumeralFlat(result: SteenNumeralParadigm): string[] {
/** @internal */
export function _getDeclensionNumeralFlat(
result: SteenNumeralParadigm,
): string[] {
if (!result) {
return [];
}
Expand Down
7 changes: 5 additions & 2 deletions src/pronoun/declensionPronoun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ export interface SteenPronounParadigm {

export function declensionPronounFlat(rawWord: string, pronounType: string) {
const paradigm = declensionPronoun(rawWord, pronounType);
return paradigm ? getDeclensionPronounFlat(paradigm) : [];
return paradigm ? _getDeclensionPronounFlat(paradigm) : [];
}

function getDeclensionPronounFlat(result: SteenPronounParadigm): string[] {
/** @internal */
export function _getDeclensionPronounFlat(
result: SteenPronounParadigm,
): string[] {
if (!result) {
return [];
}
Expand Down
7 changes: 5 additions & 2 deletions src/verb/conjugationVerb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ export function conjugationVerbFlat(
rawPts: string,
partOfSpeech?: string,
): string[] {
return getConjugationVerbFlat(conjugationVerb(inf, rawPts, partOfSpeech));
return _getConjugationVerbFlat(conjugationVerb(inf, rawPts, partOfSpeech));
}

function getConjugationVerbFlat(result: SteenVerbParadigm | null): string[] {
/** @internal */
export function _getConjugationVerbFlat(
result: SteenVerbParadigm | null,
): string[] {
if (!result) {
return [];
}
Expand Down

0 comments on commit 1822c14

Please sign in to comment.