本文整理汇总了TypeScript中@ephox/boulder.Objects.hasKey方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Objects.hasKey方法的具体用法?TypeScript Objects.hasKey怎么用?TypeScript Objects.hasKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ephox/boulder.Objects
的用法示例。
在下文中一共展示了Objects.hasKey方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
return Arr.map(items, function (item) {
if (Objects.hasKey(item, 'items')) {
const newItems = doEnrich(item.items);
return Merger.deepMerge(
enrichMenu(item),
{
items: newItems
}
);
} else if (Objects.hasKey(item, 'format')) {
return enrichSupported(item);
} else {
return enrichCustom(item);
}
});
示例2: function
const getFromItem = function (item) {
return Objects.hasKey(item, 'items') ? getFromExpandingItem(item) : {
item,
menus: { },
expansions: { }
};
};
示例3: function
const items = Arr.map(menuItems, function (item) {
return makeItem(
getValue(item),
item.title,
item.isSelected !== undefined ? item.isSelected() : false,
item.getPreview !== undefined ? item.getPreview() : '',
Objects.hasKey(formats.expansions, getValue(item))
);
});
示例4: doEnrich
return Arr.map(items, (item) => {
const keys = Obj.keys(item);
// If it is a submenu, enrich all the subitems.
if (Objects.hasKey(item, 'items')) {
const newItems = doEnrich(item.items);
return Merger.deepMerge(
enrichMenu(item),
{
getStyleItems: () => newItems
}
) as FormatItem;
} else if (Objects.hasKey(item, 'format')) {
return enrichSupported(item);
// NOTE: This branch is added from the original StyleFormats in mobile
} else if (keys.length === 1 && Arr.contains(keys, 'title')) {
return Merger.deepMerge(item, { type: 'separator' }) as FormatItem;
} else {
return enrichCustom(item);
}
});
示例5: function
return Arr.bind(itemNames, function (iName) {
const r = !Objects.hasKey(present, iName) && Objects.hasKey(features, iName) && features[iName].isSupported() ? [ features[iName].sketch() ] : [];
// NOTE: Could use fold to avoid mutation, but it might be overkill and not performant
present[iName] = true;
return r;
});
示例6:
return prereq.forall(function (p) {
return Objects.hasKey(editor.buttons, p);
});