peritus_obsidian-interactiv.../src/ratings-parser/getSymbolSetForPattern.ts
Filip Noetzel b60874efdc Refactored large TypeScript files (utils.ts, ratings-parser.ts, editor-extension.ts) by splitting them into smaller, organized files within directories. Each function now has its own file with proper imports/exports through index files.
Fixed import issue in editor-extension/index.ts - added missing import for ratingViewPlugin before using it in the export array. All type checks and builds now pass successfully.
2025-06-10 08:56:19 +02:00

16 lines
No EOL
520 B
TypeScript

import { SYMBOL_PATTERNS } from '../constants';
import { SymbolSet } from '../types';
/**
* Get the appropriate symbol set for a given rating pattern
*/
export function getSymbolSetForPattern(pattern: string): SymbolSet | null {
// Find the symbol set that matches the pattern
for (const symbolSet of SYMBOL_PATTERNS) {
if (pattern.includes(symbolSet.full) || pattern.includes(symbolSet.empty) ||
(symbolSet.half && pattern.includes(symbolSet.half))) {
return symbolSet;
}
}
return null;
}