/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/rich-text/src/get-active-object.js
19 строк
568 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { OBJECT_REPLACEMENT_CHARACTER } from './special-characters'; /** @typedef {import('./types').RichTextValue} RichTextValue */ /** @typedef {import('./types').RichTextFormat} RichTextFormat */ /** * Gets the active object, if there is any. * * @param {RichTextValue} value Value to inspect. * * @return {RichTextFormat|void} Active object, or undefined. */ export function getActiveObject( { start, end, replacements, text } ) { if ( start + 1 !== end || text[ start ] !== OBJECT_REPLACEMENT_CHARACTER ) { return; } return replacements[ start ]; }