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


TypeScript pluck.pluck函數代碼示例

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


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

示例1: it

    it('GET will return all available tribes.', async function () {
        const tribes = [
            {id: 'Uno', name: 'one'},
            {id: 'Dos', name: 'two'},
            {id: 'Tres', name: 'three'}
        ];

        await tribesCollection.insert(tribes);
        let authorizedTribes = pluck('id', tribes);
        await authorizeUserForTribes(authorizedTribes);
        const response = await host.get(path)
            .expect(200)
            .expect('Content-Type', /json/);

        expect(pluck('id', response.body))
            .toEqual(pluck('id', tribes));
        expect(pluck('names', response.body))
            .toEqual(pluck('names', tribes));
    });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:19,代碼來源:tribes-spec.ts

示例2: pluck

 .then(function (tribeDocuments) {
     const authorizedTribes = pluck('id', tribeDocuments);
     return e2eHelp.authorizeUserForTribes(authorizedTribes);
 });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:4,代碼來源:edit-tribe.e2e.ts

示例3: it

 it('should have a section for each tribe', function () {
     const tribeElements = tribeListPage.getTribeElements();
     expect(tribeElements.getText()).toEqual(pluck('name', tribeDocuments));
 });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:4,代碼來源:tribes.e2e.ts

示例4: pipe

 .then(function (documents) {
     return pipe(
         pluck('tribe'),
         union(user.tribes)
     )(documents);
 });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:6,代碼來源:AuthorizedTribesFetcher.ts

示例5: it

 it('will show all the players ', function () {
     const playerElements = element.all(By.repeater('selectable in prepare.selectablePlayers'));
     expect(playerElements.getText()).toEqual(pluck('name', players));
 });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:4,代碼來源:prepare-to-spin.e2e.ts

示例6: it

 it('will show all players', function () {
     browser.setLocation(`/${tribe.id}/player/new`);
     const playerElements = element.all(By.repeater('player in players'));
     expect(playerElements.getText()).toEqual(pluck('name', players));
 });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:5,代碼來源:edit-player.e2e.ts


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