How to use the core-js/library/fn/array/includes 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 / test / spec / modules / eplanningAnalyticsAdapter_spec.js View on Github external
ad: 'adContent',
        auctionId: pauctionId,
        width: 300,
        height: 250
      });

      // Step 6: Send auction end event
      events.emit(constants.EVENTS.AUCTION_END, {auctionId: pauctionId});

      // Step 7: Find the request data sent (filtering other hosts)
      requests = requests.filter(req => {
        return req.url.indexOf(initOptions.host) > -1;
      });
      expect(requests.length).to.equal(1);

      expect(includes([initOptions.host + initOptions.ci], requests[0].url));
      expect(includes(['https://ads.ar.e-planning.net/hba/1/12345?d='], requests[0].url));

      let info = requests[0].url;
      let purl = parseURL(info);
      let eplData = JSON.parse(decodeURIComponent(purl.search.d));

      // Step 8 check that 6 events were sent
      expect(eplData.length).to.equal(6);

      // Step 9 verify that we only receive the parameters we need
      let expectedEventValues = [
        // AUCTION INIT
        {ec: constants.EVENTS.AUCTION_INIT,
          p: {auctionId: pauctionId, time: auctionTimestamp}},
        // BID REQ
        {ec: constants.EVENTS.BID_REQUESTED,
github prebid / Prebid.js / modules / consentManagement.js View on Github external
const hookConfig = {
    context: this,
    args: [reqBidsConfigObj],
    nextFn: fn,
    adUnits: reqBidsConfigObj.adUnits || $$PREBID_GLOBAL$$.adUnits,
    bidsBackHandler: reqBidsConfigObj.bidsBackHandler,
    haveExited: false,
    timer: null
  };

  // in case we already have consent (eg during bid refresh)
  if (consentData) {
    return exitModule(null, hookConfig);
  }

  if (!includes(Object.keys(cmpCallMap), userCMP)) {
    utils.logWarn(`CMP framework (${userCMP}) is not a supported framework.  Aborting consentManagement module and resuming auction.`);
    return hookConfig.nextFn.apply(hookConfig.context, hookConfig.args);
  }

  cmpCallMap[userCMP].call(this, processCmpData, cmpFailed, hookConfig);

  // only let this code run if module is still active (ie if the callbacks used by CMPs haven't already finished)
  if (!hookConfig.haveExited) {
    if (consentTimeout === 0) {
      processCmpData(undefined, hookConfig);
    } else {
      hookConfig.timer = setTimeout(cmpTimedOut.bind(null, hookConfig), consentTimeout);
    }
  }
}
github Nubuck / z1-app-starter / web / src / elements / form / components / fields / ArrayField.js View on Github external
isItemRequired(itemSchema) {
    if (Array.isArray(itemSchema.type)) {
      // While we don't yet support composite/nullable jsonschema types, it's
      // future-proof to check for requirement against these.
      return !includes(itemSchema.type, 'null')
    }
    // All non-null array item types are inherently required by design
    return itemSchema.type !== 'null'
  }
github HairyRabbit / undefined / lib / builder / config.js View on Github external
let values = decl.value.trim().split(' ').map(m => {
          if(!includes(n.slice(1), m)) return m
          return n[0]
        }).join(' ')
github prebid / Prebid.js / modules / prebidServerBidAdapter / index.js View on Github external
bidderRequests,
        requestedBidders
      );

      bids.forEach(({adUnit, bid}) => {
        if (isValid(adUnit, bid, bidderRequests)) {
          addBidResponse(adUnit, bid);
        }
      });

      bidderRequests.forEach(bidderRequest => events.emit(EVENTS.BIDDER_DONE, bidderRequest));
    } catch (error) {
      utils.logError(error);
    }

    if (!result || (result.status && includes(result.status, 'Error'))) {
      utils.logError('error parsing response: ', result.status);
    }

    done();
    doClientSideSyncs(requestedBidders);
  }
github prebid / Prebid.js / modules / xhbBidAdapter.js View on Github external
      .filter(param => includes(VIDEO_TARGETING, param))
      .forEach(param => tag.video[param] = bid.params.video[param]);
github prebid / Prebid.js / modules / sizeMappingV2.js View on Github external
sizeConfig.forEach(config => {
      const keys = Object.keys(config);
      if ((includes(keys, 'minViewPort') &&
        includes(keys, 'relevantMediaTypes')) &&
        isArrayOfNums(config.minViewPort, 2) &&
        Array.isArray(config.relevantMediaTypes) &&
        config.relevantMediaTypes.every(mt => (includes(['banner', 'video', 'native'], mt)) || (mt === 'none'))) {
        didCheckPass = didCheckPass && true;
      } else {
        didCheckPass = false;
      }
    });
  }
github prebid / Prebid.js / modules / sigmoidAnalyticsAdapter.js View on Github external
function isValidEvent(eventType, adUnitCode) {
  if (checkAdUnitConfig()) {
    let validationEvents = [bidAdjustmentConst, bidResponseConst, bidWonConst];
    if (!includes(initOptions.adUnits, adUnitCode) && includes(validationEvents, eventType)) {
      return false;
    }
  }
  return true;
}
github prebid / Prebid.js / src / adapterManager.js View on Github external
clientBidderCodes = bidderCodes.filter(elm =>
      !includes(adaptersServerSide, elm) || includes(clientTestAdapters, elm)
    );
github prebid / Prebid.js / src / native.js View on Github external
export const nativeBidder = bid => includes(nativeAdapters, bid.bidder);
export const hasNonNativeBidder = adUnit =>