How to use the core-js/library/fn/array/find-index function in core-js

To help you get started, we’ve selected a few core-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prebid / Prebid.js / modules / vertamediaBidAdapter.js View on Github external
serverResponse.bids.forEach(serverBid => {
    const requestId = findIndex(bidderRequest.bids, (bidRequest) => {
      return bidRequest.bidId === serverBid.requestId;
    });

    if (serverBid.cpm !== 0 && requestId !== -1) {
      const bid = createBid(serverBid, getMediaType(bidderRequest.bids[requestId]));

      bids.push(bid);
    }
  });
github prebid / Prebid.js / modules / adomikAnalyticsAdapter.js View on Github external
adomikAdapter.bucketEvents.forEach(function(typedEvent, i) {
    const [placementCode, type] = [typedEvent.event.placementCode, typedEvent.type];
    let existTypedEvent = findIndex(groupedTypedEvents, (groupedTypedEvent) => groupedTypedEvent.placementCode === placementCode);

    if (existTypedEvent === -1) {
      groupedTypedEvents.push({
        placementCode: placementCode,
        [type]: [typedEvent]
      });
      existTypedEvent = groupedTypedEvents.length - 1;
    }

    if (groupedTypedEvents[existTypedEvent][type]) {
      groupedTypedEvents[existTypedEvent][type] = [...groupedTypedEvents[existTypedEvent][type], typedEvent];
    } else {
      groupedTypedEvents[existTypedEvent][type] = [typedEvent];
    }
  });
github prebid / Prebid.js / modules / adtelligentBidAdapter.js View on Github external
serverResponse.bids.forEach(serverBid => {
    const requestId = findIndex(bidderRequest.bids, (bidRequest) => {
      return bidRequest.bidId === serverBid.requestId;
    });

    if (serverBid.cpm !== 0 && requestId !== -1) {
      const bid = createBid(serverBid, getMediaType(bidderRequest.bids[requestId]));

      bids.push(bid);
    }
  });
github prebid / Prebid.js / modules / audienceNetworkBidAdapter.js View on Github external
const testmode = isTestmode();
  const pageurl = getTopWindowUrlEncoded();
  const platform = findPlatform(platforms);
  const cb = generateUUID();
  const search = {
    placementids,
    adformats,
    testmode,
    pageurl,
    sdk,
    adapterver,
    platform,
    platver,
    cb
  };
  const video = findIndex(adformats, isVideo);
  if (video !== -1) {
    [search.playerwidth, search.playerheight] = expandSize(sizes[video]);
  }
  const data = formatQS(search);

  return [{ adformats, data, method, requestIds, sizes, url }];
};
github mrdulin / angular-apollo-starter / src / app / core / repo.service.ts View on Github external
nextNodes = updateTopicsInput.topicNames.map((topicName: string) => {
              const idx: number = findIndex(repositoryTopics.nodes, node => node.topic.name === topicName);
              const exist: boolean = idx !== -1;
              if (exist) {
                return repositoryTopics.nodes[idx];
              } else {
                return {
                  id: Math.random().toString(),
                  topic: {
                    id: Math.random().toString(),
                    name: topicName,
                    __typename: 'Topic'
                  },
                  __typename: 'RepositoryTopic'
                };
              }
            });
          }