Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/js/ui/text-editor/src/debug/
Upload File :
Current File : /var/www/homesaver/www/bitrix/js/ui/text-editor/src/debug/print-format-properties.js

import { type RangeSelection, type TextNode } from 'ui.lexical.core';
import { FORMAT_PREDICATES } from './constants';

export function printFormatProperties(nodeOrSelection: TextNode | RangeSelection): string
{
	let str = FORMAT_PREDICATES.map((predicate) => predicate(nodeOrSelection))
		.filter(Boolean)
		.join(', ')
		.toLocaleLowerCase();

	if (str !== '')
	{
		str = `format: ${str}`;
	}

	return str;
}