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