How to use the @ephox/katamari.Type.isString 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 / themes / silver / main / ts / api / Settings.ts View on Github external
const isToolbarEnabled = (editor: Editor): boolean => {
  const toolbar = editor.getParam('toolbar', true);
  const isToolbarTrue = toolbar === true;
  const isToolbarString = Type.isString(toolbar);
  const isToolbarObjectArray = Type.isArray(toolbar) && toolbar.length > 0;
  // Toolbar is enabled if its value is true, a string or non-empty object array, but not string array
  return !isMultipleToolbars(editor) && (isToolbarObjectArray || isToolbarString || isToolbarTrue);
};
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / backstage / UrlInputHistory.ts View on Github external
const isHttpUrl = (url: any): boolean => {
  return Type.isString(url) && /^https?/.test(url);
};
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / backstage / UrlInputBackstage.ts View on Github external
const handler = (value: string, meta?: Record) => {
          if (!Type.isString(value)) {
            throw new Error('Expected value to be string');
          }
          if (meta !== undefined && !Type.isObject(meta)) {
            throw new Error('Expected meta to be a object');
          }
          const r: UrlData = { value, meta };
          completer(r);
        };
        const meta = Tools.extend({ filetype }, Option.from(entry.meta).getOr({}));
github tinymce / tinymce / modules / tinymce / src / plugins / image / main / ts / ui / Dialog.ts View on Github external
}
  if (Type.isString(meta.class)) {
    ListUtils.findEntry(info.classList, meta.class).each((entry) => {
      data.classes = entry.value;
    });
  }
  if (info.hasImageCaption) {
    if (Type.isBoolean(meta.caption)) {
      data.caption = meta.caption;
    }
  }
  if (info.hasAdvTab) {
    if (Type.isString(meta.vspace)) {
      data.vspace = meta.vspace;
    }
    if (Type.isString(meta.border)) {
      data.border = meta.border;
    }
    if (Type.isString(meta.hspace)) {
      data.hspace = meta.hspace;
    }
    if (Type.isString(meta.borderstyle)) {
      data.borderstyle = meta.borderstyle;
    }
  }
};
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / backstage / UrlInputBackstage.ts View on Github external
const getTextSetting = (settings: Record, name: string, defaultValue: string): Option => {
  const value = getOpt(settings, name).getOr(defaultValue);
  return Type.isString(value) ? Option.some(value) : Option.none();
};
github tinymce / tinymce / modules / tinymce / src / plugins / image / main / ts / ui / Dialog.ts View on Github external
if (Type.isString(meta.height)) {
      data.dimensions.height = meta.height;
    }
  }
  if (Type.isString(meta.class)) {
    ListUtils.findEntry(info.classList, meta.class).each((entry) => {
      data.classes = entry.value;
    });
  }
  if (info.hasImageCaption) {
    if (Type.isBoolean(meta.caption)) {
      data.caption = meta.caption;
    }
  }
  if (info.hasAdvTab) {
    if (Type.isString(meta.vspace)) {
      data.vspace = meta.vspace;
    }
    if (Type.isString(meta.border)) {
      data.border = meta.border;
    }
    if (Type.isString(meta.hspace)) {
      data.hspace = meta.hspace;
    }
    if (Type.isString(meta.borderstyle)) {
      data.borderstyle = meta.borderstyle;
    }
  }
};
github tinymce / tinymce / modules / tinymce / src / plugins / image / main / ts / ui / Dialog.ts View on Github external
data.classes = entry.value;
    });
  }
  if (info.hasImageCaption) {
    if (Type.isBoolean(meta.caption)) {
      data.caption = meta.caption;
    }
  }
  if (info.hasAdvTab) {
    if (Type.isString(meta.vspace)) {
      data.vspace = meta.vspace;
    }
    if (Type.isString(meta.border)) {
      data.border = meta.border;
    }
    if (Type.isString(meta.hspace)) {
      data.hspace = meta.hspace;
    }
    if (Type.isString(meta.borderstyle)) {
      data.borderstyle = meta.borderstyle;
    }
  }
};
github tinymce / tinymce / modules / tinymce / src / plugins / image / main / ts / ui / Dialog.ts View on Github external
const formFillFromMeta2 = (info: ImageDialogInfo, data: ImageDialogData, meta: ImageDialogData['src']['meta']): void => {
  if (info.hasDescription && Type.isString(meta.alt)) {
    data.alt = meta.alt;
  }
  if (info.hasImageTitle && Type.isString(meta.title)) {
    data.title = meta.title;
  }
  if (info.hasDimensions) {
    if (Type.isString(meta.width)) {
      data.dimensions.width = meta.width;
    }
    if (Type.isString(meta.height)) {
      data.dimensions.height = meta.height;
    }
  }
  if (Type.isString(meta.class)) {
    ListUtils.findEntry(info.classList, meta.class).each((entry) => {
      data.classes = entry.value;
    });
  }
  if (info.hasImageCaption) {
    if (Type.isBoolean(meta.caption)) {
      data.caption = meta.caption;
    }
  }
  if (info.hasAdvTab) {
    if (Type.isString(meta.vspace)) {
      data.vspace = meta.vspace;
github tinymce / tinymce / modules / tinymce / src / plugins / image / main / ts / ui / Dialog.ts View on Github external
const formFillFromMeta2 = (info: ImageDialogInfo, data: ImageDialogData, meta: ImageDialogData['src']['meta']): void => {
  if (info.hasDescription && Type.isString(meta.alt)) {
    data.alt = meta.alt;
  }
  if (info.hasImageTitle && Type.isString(meta.title)) {
    data.title = meta.title;
  }
  if (info.hasDimensions) {
    if (Type.isString(meta.width)) {
      data.dimensions.width = meta.width;
    }
    if (Type.isString(meta.height)) {
      data.dimensions.height = meta.height;
    }
  }
  if (Type.isString(meta.class)) {
    ListUtils.findEntry(info.classList, meta.class).each((entry) => {
      data.classes = entry.value;