core/normalizers/sentence.normalizer.ts
core/normalizers/sentence.normalizer.ts is a file in Bane's Lab Content. 13 lines of code and 4 definitions.
import { LABEL_MARK, LABEL_SEPARATORS } from "#configuration/constants/tone.constants";
export const isLabeledItem = function isLabeledItem(text: string): boolean {
const trimmed = text.trim();
if (!trimmed.startsWith(LABEL_MARK)) {
return false;
}
const close = trimmed.indexOf(LABEL_MARK, LABEL_MARK.length);
if (close === -1) {
return false;
}
const after = trimmed.slice(close + LABEL_MARK.length);
return LABEL_SEPARATORS.some((separator) => after.startsWith(separator));
};