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


TypeScript sift.default函數代碼示例

本文整理匯總了TypeScript中sift.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: sift

export const get: Operation = (req, res) => {

    const services = Service.all().map(service => {

        const ret: any = service.export();
        ret.hasLogoData = service.hasLogoData;

        return ret;
    });

    api.responseJSON(res, sift(req.query, services));
};
開發者ID:tosono,項目名稱:Mirakurun,代碼行數:12,代碼來源:services.ts

示例2: getOrder

export const get: Operation = (req, res) => {

    const services = Service.all().map(service => {

        const ret: any = service.export();
        ret.hasLogoData = service.hasLogoData;

        return ret;
    });

    services.sort((a: ServiceItem, b: ServiceItem) => getOrder(a) - getOrder(b));

    api.responseJSON(res, sift(req.query, services));
};
開發者ID:kanreisa,項目名稱:Mirakurun,代碼行數:14,代碼來源:services.ts

示例3: loadItem

  async loadItem(query: any): Promise<T|undefined> {
    const test = sift(query) as any;
    const loaded = this.find((model) => test(model.source));
    if (loaded) return loaded;
    
    const { value, done } = await readOneChunk<any>(this._bus.dispatch(new DSFindRequest(this.collectionName, query, false)));

    // item exists, so add and return it. Otherwise return undefined indicating
    // that the item does not exist.
    if (value) {
      const item = this.createActiveRecord(value);
      this.push(item);
      return item;
    }
  }
開發者ID:cryptobuks,項目名稱:tandem,代碼行數:15,代碼來源:collection.ts

示例4: sift

export const get: Operation = (req, res) => {

    const channels = Channel.all().map(channel => {

        const ch: any = channel.export();

        ch.services = channel.getServices().map(service => ({
            id: service.id,
            serviceId: service.serviceId,
            networkId: service.networkId,
            name: service.name
        }));

        return ch;
    });

    api.responseJSON(res, sift(req.query, channels));
};
開發者ID:tosono,項目名稱:Mirakurun,代碼行數:18,代碼來源:channels.ts

示例5: FilterBus

 this._globalMessageObserver = new FilterBus((message: PostDSMessage) => {
   return (message.type === DSUpdateRequest.DS_UPDATE || message.type === DSInsertRequest.DS_INSERT || message.type === PostDSMessage.DS_DID_UPDATE || message.type === PostDSMessage.DS_DID_INSERT) && message.collectionName === this.collectionName && sift(this.query)(message.data);
 }, new CallbackBus(this.onPostDSMessage.bind(this)));
開發者ID:cryptobuks,項目名稱:tandem,代碼行數:3,代碼來源:collection.ts


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