How to use shrinkImpl method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

MapImpl.js

Source:MapImpl.js Github

copy

Full Screen

1import { loadModules } from 'esri-loader'2import {dataRequestUrl, mapExtent} from '../mapjs/AppConfig'3// 名称渲染样式4import countrylevel1 from '../images/namerender/国1.svg'5import countrylevel2 from '../images/namerender/国2.svg'6import countrylevel3 from '../images/namerender/国3.svg'7import countrylevel4 from '../images/namerender/国4.svg'8import countrylevel5 from '../images/namerender/国5.svg'9import countrylevel6 from '../images/namerender/国6.svg'10import provincelevel1 from '../images/namerender/省1.svg'11import provincelevel2 from '../images/namerender/省2.svg'12import provincelevel3 from '../images/namerender/省3.svg'13import provincelevel4 from '../images/namerender/省4.svg'14import provincelevel5 from '../images/namerender/省5.svg'15import provincelevel6 from '../images/namerender/省6.svg'16import citylevel1 from '../images/namerender/市1.svg'17import citylevel2 from '../images/namerender/市2.svg'18import citylevel3 from '../images/namerender/市3.svg'19import citylevel4 from '../images/namerender/市4.svg'20import citylevel5 from '../images/namerender/市5.svg'21import citylevel6 from '../images/namerender/市6.svg'22import countylevel1 from '../images/namerender/微1.svg'23import countylevel2 from '../images/namerender/微2.svg'24import countylevel3 from '../images/namerender/微3.svg'25import countylevel4 from '../images/namerender/微4.svg'26import countylevel5 from '../images/namerender/微5.svg'27import countylevel6 from '../images/namerender/微6.svg'28import yclevel1 from '../images/namerender/扬1.svg'29import yclevel2 from '../images/namerender/扬2.svg'30import yclevel3 from '../images/namerender/扬3.svg'31import yclevel4 from '../images/namerender/扬4.svg'32import yclevel5 from '../images/namerender/扬5.svg'33import yclevel6 from '../images/namerender/扬6.svg'34//无数值时的符号35import countrynodata from '../images/namerender/国7.svg'36import provincenodata from '../images/namerender/省7.svg'37import citynodata from '../images/namerender/市7.svg'38import countynodata from '../images/namerender/微7.svg'39import ycnodata from '../images/namerender/扬7.svg'40//数值模式41import yclevelnum1 from '../images/numrender/数值1.svg'42import yclevelnum2 from '../images/numrender/数值2.svg'43import yclevelnum3 from '../images/numrender/数值3.svg'44import yclevelnum4 from '../images/numrender/数值4.svg'45import yclevelnum5 from '../images/numrender/数值5.svg'46import yclevelnum6 from '../images/numrender/数值6.svg'47import ycnumnodata from '../images/numrender/数值7.svg'48import levelnum1 from '../images/numrender/数值1.svg'49import levelnum2 from '../images/numrender/数值2.svg'50import levelnum3 from '../images/numrender/数值3.svg'51import levelnum4 from '../images/numrender/数值4.svg'52import levelnum5 from '../images/numrender/数值5.svg'53import levelnum6 from '../images/numrender/数值6.svg'54import levelnumnodata from '../images/numrender/数值7.svg'55// 污染源56import wryoffline from '../images/namerender/污染源1.svg'57import wrynormal from '../images/namerender/污染源2.svg'58import wryalarm from '../images/namerender/污染源3.svg'59import wrynodata from '../images/namerender/污染源4.svg'60// 污染事件61import wrsj from '../images/wrsj.svg'62import store from '../../../../../store'63import {shrinkPoint} from '../mapjs/ShrinkImpl.js'64/**65 * 创建名称标注66 * @param {*} nameArcade 名称标注表达式67 */68export const createNameLabelClass = function (nameArcade) {69 //let nameArcade = '$feature.stationName' || ''70 let nameClass = {71 labelExpressionInfo: {72 expression: nameArcade73 },74 symbol: {75 type: 'text', // autocasts as new TextSymbol()76 color: 'white',77 font: {78 size: 9,79 //family: 'Helvetica Neue'80 family: 'sans-serif'81 },82 // xoffset: -50, // 需要设置xoffset 让文字左侧和上面的背景图对齐83 yoffset: 584 },85 labelPlacement: 'below-center'86 }87 return nameClass;88}89/**90 * 创建数值标注91 * @param {*} numArcade 数值标注表达式 92 */93export const createNumLabelClass = function (numArcade) {94 let numClass = {95 labelExpressionInfo: { expression: numArcade }, // 测试用96 symbol: {97 type: 'text',98 color: 'white',99 font: {100 size: 9,101 weight: 'bold',102 family: 'sans-serif'103 },104 xoffset: 0,105 yoffset: 0106 },107 labelPlacement: 'center-center'108 }109 return numClass;110}111export const initShrinkLayer = function(curMapView,overGraphics,layerid,pointLayerId){112 // 超标报警图层113 //layerid ="airShrinkLayer";114 if(overGraphics && overGraphics.length>0){115 let params=116 {117 map:curMapView.map,118 id:layerid,119 pointLayerId:pointLayerId,120 graphics:overGraphics,121 outerFillColor:[234, 53, 34, 0.2],122 outerOutlineColor:[234, 53, 34, 0.3],123 innerFillColor: [234, 53, 34, 0.4],124 innerOutlineColor: [234, 53, 34, 0.5]125 }126 shrinkPoint(params);127 }128}129export const createAirGraphics =function(graphicResults, callBack, curMapView, renderType, renderField, selectedStationTypeId,layerId) {130 loadModules(['esri/layers/GraphicsLayer', 'esri/geometry/SpatialReference', 'esri/Graphic', 'esri/layers/support/LabelClass', 'esri/geometry/Extent'])131 .then(([GraphicsLayer, SpatialReference, Graphic, LabelClass, Extent]) => {132 let stationtypeobj=store.state.stationtype;133 let graphics = []134 let overGraphics = []135 let countryUrlList = [countrylevel1, countrylevel2, countrylevel3, countrylevel4, countrylevel5, countrylevel6, countrynodata]136 let provinceUrlList = [provincelevel1, provincelevel2, provincelevel3, provincelevel4, provincelevel5, provincelevel6, provincenodata]137 let cityUrlList = [citylevel1, citylevel2, citylevel3, citylevel4, citylevel5, citylevel6, citynodata]138 let countyUrlList = [countylevel1, countylevel2, countylevel3, countylevel4, countylevel5, countylevel6, countynodata]139 let numUrlList = [levelnum1, levelnum2, levelnum3, levelnum4, levelnum5, levelnum6, levelnumnodata]140 let picWidth = '24px'141 let picHeight = '24px'142 let renderInfo = dataRequestUrl.options.stationListInfo.renderInfo143 if(renderType.indexOf('numrender')!=-1){144 picWidth = renderInfo.defaultSymbol.width145 picHeight = renderInfo.defaultSymbol.height146 }147 let nameColor = "white";148 if(curMapView.map.basemap.id=="myVectorBasemap"){149 nameColor = "black";150 }151 let symbolLevel = dataRequestUrl.options.airLevelInfo[renderField]152 let renderFieldMap = [['aqi','aqi'],['pm25','pm25'],['pm10','pm10'],['so2','so2'],['no2','no2'],['co','co'],['o3','o3']];153 //处理报警154 for (let m = 0; m < graphicResults.length; m++) {155 let stationItem = graphicResults[m]156 if (stationItem.longitude != null && stationItem.latitude != null && stationItem.latitude < 90 && (stationItem.stationTypeId == selectedStationTypeId)) {157 if (stationItem.alarmStatus == 1 ) {158 overGraphics.push([stationItem.longitude, stationItem.latitude])159 }160 }161 }162 if(overGraphics && overGraphics.length>0){163 if(selectedStationTypeId == stationtypeobj.guokong){164 initShrinkLayer(curMapView,overGraphics,"countryShrinkLayer",layerId)165 }166 else if(selectedStationTypeId == stationtypeobj.shengkong){167 initShrinkLayer(curMapView,overGraphics,"provinceShrinkLayer",layerId)168 }169 else if(selectedStationTypeId == stationtypeobj.shikong){170 initShrinkLayer(curMapView,overGraphics,"cityShrinkLayer",layerId)171 }172 else if(selectedStationTypeId == stationtypeobj.weixing){173 initShrinkLayer(curMapView,overGraphics,"countyShrinkLayer",layerId)174 } 175 }176 for (let m = 0; m < graphicResults.length; m++) {177 let stationItem = graphicResults[m]178 let numColor;179 let graphicNum;180 if (stationItem.longitude != null && stationItem.latitude != null && stationItem.latitude < 90 && (stationItem.stationTypeId == selectedStationTypeId)) {181 let pointGeometry = {182 type: 'point',183 x: stationItem.longitude,184 y: stationItem.latitude185 }186 if (stationItem.aqi) {187 stationItem.aqi = Math.round(stationItem.aqi)188 }189 if (stationItem.pm25) {190 stationItem.pm25 = Math.round(stationItem.pm25)191 }192 if (stationItem.pm10) {193 stationItem.pm10 = Math.round(stationItem.pm10)194 }195 if (stationItem.co) {196 stationItem.co = Math.round(stationItem.co)197 }198 if (stationItem.no2) {199 stationItem.no2 = Math.round(stationItem.no2)200 }201 if (stationItem.o3) {202 stationItem.o3 = Math.round(stationItem.o3)203 }204 if (stationItem.so2) {205 stationItem.so2 = Math.round(stationItem.so2)206 }207 //根据数值区间获取符号208 let symbolPicUrl; 209 for(let j=0;j<renderFieldMap.length;j++){210 let renderFieldItem = renderFieldMap[j][0];211 if(renderField==renderFieldItem){212 if(stationItem[renderFieldMap[j][1]] && symbolLevel && symbolLevel.length ==6){213 for(let i =0;i<symbolLevel.length;i++){214 if(stationItem[renderFieldMap[j][1]]>=symbolLevel[i][0] && stationItem[renderFieldMap[j][1]]<=symbolLevel[i][1]){215 //数值模式,绿色/黄色/橙色用黑色字体,其他三种颜色用白色字体216 if(renderType.indexOf('numrender')!=-1){217 symbolPicUrl = numUrlList[i];218 graphicNum = stationItem[renderFieldMap[j][1]];219 if(i<3){220 numColor = "black";221 }222 else{223 numColor = "white";224 }225 }else{226 if(selectedStationTypeId == stationtypeobj.guokong){227 symbolPicUrl = countryUrlList[i];228 }229 else if(selectedStationTypeId == stationtypeobj.shengkong){230 symbolPicUrl = provinceUrlList[i];231 }232 else if(selectedStationTypeId == stationtypeobj.shikong){233 symbolPicUrl = cityUrlList[i];234 }235 else if(selectedStationTypeId == stationtypeobj.weixing){236 symbolPicUrl = countyUrlList[i];237 }238 }239 break;240 }241 }242 }243 else{244 if(renderType.indexOf('numrender')!=-1){245 symbolPicUrl = numUrlList[numUrlList.length-1];246 }else{247 if(selectedStationTypeId == stationtypeobj.guokong){248 symbolPicUrl = countryUrlList[countryUrlList.length-1];249 }250 else if(selectedStationTypeId == stationtypeobj.shengkong){251 symbolPicUrl = provinceUrlList[provinceUrlList.length-1];252 }253 else if(selectedStationTypeId == stationtypeobj.shikong){254 symbolPicUrl = cityUrlList[cityUrlList.length-1];255 }256 else if(selectedStationTypeId == stationtypeobj.weixing){257 symbolPicUrl = countyUrlList[countyUrlList.length-1];258 }259 }260 break;261 }262 break;263 }264 }265 if(symbolPicUrl){266 let graphicSymbol = {267 type: renderInfo.defaultSymbol.type,268 url: symbolPicUrl,269 width: picWidth,270 height: picHeight271 // xoffset: renderInfo.defaultSymbol.xoffset272 }273 //默认符号层 274 let graphic = new Graphic({275 geometry: pointGeometry,276 attributes: stationItem,277 symbol:graphicSymbol278 })279 graphics.push(graphic)280 }281 //数值标注层282 if(renderType.indexOf('numrender')!=-1){283 if(!graphicNum){284 graphicNum ="--";285 numColor ="white";286 }287 let xoffset = 0;288 var numTextSymbol = {289 type: "text", // autocasts as new TextSymbol()290 color: numColor,291 font: {292 family: "sans-serif",293 size: 9294 },295 text:graphicNum,296 xoffset:xoffset,297 yoffset:0,298 //haloColor: "black",299 //haloSize: 1,300 horizontalAlignment: "center",301 verticalAlignment: "middle"302 };303 let numGraphic = new Graphic({304 geometry: pointGeometry,305 attributes: stationItem,306 symbol:numTextSymbol307 })308 graphics.push(numGraphic)309 }310 //名称标注层311 if(renderType.indexOf('namerender')!=-1 && stationItem["stationName"]){312 var nameTextSymbol = {313 type: "text", // autocasts as new TextSymbol()314 color: nameColor,315 font: {316 family: "sans-serif",317 size: 9318 },319 text:stationItem["stationName"],320 yoffset: -15,321 //haloColor: "black",322 //haloSize: 1,323 horizontalAlignment: "center",324 verticalAlignment: "bottom"325 };326 let nameGraphic = new Graphic({327 geometry: pointGeometry,328 attributes: stationItem,329 symbol:nameTextSymbol330 })331 graphics.push(nameGraphic)332 }333 }334 }335 if(graphics && graphics.length >0){336 let airPointFeaLayer = curMapView.map.findLayerById(layerId);337 if(airPointFeaLayer !=null){338 airPointFeaLayer.removeAll();339 }else{340 airPointFeaLayer = new GraphicsLayer({341 "id":layerId342 });343 }344 airPointFeaLayer.addMany(graphics);345 let geometryExtent;346 callBack(airPointFeaLayer, geometryExtent)347 }348 else{349 callBack(null,null)350 }351 })352}353/**354 * 绘制污染源数据 污染源只有pm25\pm10\so2\no2\co\o3六参数,没有aqi355 */356export const createWryGraphics = function (graphicResults, callBack, curMapView, renderType, renderField, stationTypeId) {357 loadModules(['esri/layers/FeatureLayer', 'esri/layers/support/Field', 'esri/geometry/SpatialReference', 'esri/Graphic', 'esri/layers/support/LabelClass', 'esri/geometry/Extent'])358 .then(([FeatureLayer, Field, SpatialReference, Graphic, LabelClass, Extent]) => {359 let queryFields = dataRequestUrl.options.entStationListInfo.queryFields360 let oidFieldName = queryFields[0].name361 let renderInfo = dataRequestUrl.options.entStationListInfo.renderInfo362 let urlList = [wryoffline, wrynormal, wryalarm,wrynodata]363 let valueList = ['wryoffline', 'wrynormal', 'wryalarm','wrynodata']364 let uniqueValueInfos = []365 let valueExpression = ''366 // alarmStatus 0是无报警,1是报警,2是离线 isover 0是达标,1是超标367 valueExpression = 'When($feature.alarmStatus ==2 && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[0] + "',$feature.alarmStatus ==0 && $feature.stationTypeId==" + stationTypeId + ", '" + valueList[1] + "',$feature.alarmStatus ==1 && $feature.stationTypeId==" + stationTypeId + ", '" + valueList[2] + "','wrynodata')"368 let picWidth = renderInfo.defaultSymbol.width369 let picHeight = renderInfo.defaultSymbol.height370 for (let i = 0; i < urlList.length; i++) {371 let uniqueValueInfo = {372 value: valueList[i],373 symbol: {374 type: renderInfo.defaultSymbol.type,375 url: urlList[i],376 width: picWidth,377 height: picHeight378 }379 }380 uniqueValueInfos.push(uniqueValueInfo)381 }382 let feaRenderer = {383 type: renderInfo.type, // autocasts as new UniqueValueRenderer()384 valueExpression: valueExpression,385 uniqueValueInfos: uniqueValueInfos386 }387 388 // 站点名称标注 黑色389 let nameArcade = '$feature.stationName' || ''390 let nameClass = createNameLabelClass(nameArcade);391 // 构建图层数据392 // 此处需要注意,query返回的geometry没有type信息,所以需要重新构建graphic,否则会报错393 let graphics = []394 let overGraphics = []395 for (let m = 0; m < graphicResults.length; m++) {396 let stationItem = graphicResults[m]397 if (stationItem.longitude != null && stationItem.latitude != null) {398 if (stationItem.alarmStatus == 1) {399 overGraphics.push([stationItem.longitude, stationItem.latitude])400 }401 let pointGeometry = {402 type: 'point',403 x: stationItem.longitude,404 y: stationItem.latitude405 }406 stationItem.OBJECTID = m + 1407 let graphic = new Graphic({408 geometry: pointGeometry,409 attributes: stationItem410 })411 graphics.push(graphic)412 }413 }414 // 超标报警图层415 initShrinkLayer(curMapView,overGraphics,"wryShrinkLayer","wryPointFeaLayer");416 // debugger;417 if(graphics && graphics.length>0){418 // 构建图层的字段信息419 let fieldInfos = getFieldsInfo(queryFields)420 // 排序获取数据的范围421 //let geometryExtent = calculateMapInitExtent(graphicResults)422 let geometryExtent;423 // 实例化一个弹出框424 let popupTemplate = {425 // title:"站点{"+oidFieldName+"}",426 title: '',427 fieldInfos: fieldInfos428 // content:setPopContentInfo429 }430 // 根据查询结果实例化一个featurelayer,只用国控、省控符号表示431 let labelingInfo = [];432 if(renderType.indexOf('namerender')!=-1) {433 labelingInfo.push(nameClass)434 }435 let wryPointFeaLayer = new FeatureLayer({436 fields: queryFields.map(function (field) {437 return Field.fromJSON(field)438 }),439 // opacity:"0.8",440 id: 'wryPointFeaLayer',441 objectIdField: oidFieldName,442 geometryType: 'point',443 popupEnabled:false,444 spatialReference: new SpatialReference(4326),445 source: graphics,446 labelingInfo: labelingInfo,447 elevationInfo: {448 mode: 'on-the-ground'449 },450 renderer: feaRenderer451 })452 // 不使用默认的图层的popup模板453 wryPointFeaLayer.popupTemplate = popupTemplate454 // 加载script为异步方法455 callBack(wryPointFeaLayer, geometryExtent)456 }457 else{458 callBack(null, null)459 }460 }).catch(function (error) {461 callBack(null,null)462 // console.log(error)463 })464}465/**466 * 绘制雷达数据467 */468export const createRadarLayers = function (curPicUrl, callBack, curMapView,geoExtent,layerId) {469 let radarwkid = geoExtent.spatialReference.wkid;470 loadModules(['esri/layers/BaseDynamicLayer', 'esri/geometry/Extent'])471 .then(([BaseDynamicLayer, Extent]) => {472 let CustomImageOverlayLayer = BaseDynamicLayer.createSubclass({473 properties: {474 picUrl: null,475 extent: null,476 image: null,477 canvas: null478 },479 getImageUrl: function (extent, width, height) {480 if (!this.image) {481 this.image = new Image()482 }483 this.image.src = this.picUrl484 // Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported485 this.image.setAttribute('crossOrigin', 'Anonymous')486 // 创建canvas DOM元素,并设置其宽高和图片一样487 if (!this.canvas) {488 this.canvas = document.createElement('canvas')489 this.canvas.setAttribute('id', 'ladar-canvas')490 }491 // 需要覆盖屏幕 需要考虑大屏的情况492 this.canvas.width = 2000493 this.canvas.height = 2000494 // 左上角坐标转换屏幕坐标,为了获取canvas绘制图片的起点495 let mapPoint = {496 x: this.extent.xmin,497 y: this.extent.ymax,498 spatialReference: {499 wkid: radarwkid500 }501 }502 let screenPoint = curMapView.toScreen(mapPoint)503 // 根据extent范围计算canvas绘制图片的宽度以及高度504 // 左下角505 let leftbottom = {506 x: this.extent.xmin,507 y: this.extent.ymin,508 spatialReference: {509 wkid: radarwkid510 }511 }512 let screen_leftbottom = curMapView.toScreen(leftbottom)513 // 右上角514 let righttop = {515 x: this.extent.xmax,516 y: this.extent.ymax,517 spatialReference: {518 wkid: radarwkid519 }520 }521 let screen_righttop = curMapView.toScreen(righttop)522 let context = this.canvas.getContext('2d')523 let left = screenPoint.x524 let top = screenPoint.y525 let imgWidth = Math.abs(screen_righttop.x - screen_leftbottom.x)526 let imgHeight = Math.abs(screen_righttop.y - screen_leftbottom.y)527 context.drawImage(this.image, left, top, imgWidth, imgHeight)528 // 根据type参数指定的类型将包含在canvas中的图片文件编码成字符串形式529 // type参数的默认值为image/png.如果该canvas的宽度或长度是0,则会返回字符串"data:,".530 // 如果指定的type参数不是image/png,但返回的字符串是以data:image/png开头的,531 // 则所请求的图片类型不支持.Chrome支持image/webp类型.如果type参数的值为image/jpeg或image/webp,532 // 则第二个参数的值如果在0.0和1.0之间的话,会被看作是图片质量参数,如果第二个参数的值不在0.0和1.0之间,则会使用默认的图片质量533 return this.canvas.toDataURL('image/png')534 }535 })536 let LadarImageLayer = new CustomImageOverlayLayer({537 picUrl: curPicUrl,538 //id: 'ladarImageLayer',539 id:layerId,540 opacity: 0.5,541 extent: geoExtent542 })543 // 加载script为异步方法544 callBack(LadarImageLayer,geoExtent)545 }).catch(function (error) {546 callBack(null)547 })548}549/**550 * 绘制污染云图551 */552export const createWrytLayers = function (curPicUrl, callBack, curMapView, geoExtent,layerId) {553 let pollution_cloudwkid=geoExtent.spatialReference.wkid;554 loadModules(['esri/layers/BaseDynamicLayer', 'esri/geometry/Extent','esri/geometry/support/webMercatorUtils'])555 .then(([BaseDynamicLayer, Extent,webMercatorUtils]) => {556 let CustomImageOverlayLayer = BaseDynamicLayer.createSubclass({557 properties: {558 picUrl: null,559 extent: null,560 image: null,561 canvas: null562 },563 getImageUrl: function (extent, width, height) {564 if (!this.image) {565 this.image = new Image()566 }567 //extent = new Extent({xmin: 73.441277, ymin: 18.159829001, xmax: 135.09105966, ymax: 53.563321521, spatialReference: {wkid: 4326}});568 this.image.src = this.picUrl569 // Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported570 this.image.setAttribute('crossOrigin', 'Anonymous')571 // 创建canvas DOM元素,并设置其宽高和图片一样572 if (!this.canvas) {573 this.canvas = document.createElement('canvas')574 this.canvas.setAttribute('id', 'wryt-canvas')575 }576 //let clientHeight = document.documentElement.clientHeight || document.body.clientHeight577 //let clientWidth = document.documentElement.clientWidth || document.body.clientWidth578 // 需要覆盖屏幕 需要考虑大屏的情况 需要比屏幕尺寸大579 this.canvas.width = 2000580 this.canvas.height = 2000581 // 左上角坐标转换屏幕坐标,为了获取canvas绘制图片的起点582 let mapPoint = {583 x: this.extent.xmin,584 y: this.extent.ymax,585 spatialReference: {586 wkid: pollution_cloudwkid587 }588 }589 let screenPoint = curMapView.toScreen(mapPoint)590 // 根据extent范围计算canvas绘制图片的宽度以及高度591 // 左下角592 let leftbottom = {593 x: this.extent.xmin,594 y: this.extent.ymin,595 spatialReference: {596 wkid: pollution_cloudwkid597 }598 }599 let screen_leftbottom = curMapView.toScreen(leftbottom)600 // 右上角601 let righttop = {602 x: this.extent.xmax,603 y: this.extent.ymax,604 spatialReference: {605 wkid: pollution_cloudwkid606 }607 }608 let screen_righttop = curMapView.toScreen(righttop)609 let context = this.canvas.getContext('2d')610 let left = screenPoint.x611 let top = screenPoint.y612 let imgWidth = Math.abs(screen_righttop.x - screen_leftbottom.x)613 let imgHeight = Math.abs(screen_righttop.y - screen_leftbottom.y)614 context.drawImage(this.image, left, top, imgWidth, imgHeight)615 // 根据type参数指定的类型将包含在canvas中的图片文件编码成字符串形式616 // type参数的默认值为image/png.如果该canvas的宽度或长度是0,则会返回字符串"data:,".617 // 如果指定的type参数不是image/png,但返回的字符串是以data:image/png开头的,618 // 则所请求的图片类型不支持.Chrome支持image/webp类型.如果type参数的值为image/jpeg或image/webp,619 // 则第二个参数的值如果在0.0和1.0之间的话,会被看作是图片质量参数,如果第二个参数的值不在0.0和1.0之间,则会使用默认的图片质量620 return this.canvas.toDataURL('image/png')621 }622 })623 // 实例化一个叠加图片图层类624 let WrytImageLayer = new CustomImageOverlayLayer({625 picUrl: curPicUrl,626 ///id: 'wrytImageLayer',627 id:layerId,628 opacity: 0.5,629 extent: geoExtent630 })631 // 加载script为异步方法632 callBack(WrytImageLayer)633 }).catch(function (error) {634 callBack(null)635 })636}637/**638 * 绘制扬尘数据 扬尘只有pm25和pm10639 */640export const createYcGraphics = function (graphicResults, callBack, curMapView, renderType, renderField, stationTypeId) {641 loadModules(['esri/layers/FeatureLayer', 'esri/layers/support/Field', 'esri/geometry/SpatialReference', 'esri/Graphic', 'esri/layers/support/LabelClass', 'esri/geometry/Extent'])642 .then(([FeatureLayer, Field, SpatialReference, Graphic, LabelClass, Extent]) => {643 // 根据查询获取的数据在前端构建空气站点featurelayer图层644 let queryFields = dataRequestUrl.options.dustStationListInfo.queryFields645 let oidFieldName = queryFields[0].name646 let renderInfo = dataRequestUrl.options.dustStationListInfo.renderInfo647 let urlList = [yclevel1, yclevel2, yclevel3, yclevel4, yclevel5, yclevel6, ycnodata]648 let valueList = ['yclevel1', 'yclevel2', 'yclevel3', 'yclevel4', 'yclevel5', 'yclevel6','ycnodata']649 let uniqueValueInfos = []650 let valueExpression = ''651 652 if (renderType.indexOf('numrender')!=-1) {653 urlList = [yclevelnum1, yclevelnum2, yclevelnum3, yclevelnum4, yclevelnum5, yclevelnum6, ycnumnodata]654 valueList = ['yclevelnum1', 'yclevelnum2', 'yclevelnum3', 'yclevelnum4', 'yclevelnum5', 'yclevelnum6','ycnodata']655 }656 let pm25Level = dataRequestUrl.options.airLevelInfo.pm25657 let pm10Level = dataRequestUrl.options.airLevelInfo.pm10658 // debugger659 // 扬尘类别 6660 if (renderField === 'pm25') {661 valueExpression = 'When($feature.pm25 >' + pm25Level[0][0] + ' && $feature.pm25 <= ' + pm25Level[0][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[0] + "',$feature.pm25 >=" + pm25Level[1][0] + ' && $feature.pm25 <= ' + pm25Level[1][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[1] + "',$feature.pm25 >=" + pm25Level[2][0] + ' && $feature.pm25 <= ' + pm25Level[2][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[2] + "',$feature.pm25 >=" + pm25Level[3][0] + ' && $feature.pm25 <= ' + pm25Level[3][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[3] + "',$feature.pm25 >=" + pm25Level[4][0] + ' && $feature.pm25 <= ' + pm25Level[4][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[4] + "',$feature.pm25 >=" + pm25Level[5][0] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[5] + "','"+ valueList[6]+ "')"662 } else if (renderField === 'pm10') {663 valueExpression = 'When($feature.pm10 >' + pm10Level[0][0] + ' && $feature.pm10 <= ' + pm10Level[0][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[0] + "',$feature.pm10 >=" + pm10Level[1][0] + ' && $feature.pm10 <= ' + pm10Level[1][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[1] + "',$feature.pm10 >=" + pm10Level[2][0] + ' && $feature.pm10 <= ' + pm10Level[2][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[2] + "',$feature.pm10 >=" + pm10Level[3][0] + ' && $feature.pm10 <= ' + pm10Level[3][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[3] + "',$feature.pm10 >=" + pm10Level[4][0] + ' && $feature.pm10 <= ' + pm10Level[4][1] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[4] + "',$feature.pm10 >=" + pm10Level[5][0] + ' && $feature.stationTypeId==' + stationTypeId + ", '" + valueList[5] + "','"+ valueList[6]+ "')"664 }665 let picWidth = '24px'666 let picHeight = '24px'667 if(renderType.indexOf('numrender')!=-1){668 picWidth = renderInfo.defaultSymbol.width669 picHeight = renderInfo.defaultSymbol.height670 }671 for (let i = 0; i < urlList.length; i++) {672 /*673 if(valueList[i]=="ycnodata"){674 picWidth = '24px'675 }676 else{677 if(renderType.indexOf('numrender')!=-1){678 picWidth = renderInfo.defaultSymbol.width679 }680 }681 */682 let uniqueValueInfo = {683 value: valueList[i],684 symbol: {685 type: renderInfo.defaultSymbol.type,686 url: urlList[i],687 width: picWidth,688 height: picHeight689 // xoffset: renderInfo.defaultSymbol.xoffset690 }691 }692 uniqueValueInfos.push(uniqueValueInfo)693 }694 let feaRenderer = {695 type: renderInfo.type, // autocasts as new UniqueValueRenderer()696 // field: renderInfo.renderField,697 valueExpression: valueExpression,698 uniqueValueInfos: uniqueValueInfos699 }700 // end*****************************/从配置文件获取点符号唯一值渲染信息701 let ycArcade = ''702 if (renderField === 'pm25') {703 ycArcade = '$feature.pm25' || ''704 } else if (renderField === 'pm10') {705 ycArcade = '$feature.pm10' || ''706 }707 let ycLabelClass = createNumLabelClass(ycArcade);708 // 站点名称标注 黑色709 let nameArcade = '$feature.stationName' || ''710 let nameClass = createNameLabelClass(nameArcade);711 // end*****************************创建文本标注和站点名称标注712 // 构建图层数据713 // 构建图层的字段信息714 let fieldInfos = getFieldsInfo(queryFields)715 // 排序获取数据的范围716 //let geometryExtent = calculateMapInitExtent(graphicResults)717 let geometryExtent;718 let graphics = []719 let overGraphics = []720 for (let m = 0; m < graphicResults.length; m++) {721 let stationItem = graphicResults[m]722 if (stationItem.longitude != null && stationItem.latitude != null) {723 if (stationItem.alarmStatus == 1) {724 overGraphics.push([stationItem.longitude, stationItem.latitude])725 }726 let pointGeometry = {727 type: 'point',728 x: stationItem.longitude,729 y: stationItem.latitude730 }731 stationItem.OBJECTID = m + 1732 if (stationItem.aqi) {733 stationItem.aqi = Math.round(stationItem.aqi)734 }735 if (stationItem.pm25) {736 stationItem.pm25 = Math.round(stationItem.pm25)737 }738 if (stationItem.pm10) {739 stationItem.pm10 = Math.round(stationItem.pm10)740 }741 if (stationItem.co) {742 stationItem.co = Math.round(stationItem.co)743 }744 if (stationItem.no2) {745 stationItem.no2 = Math.round(stationItem.no2)746 }747 if (stationItem.o3) {748 stationItem.o3 = Math.round(stationItem.o3)749 }750 if (stationItem.so2) {751 stationItem.so2 = Math.round(stationItem.so2)752 }753 let graphic = new Graphic({754 geometry: pointGeometry,755 attributes: stationItem756 })757 graphics.push(graphic)758 }759 }760 // 超标报警图层761 initShrinkLayer(curMapView,overGraphics,"ycShrinkLayer",stationTypeId,"ycPointFeaLayer");762 if(graphics && graphics.length>0){763 // 实例化一个弹出框764 let popupTemplate = {765 // title:"站点{"+oidFieldName+"}",766 title: '',767 fieldInfos: fieldInfos768 // content:setPopContentInfo769 }770 // 根据查询结果实例化一个featurelayer,只用国控、省控符号表示771 let labelingInfo = [];772 if (renderType.indexOf('numrender')!=-1) {773 labelingInfo.push(ycLabelClass)774 }775 if(renderType.indexOf('namerender')!=-1) {776 labelingInfo.push(nameClass)777 }778 let ycPointFeaLayer = new FeatureLayer({779 fields: queryFields.map(function (field) {780 return Field.fromJSON(field)781 }),782 // opacity:"0.8",783 id: 'ycPointFeaLayer',784 objectIdField: oidFieldName,785 geometryType: 'point',786 popupEnabled:false,787 spatialReference: new SpatialReference(4326),788 source: graphics,789 labelingInfo: labelingInfo,790 elevationInfo: {791 mode: 'on-the-ground'792 },793 renderer: feaRenderer794 })795 // 不使用默认的图层的popup模板796 ycPointFeaLayer.popupTemplate = popupTemplate797 // 加载script为异步方法798 callBack(ycPointFeaLayer, geometryExtent)799 }800 else{801 callBack(null,null)802 }803 }).catch(function (error) {804 callBack(null,null)805 // console.log(error)806 })807}808/**809 * 绘制污染事件810 */811export const createWrsjGraphics = function (graphicResults, callBack, curMapView,selectedStationTypeId) {812 loadModules(['esri/layers/FeatureLayer', 'esri/layers/support/Field', 'esri/geometry/SpatialReference', 'esri/Graphic', 'esri/layers/support/LabelClass', 'esri/geometry/Extent'])813 .then(([FeatureLayer, Field, SpatialReference, Graphic, LabelClass, Extent]) => {814 // 根据查询获取的数据在前端构建空气站点featurelayer图层815 let queryFields = dataRequestUrl.options.wrsjListInfo.queryFields816 let oidFieldName = queryFields[0].name817 // 事件状态 处理中0/已完成1/已办结2818 let renderInfo = dataRequestUrl.options.wrsjListInfo.renderInfo819 /*820 let feaRenderer = {821 type: "simple", // autocasts as new UniqueValueRenderer()822 symbol: {823 type: renderInfo.defaultSymbol.type,824 url: wry,825 width: renderInfo.defaultSymbol.width,826 height: renderInfo.defaultSymbol.height827 // xoffset: renderInfo.defaultSymbol.xoffset828 }829 }830 */831 let feaRenderer = {832 type: "simple", // autocasts as new UniqueValueRenderer() renderInfo.type833 symbol: {834 type: renderInfo.defaultSymbol.type,835 url: wrsj,836 width: renderInfo.defaultSymbol.width,837 height: renderInfo.defaultSymbol.height838 // xoffset: renderInfo.defaultSymbol.xoffset839 }840 }841 // 站点名称标注842 let nameArcade = '$feature.eventName' || ''843 let nameClass = createNameLabelClass(nameArcade);844 // end*****************************创建AQI的文本标注和站点名称标注845 // 构建图层数据846 // 构建图层的字段信息847 let fieldInfos = getFieldsInfo(queryFields)848 // 排序获取数据的范围849 //let geometryExtent = calculateMapInitExtent(graphicResults)850 let geometryExtent;851 let graphics = []852 for (let m = 0; m < graphicResults.length; m++) {853 let stationItem = graphicResults[m]854 if (stationItem.longitude != null && stationItem.latitude != null) {855 let pointGeometry = {856 type: 'point',857 x: stationItem.longitude,858 y: stationItem.latitude859 }860 stationItem.OBJECTID = m + 1861 //增加临时typeid862 stationItem.stationTypeId = selectedStationTypeId;863 let graphic = new Graphic({864 geometry: pointGeometry,865 attributes: stationItem866 })867 graphics.push(graphic)868 }869 }870 if(graphics && graphics.length>0){871 // 实例化一个弹出框872 let popupTemplate = {873 // title:"站点{"+oidFieldName+"}",874 title: '',875 fieldInfos: fieldInfos876 // content:setPopContentInfo877 }878 // 根据查询结果实例化一个featurelayer,只用国控、省控符号表示879 let wrsjPointFeaLayer = new FeatureLayer({880 fields: queryFields.map(function (field) {881 return Field.fromJSON(field)882 }),883 // opacity:"0.8",884 id: 'wrsjPointFeaLayer',885 objectIdField: oidFieldName,886 geometryType: 'point',887 popupEnabled:false,888 spatialReference: new SpatialReference(4326),889 source: graphics,890 //labelingInfo: [nameClass],891 elevationInfo: {892 mode: 'on-the-ground'893 },894 renderer: feaRenderer895 })896 // 不使用默认的图层的popup模板897 wrsjPointFeaLayer.popupTemplate = popupTemplate898 // 加载script为异步方法899 callBack(wrsjPointFeaLayer, geometryExtent)900 }901 else{902 callBack(null,null)903 }904 }).catch(function (error) {905 callBack(null,null)906 // console.log(error)907 })908}909/*910*构建图层的字段信息911*/912export const getFieldsInfo = function (queryFields) {913 let fieldInfos = []914 for (let fieldIndex in queryFields) {915 let fieldInfo = {916 fieldName: queryFields[fieldIndex].name,917 visible: true,918 label: queryFields[fieldIndex].alias,919 format: {920 places: 0,921 digitSeparator: true922 }}923 fieldInfos.push(fieldInfo)924 }925 return fieldInfos926}927// 需要根据弹窗的内容去定制html928export const setPopContentInfo = function (feature) {929 let aqiValue = feature.graphic.attributes.aqi930 return "<div style='text-align:left'>AQI " + aqiValue + '(2019-03-12 12:09)<br/>' + '实时数据<br/>' + '<p>PM2.5 PM10 SO2 CO</p>' + '24小时数据</div>'931}932function compare (val1, val2) {933 return val1 - val2934};935// 返回地图的初始范围936export const calculateMapInitExtent = function (graphicResults) {937 let xList = []938 let yList = []939 let geometryExtent = null940 for (let m = 0; m < graphicResults.length; m++) {941 let stationItem = graphicResults[m]942 if (stationItem.longitude != null && stationItem.latitude != null) {943 xList.push(stationItem.longitude)944 yList.push(stationItem.latitude)945 }946 }947 if (xList.length > 1) {948 xList.sort(compare)949 yList.sort(compare)950 let extentXmin = xList[0]951 let extentXmax = xList[xList.length - 1]952 let extentYmin = yList[0]953 let extentYmax = yList[yList.length - 1]954 geometryExtent = {955 // autocasts as new Extent()956 xmin: extentXmin,957 ymin: extentYmin,958 xmax: extentXmax,959 ymax: extentYmax,960 spatialReference: { wkid: 4326 }961 }962 }963 return geometryExtent...

Full Screen

Full Screen

ArrayArbitrary.ts

Source:ArrayArbitrary.ts Github

copy

Full Screen

...236 );237 }238 return shrinks;239 }240 private shrinkImpl(value: T[], context?: unknown): Stream<[Value<T>[], unknown, number]> {241 if (value.length === 0) {242 return Stream.nil();243 }244 const safeContext: ArrayArbitraryContext =245 context !== undefined246 ? (context as ArrayArbitraryContext)247 : { shrunkOnce: false, lengthContext: undefined, itemsContexts: [], startIndex: 0 };248 return (249 this.lengthArb250 .shrink(251 value.length,252 // lengthContext is a context returned by a previous call to the integer253 // arbitrary and the integer value items.length.254 safeContext.lengthContext255 )256 // in case we already shrunk once but don't have any dedicated context to help the shrinker, we drop the first item257 // except if reached we have the minimal size +1, in that case we apply a last chance try policy258 .drop(259 safeContext.shrunkOnce && safeContext.lengthContext === undefined && value.length > this.minLength + 1 ? 1 : 0260 )261 .map((lengthValue): [Value<T>[], unknown, number] => {262 const sliceStart = value.length - lengthValue.value;263 return [264 safeMap(265 safeSlice(value, sliceStart),266 (v, index) => new Value(cloneIfNeeded(v), safeContext.itemsContexts[index + sliceStart])267 ), // array of length lengthValue.value268 lengthValue.context, // integer context for value lengthValue.value (the length)269 0,270 ];271 })272 // Length context value will be set to undefined for remaining shrinking values273 // as they are outside of our shrinking process focused on items.length.274 // None of our computed contexts will apply for them.275 .join(276 makeLazy(() =>277 value.length > this.minLength278 ? this.shrinkItemByItem(value, safeContext, 1)279 : this.shrinkItemByItem(value, safeContext, value.length)280 )281 )282 .join(283 value.length > this.minLength284 ? makeLazy(() => {285 // We pass itemsLengthContext=undefined to next shrinker to start shrinking286 // without any assumptions on the current state (we never explored that one)287 const subContext: ArrayArbitraryContext = {288 shrunkOnce: false,289 lengthContext: undefined,290 itemsContexts: safeSlice(safeContext.itemsContexts, 1),291 startIndex: 0,292 };293 return this.shrinkImpl(safeSlice(value, 1), subContext)294 .filter((v) => this.minLength <= v[0].length + 1)295 .map((v): [Value<T>[], unknown, number] => {296 return [[new Value(cloneIfNeeded(value[0]), safeContext.itemsContexts[0]), ...v[0]], undefined, 0];297 });298 })299 : Stream.nil()300 )301 );302 }303 shrink(value: T[], context?: unknown): Stream<Value<T[]>> {304 return this.shrinkImpl(value, context).map((contextualValue) =>305 this.wrapper(contextualValue[0], true, contextualValue[1], contextualValue[2])306 );307 }...

Full Screen

Full Screen

CloneArbitrary.ts

Source:CloneArbitrary.ts Github

copy

Full Screen

...44 shrink(value: T[], context?: unknown): Stream<Value<T[]>> {45 if (value.length === 0) {46 return Stream.nil();47 }48 return new Stream(this.shrinkImpl(value, context !== undefined ? (context as unknown[]) : [])).map((v) =>49 this.wrapper(v)50 );51 }52 private *shrinkImpl(value: T[], contexts: unknown[]): IterableIterator<Value<T>[]> {53 const its = safeMap(value, (v, idx) => this.arb.shrink(v, contexts[idx])[safeSymbolIterator]());54 let cur = safeMap(its, (it) => it.next());55 while (!cur[0].done) {56 yield safeMap(cur, (c) => c.value);57 cur = safeMap(its, (it) => it.next());58 }59 }60 private static makeItCloneable<T>(vs: T[], shrinkables: Value<T>[]) {61 (vs as any)[cloneMethod] = () => {62 const cloned: T[] = [];63 for (let idx = 0; idx !== shrinkables.length; ++idx) {64 safePush(cloned, shrinkables[idx].value); // push potentially cloned values65 }66 this.makeItCloneable(cloned, shrinkables);...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { shrinkImpl } = require('fast-check');2const { shrinkNumber } = require('fast-check/lib/arbitrary/number/NumberArbitrary');3const { Shrinkable } = require('fast-check/lib/check/arbitrary/definition/Shrinkable');4const shrunk = shrinkImpl(new Shrinkable(100, shrinkNumber()), 10);5console.log(shrunk);6const { shrinkImpl } = require('fast-check');7const { shrinkNumber } = require('fast-check/lib/arbitrary/number/NumberArbitrary');8const { Shrinkable } = require('fast-check/lib/check/arbitrary/definition/Shrinkable');9const shrunk = shrinkImpl(new Shrinkable(100, shrinkNumber()), 10);10console.log(shrinkImpl(shrunk, 10));11const { shrinkImpl } = require('fast-check');12const { shrinkNumber } = require('fast-check/lib/arbitrary/number/NumberArbitrary');13const { Shrinkable } = require('fast-check/lib/check/arbitrary/definition/Shrinkable');14const shrunk = shrinkImpl(new Shrinkable(100, shrinkNumber()), 10);15console.log(shrinkImpl(shrunk, 10));16const { shrinkImpl } = require('fast-check');17const { shrinkNumber } = require('fast-check/lib/arbitrary/number/NumberArbitrary');18const { Shrinkable } = require('fast-check/lib/check/arbitrary/definition/Shrinkable');19const shrunk = shrinkImpl(new Shrinkable(100, shrinkNumber()), 10);20console.log(shrinkImpl(shrunk, 10));21const { shrinkImpl } = require('fast-check');22const { shrinkNumber } = require('fast-check/lib/arbitrary/number/NumberArbitrary');23const { Shrinkable } = require('fast-check/lib/check/arbitrary/definition/Shrinkable');24const shrunk = shrinkImpl(new Shrinkable(100, shrinkNumber()), 10);25console.log(shrinkImpl(shrunk, 10));

Full Screen

Using AI Code Generation

copy

Full Screen

1const { shrinkImpl } = require('fast-check');2const { shrinkString } = require('fast-check/lib/arbitrary/_internals/Shrinkable.js');3const shrunk = shrinkImpl(shrinkString, 'abc');4console.log(shrunk);5import { observable } from 'mobx-react';6class Test {7 value = 1;8}9describe('Test', () => {10 it('should be able to get the value', () => {11 const test = new Test();12 expect(test.value).toBe(1);13 });14});15 at Test.value [as value] (node_modules/mobx-react/dist/mobxreact.cjs.js:104:19)16 at Object.<anonymous> (src/components/Test.test.tsx:10:23)17jest.mock('mobx-react', () => ({18 observable: jest.fn()19}));20jest.mock('mobx-react', () => ({21 observable: jest.fn(() => jest.fn())22}));23I’m trying to run a test on a class that uses the @observable decorator from mobx-react. I’m using Jest to run the tests. The test is as follows: import { observable } from 'mobx-react'; class Test { @observable value = 1; } describe('Test', () => { it('should be able to get the value', () => { const test = new Test(); expect(test.value).toBe(1); }); }); When I run the test, I get the following error: TypeError: Cannot read property 'value' of undefined at Test.value [as value] (node_modules

Full Screen

Using AI Code Generation

copy

Full Screen

1const { shrinkImpl } = require ('fast-check');2const shrinkable = shrinkImpl(1, (x) => [x + 1, x + 2]);3const { shrinkImpl } = require ('fast-check');4const shrinkable = shrinkImpl(1, (x) => [x + 1, x + 2]);5const { shrinkImpl } = require ('fast-check');6const shrinkable = shrinkImpl(1, (x) => [x + 1, x + 2]);7const { shrinkImpl } = require ('fast-check');8const shrinkable = shrinkImpl(1, (x) => [x + 1, x + 2]);9const { shrinkImpl } = require ('fast-check');10const shrinkable = shrinkImpl(1, (x) => [x + 1, x + 2]);11const { shrinkImpl } = require ('

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require("fast-check");2const shrinkImpl = fc.shrinkImpl;3const shrinkInteger = fc.shrinkInteger;4const shrink = shrinkImpl(shrinkInteger);5const shrinked = shrink(10);6console.log(shrinked);

Full Screen

Using AI Code Generation

copy

Full Screen

1const shrinkImpl = require('fast-check-monorepo/lib/arbitrary/shrinkImpl').shrinkImpl;2const run = require('fast-check-monorepo/lib/check/run').run;3const shrinkable = shrinkImpl(1, (value) => value < 10, (value) => value + 1);4console.log(shrinkable.value);5console.log(shrinkable.shrink().value);6console.log(shrinkable.shrink().shrink().value);7const fc = require('fast-check-monorepo');8const myArb = fc.integer().between(1, 10);9run(myArb, 1000, { verbose: true }).then(() => console.log('done'));10const fc = require('fast-check-monorepo');11const myArb = fc.integer().between(1, 10);12fc.run(myArb, 1000, { verbose: true }).then(() => console.log('done'));13I have tried all the possible ways to import the shrinkImpl method from fast-check-monorepo, but it is not working. Can someone please help me with this?14let obj = { foo: 1, bar: 2, baz: 3 };15let newObj = Object.assign({}, obj, { foo: 4 });

Full Screen

Using AI Code Generation

copy

Full Screen

1import { shrinkImpl } from 'fast-check';2export const random = () => shrinkImpl(0, 1, 1, 0);3import { shrinkImpl } from 'fast-check';4export const random = () => shrinkImpl(0, 1, 1, 0);5import { shrinkImpl } from 'fast-check';6export const random = () => shrinkImpl(0, 1, 1, 0);7import { shrinkImpl } from 'fast-check';8export const random = () => shrinkImpl(0, 1, 1, 0);9import { shrinkImpl } from 'fast-check';10export const random = () => shrinkImpl(0, 1, 1, 0);11import { shrinkImpl } from 'fast-check';12export const random = () => shrinkImpl(0, 1, 1, 0);13import { shrinkImpl } from 'fast-check';14export const random = () => shrinkImpl(0, 1, 1, 0);15import { shrinkImpl } from 'fast-check';16export const random = () => shrinkImpl(0, 1, 1, 0);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fast-check-monorepo automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful