當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript lodash.negate函數代碼示例

本文整理匯總了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;
            }
        });
開發者ID:gooddata,項目名稱:gooddata-js,代碼行數:31,代碼來源:experimental-executions.ts

示例2: removeEmptyStacks

export function removeEmptyStacks(stacks: ItemStack<Item>[]): ItemStack<Item>[] {
  return _.filter(stacks, _.negate(stackIsEmpty));
}
開發者ID:zthomae,項目名稱:xanadu,代碼行數:3,代碼來源:item.ts

示例3: safeQueryStringStringify

export function safeQueryStringStringify(o: any) {
  const noUndefinedFields = _.pickBy(o, _.negate(_.isUndefined));
  return querystring.stringify(noUndefinedFields);
}
開發者ID:HarryTmetic,項目名稱:r2,代碼行數:4,代碼來源:util.ts

示例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);
開發者ID:OmniSharp,項目名稱:atom-languageclient,代碼行數:29,代碼來源:convert.ts


注:本文中的lodash.negate函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。