本文整理匯總了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);
});