本文整理汇总了TypeScript中lodash.negate函数的典型用法代码示例。如果您正苦于以下问题:TypeScript negate函数的具体用法?TypeScript negate怎么用?TypeScript negate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了negate函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: findHeaderForMappingFn
import { sortDefinitions } from '../utils/definitions';
import {
getMissingUrisInAttributesMap
} from '../utils/attributesMapLoader';
import {
getAttributes,
getMeasures,
getMeasureFilters,
getDefinition,
isAttributeMeasureFilter,
getAttributesDisplayForms
} from '../utils/visualizationObjectHelper';
import { IMeasure } from '../interfaces';
import { XhrModule } from '../xhr';
const notEmpty = negate<Array<string | null>>(isEmpty);
function findHeaderForMappingFn(mapping: any, header: any) {
return ((mapping.element === header.id || mapping.element === header.uri) &&
header.measureIndex === undefined);
}
function wrapMeasureIndexesFromMappings(metricMappings: any[], headers: any[]) {
if (metricMappings) {
metricMappings.forEach((mapping) => {
const header = find(headers, partial(findHeaderForMappingFn, mapping));
if (header) {
header.measureIndex = mapping.measureIndex;
header.isPoP = mapping.isPoP;
}
});
示例2: removeEmptyStacks
export function removeEmptyStacks(stacks: ItemStack<Item>[]): ItemStack<Item>[] {
return _.filter(stacks, _.negate(stackIsEmpty));
}
示例3: safeQueryStringStringify
export function safeQueryStringStringify(o: any) {
const noUndefinedFields = _.pickBy(o, _.negate(_.isUndefined));
return querystring.stringify(noUndefinedFields);
}
示例4: getLinterText
export function getLinterText(message: Linter.Message) {
if (!hasLinterText(message)) {
return message.html;
}
return message.text;
}
export function hasCompletionText(message: any): message is Autocomplete.ITextSuggestion {
return !!message.text;
}
export function getCompletionText(message: Autocomplete.Suggestion) {
if (message.displayText) {
return message.displayText;
}
if (!hasCompletionText(message)) {
return message.snippet;
}
return message.text;
}
export function getCompletionReplacementText(message: Autocomplete.Suggestion) {
if (!hasCompletionText(message)) {
return message.snippet;
}
return message.text;
}
export const isDefined = _.negate(_.isUndefined);