当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript underscore.omit函数代码示例

本文整理汇总了TypeScript中underscore.omit函数的典型用法代码示例。如果您正苦于以下问题:TypeScript omit函数的具体用法?TypeScript omit怎么用?TypeScript omit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了omit函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

 static respondToResourceGET<T>(requestBody, res, dao: DAO<T>, whereArray: string[], likeArray: string[]) {
     let whereQuery = _.omit(_.pick(requestBody, whereArray),
         function (value, key, object) {
             return value === "";
         });
     let likeQuery_ = _.chain(requestBody)
         .pick(requestBody, likeArray)
         .omit(function (value, key, object) {
             return value === "";
         }).value();
     let likeQuery = _.mapObject(likeQuery_, function (value, key) {
         return "%" + value + "%";
     });
     dao.find({
         where: whereQuery, like: likeQuery, orderBy: requestBody.orderBy
     }, function (err, results) {
         if (err) {
             APIHelper.sendDatabaseErrorResponse(res, err);
         } else {
             if (results.length === 0) {
                 APIHelper.sendNotFoundResponse(res, "Not found.");
             } else {
                 APIHelper.sendResponse(res, results);
             }
         }
     });
 }
开发者ID:JohanBaskovec,项目名称:libraryBackEnd,代码行数:27,代码来源:apiHelper.ts

示例2: String

		var action = String(function (args) {
			var gm = require("@arangodb/general-graph");
			var graph = gm._graph('partyGraph');
			var _ = require('underscore');
			var party = graph.party.save(_.omit(args[0], 'members'));
			graph.member.save(party._id, args[1]._id, { admin: true });
			return party;
		});
开发者ID:andregs,项目名称:think-before-voting,代码行数:8,代码来源:party.router.ts

示例3: on

  on(actions.queueGameUpdate, (state, action) => {
    const { update } = action.payload;

    return {
      ...state,
      updates: omit(state.updates, update.itemId),
    };
  });
开发者ID:HorrerGames,项目名称:itch,代码行数:8,代码来源:game-updates.ts

示例4: on

  on(actions.snoozeCave, (state, action) => {
    const { caveId } = action.payload;

    return {
      ...state,
      updates: omit(state.updates, caveId),
    };
  });
开发者ID:itchio,项目名称:itch,代码行数:8,代码来源:game-updates.ts

示例5: on

 on(actions.localeDownloadStarted, (state, action) => {
   const { lang } = action.payload;
   return {
     ...state,
     queued: omit(state.downloading, lang),
     downloading: { ...state.downloading, [lang]: true },
   };
 });
开发者ID:HorrerGames,项目名称:itch,代码行数:8,代码来源:i18n.ts

示例6: on

  on(actions.taskEnded, (state, action) => {
    const { id } = action.payload;

    return {
      ...state,
      tasks: omit(state.tasks, id),
      finishedTasks: [state.tasks[id], ...state.finishedTasks],
    };
  });
开发者ID:itchio,项目名称:itch,代码行数:9,代码来源:tasks.ts

示例7: on

  on(actions.focusTab, (state, action) => {
    const { tab } = action.payload;
    const oldInstance = state[tab];

    // wake up any sleepy tabs
    if (oldInstance && oldInstance.sleepy) {
      return {
        ...state,
        [tab]: omit(oldInstance, "sleepy"),
      };
    }
    return state;
  });
开发者ID:HorrerGames,项目名称:itch,代码行数:13,代码来源:tab-instances.ts

示例8: getInfos

 return getInfos(accountKey).then((infos) => {
   infos[itemKey] = _.omit(this, 'save');
   if (_.isEmpty(infos[itemKey])) {
     delete infos[itemKey];
   }
   setInfos(accountKey, infos)
     .catch((e) => {
       toaster.pop('error',
         t('ItemInfoService.SaveInfoErrorTitle'),
         t('ItemInfoService.SaveInfoErrorDescription', { error: e.message }));
       console.error("Error saving item info (tags, notes):", e);
       reportException('itemInfo', e);
     });
 });
开发者ID:delphiactual,项目名称:DIM,代码行数:14,代码来源:dim-item-info.ts

示例9: getLoadoutItem

 // A special getItem that takes into account the fact that
 // subclasses have unique IDs, and emblems/shaders/etc are interchangeable.
 function getLoadoutItem(pseudoItem: DimItem, store: DimStore): DimItem | null {
   let item = store.getStoresService().getItemAcrossStores(_.omit(pseudoItem, 'amount'));
   if (!item) {
     return null;
   }
   if (['Class', 'Shader', 'Emblem', 'Emote', 'Ship', 'Horn'].includes(item.type)) {
     // Same character first
     item =
       store.items.find((i) => i.hash === pseudoItem.hash) ||
       // Then other characters
       store.getStoresService().getItemAcrossStores({ hash: item.hash }) ||
       item;
   }
   return item;
 }
开发者ID:bhollis,项目名称:DIM,代码行数:17,代码来源:loadout.service.ts


注:本文中的underscore.omit函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。