当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Arr.forall方法代码示例

本文整理汇总了TypeScript中@ephox/katamari.Arr.forall方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Arr.forall方法的具体用法?TypeScript Arr.forall怎么用?TypeScript Arr.forall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/katamari.Arr的用法示例。


在下文中一共展示了Arr.forall方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getIndentStyleName

const validateBlocks = (editor: Editor, blocks: Element[]) => {
  return Arr.forall(blocks, (block) => {
    const indentStyleName = getIndentStyleName(Settings.shouldIndentUseMargin(editor), block);
    const intentValue = Css.getRaw(block, indentStyleName).map(parseIndentValue).getOr(0);
    const contentEditable = editor.dom.getContentEditable(block.dom());
    return contentEditable !== 'false' && intentValue > 0;
  });
};
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:IndentOutdent.ts

示例2: function

const unmergable = function (cell, selections) {
  const hasSpan = function (elem) {
    return (Attr.has(elem, 'rowspan') && parseInt(Attr.get(elem, 'rowspan'), 10) > 1) ||
           (Attr.has(elem, 'colspan') && parseInt(Attr.get(elem, 'colspan'), 10) > 1);
  };

  const candidates = selection(cell, selections);

  return candidates.length > 0 && Arr.forall(candidates, hasSpan) ? Option.some(candidates) : Option.none();
};
开发者ID:abstask,项目名称:tinymce,代码行数:10,代码来源:CellOperations.ts

示例3: function

  const isValidDataUriImage = function (imgElm: HTMLImageElement) {
    if (Arr.forall(urlFilters, (filter) => filter(imgElm)) === false) {
      return false;
    }

    if (imgElm.getAttribute('src').indexOf('data:') === 0) {
      const dataImgFilter = Settings.getImagesDataImgFilter(editor);
      return dataImgFilter(imgElm);
    }

    return true;
  };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:12,代码来源:EditorUpload.ts

示例4: err

 const formatOrCmd = <T> (name: string, onFormat: (formats: string[]) => T, onCommand: (cmd: string, value: any) => T): Result<T, PatternError> => {
   if (pattern.format !== undefined) {
     let formats: string[];
     if (Type.isArray(pattern.format)) {
       if (!Arr.forall(pattern.format, Type.isString)) {
         return err(name + ' pattern has non-string items in the `format` array');
       }
       formats = pattern.format;
     } else if (Type.isString(pattern.format)) {
       formats = [pattern.format];
     } else {
       return err(name + ' pattern has non-string `format` parameter');
     }
     return Result.value(onFormat(formats));
   } else if (pattern.cmd !== undefined) {
     if (!Type.isString(pattern.cmd)) {
       return err(name + ' pattern has non-string `cmd` parameter');
     }
     return Result.value(onCommand(pattern.cmd, pattern.value));
   } else {
     return err(name + ' pattern is missing both `format` and `cmd` parameters');
   }
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:23,代码来源:Pattern.ts

示例5:

const isArrayOf = (p: (a: any) => boolean) => (a: any) => Type.isArray(a) && Arr.forall(a, p);
开发者ID:danielpunkass,项目名称:tinymce,代码行数:1,代码来源:EditorSettings.ts

示例6:

const isArrayOfUrl = (a: any): boolean => {
  return Type.isArray(a) && a.length <= HISTORY_LENGTH && Arr.forall(a, isHttpUrl);
};
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:UrlInputHistory.ts

示例7:

 const matchesSystemStack = (): boolean => {
   // Split the fonts into an array and strip away any quotes
   const fonts = fontFamily.toLowerCase().split(/['"]?\s*,\s*['"]?/);
   return Arr.forall(systemStackFonts, (font) => fonts.indexOf(font.toLowerCase()) > -1);
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:5,代码来源:FontSelect.ts


注:本文中的@ephox/katamari.Arr.forall方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。