UNPKG

monaco-editor-core

Version:

A browser based code editor

20 lines (19 loc) 594 B
import { isString } from './types.js'; const _codiconFontCharacters = Object.create(null); export function register(id, fontCharacter) { if (isString(fontCharacter)) { const val = _codiconFontCharacters[fontCharacter]; if (val === undefined) { throw new Error(`${id} references an unknown codicon: ${fontCharacter}`); } fontCharacter = val; } _codiconFontCharacters[id] = fontCharacter; return { id }; } /** * Only to be used by the iconRegistry. */ export function getCodiconFontCharacters() { return _codiconFontCharacters; }