How to use the @ephox/katamari.Obj.has function in @ephox/katamari

To help you get started, we’ve selected a few @ephox/katamari examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinymce / tinymce / modules / tinymce / src / plugins / help / main / ts / ui / Dialog.ts View on Github external
const names = Arr.map(tabsFromSettings, (t) => {
    if (typeof t === 'string') {
      // Code below shouldn't care if a tab name doesn't have a spec.
      // If we find it does, we'll need to make this smarter.
      // CustomTabsTest has a case for this.
      if (Obj.has(tabs, t)) {
        newTabs[t] = tabs[t];
      }
      return t;
    } else {
      newTabs[t.name] = t;
      return t.name;
    }
  });
  return {tabs: newTabs, names};
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / menus / contextmenu / Settings.ts View on Github external
return Obj.get(editor.settings, name).map(patchPipeConfig).getOrThunk(() => {
    return Arr.filter(patchPipeConfig(defaultItems), (item) => Obj.has(contextMenus, item));
  });
};
github tinymce / tinymce / modules / tinymce / src / plugins / textpattern / main / ts / utils / Utils.ts View on Github external
const isBlockFormatName = (name: string, formatter: Formatter): boolean => {
  const formatSet = formatter.get(name);
  return Type.isArray(formatSet) && Arr.head(formatSet).exists((format) => Obj.has(format as any, 'block'));
};
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / core / complex / StyleFormat.ts View on Github external
const isInlineFormat = (format: AllowedFormat): format is InlineStyleFormat => {
  return Obj.has(format as Record, 'inline');
};
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / core / complex / StyleFormat.ts View on Github external
const isSelectorFormat = (format: AllowedFormat): format is SelectorStyleFormat => {
  return Obj.has(format as Record, 'selector');
};
github tinymce / tinymce / modules / tinymce / src / plugins / emoticons / main / ts / core / EmojiDatabase.ts View on Github external
const translateCategory = (categories: Record, name: string) => {
  return Obj.has(categories, name) ? categories[name] : name;
};
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / core / complex / StyleFormat.ts View on Github external
const isBlockFormat = (format: AllowedFormat): format is BlockStyleFormat => {
  return Obj.has(format as Record, 'block');
};
github tinymce / tinymce / modules / tinymce / src / core / main / ts / mode / Mode.ts View on Github external
const setMode = (editor: Editor, availableModes: Record, activeMode: Cell, mode: string) => {
  if (mode === activeMode.get()) {
    return;
  } else if (!Obj.has(availableModes, mode)) {
    throw new Error(`Editor mode '${mode}' is invalid`);
  }

  if (editor.initialized) {
    switchToMode(editor, activeMode, availableModes, mode);
  } else {
    editor.on('init', () => switchToMode(editor, activeMode, availableModes, mode));
  }
};
github tinymce / tinymce / src / core / main / ts / mode / Mode.ts View on Github external
const setMode = (editor: Editor, availableModes: Record, activeMode: Cell, mode: string) => {
  if (mode === activeMode.get()) {
    return;
  } else if (!Obj.has(availableModes, mode)) {
    throw new Error(`Editor mode '${mode}' is invalid`);
  }

  if (editor.initialized) {
    switchToMode(editor, activeMode, availableModes, mode);
  } else {
    editor.on('init', () => switchToMode(editor, activeMode, availableModes, mode));
  }
};