當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。