Best JavaScript code snippet using fast-check-monorepo
protocol.js
Source:protocol.js
1/**2 *3 author senpure4 version 2019-9-24 16:34:595 enum : Example.EchoEnum Echoä¸çä¸ä¸ªenum6 bean : Example.Echo7 bean : Example.EchoBean Echoä¸çä¸ä¸ªbean8 bean : Example.Sample9 message : Example.CSEchoMessage 100010310 message : Example.SCEchoMessage 100010411 message : Example.CSSampleMessage 100010512 message : Example.SCSampleMessage 100010613 message : Example.CSSampleLongMessage 100010714 message : Example.SCSampleLongMessage 100010815 message : Example.CSSampleStrMessage 100010916 message : Example.SCSampleStrMessage 100011017 */18Example = {};19/**20 *21 *Echoä¸çä¸ä¸ªenum22 */23Example.EchoEnum = {24 X: 1,25 Y: 2,26 UNKNOWN: -1,27 echoEnumValues: {28 1: 1,29 2: 230 },31 echoEnumStr: {32 1: "X",33 2: "Y"34 },35 checkReadValue: function (value) {36 var v = Example.EchoEnum.echoEnumValues[value];37 if (v != null) {38 return v;39 } else {40 return -1;41 }42 },43 valueToStr: function (value) {44 var v = Example.EchoEnum.echoEnumStr[value];45 if (v != null) {46 return v;47 } else {48 return "UNKNOWN";49 }50 }51};52Example.Echo = function () {53 //ç±»å:boolean booleanValue54 this.booleanValue = false;55 //list:boolean booleanValues56 this.booleanValues = new Array(0);57 //ç±»å:int intValue58 this.intValue = 0;59 //list:int intValues60 this.intValues = new Array(0);61 //ç±»å:long longValue62 this.longValue = 0;63 //list:long longValues64 this.longValues = new Array(0);65 //ç±»å:int sintValue66 this.sintValue = 0;67 //list:int sintValues68 this.sintValues = new Array(0);69 //ç±»å:long slongValue70 this.slongValue = 0;71 //list:long slongValues72 this.slongValues = new Array(0);73 //ç±»å:float floatValue74 this.floatValue = 0;75 //list:float floatValues76 this.floatValues = new Array(0);77 //ç±»å:double doubleValue78 this.doubleValue = 0;79 //list:double doubleValues80 this.doubleValues = new Array(0);81 //ç±»å:int fixed32Value82 this.fixed32Value = 0;83 //list:int fixed32Values84 this.fixed32Values = new Array(0);85 //ç±»å:long fixed64Value86 this.fixed64Value = 0;87 //list:long fixed64Values88 this.fixed64Values = new Array(0);89 //ç±»å:String stringValue90 this.stringValue = null;91 //list:String stringValues92 this.stringValues = new Array(0);93 //ç±»å:Example.EchoBean beanValue94 this.beanValue = null;95 //list:Example.EchoBean beanValues96 this.beanValues = new Array(0);97 //ç±»å:Example.EchoEnum enumValue98 this.enumValue = Example.EchoEnum.X;99 //list:Example.EchoEnum enumValues100 this.enumValues = new Array(0);101 //ç±»å:boolean 102 this.booleanValue2 = false;103 //list:boolean 104 this.booleanValues2 = new Array(0);105 //ç±»å:int 106 this.intValue2 = 0;107 //list:int 108 this.intValues2 = new Array(0);109 //ç±»å:long 110 this.longValue2 = 0;111 //list:long 112 this.longValues2 = new Array(0);113 //ç±»å:int 114 this.sintValue2 = 0;115 //list:int 116 this.sintValues2 = new Array(0);117 //ç±»å:long 118 this.slongValue2 = 0;119 //list:long 120 this.slongValues2 = new Array(0);121 //ç±»å:float 122 this.floatValue2 = 0;123 //list:float 124 this.floatValues2 = new Array(0);125 //ç±»å:double 126 this.doubleValue2 = 0;127 //list:double 128 this.doubleValues2 = new Array(0);129 //ç±»å:int 130 this.fixed32Value2 = 0;131 //list:int 132 this.fixed32Values2 = new Array(0);133 //ç±»å:long 134 this.fixed64Value2 = 0;135 //list:long 136 this.fixed64Values2 = new Array(0);137 //ç±»å:String 138 this.stringValue2 = null;139 //list:String 140 this.stringValues2 = new Array(0);141 //ç±»å:Example.EchoBean 142 this.beanValue2 = null;143 //list:Example.EchoBean 144 this.beanValues2 = new Array(0);145 //ç±»å:Example.EchoEnum 146 this.enumValue2 = Example.EchoEnum.X;147 //list:Example.EchoEnum 148 this.enumValues2 = new Array(0);149 this.serializedSize = -1;150 this.booleanValuesSerializedSize = 0;151 this.intValuesSerializedSize = 0;152 this.longValuesSerializedSize = 0;153 this.sintValuesSerializedSize = 0;154 this.slongValuesSerializedSize = 0;155 this.floatValuesSerializedSize = 0;156 this.doubleValuesSerializedSize = 0;157 this.fixed32ValuesSerializedSize = 0;158 this.fixed64ValuesSerializedSize = 0;159 this.enumValuesSerializedSize = 0;160 this.booleanValues2SerializedSize = 0;161 this.intValues2SerializedSize = 0;162 this.longValues2SerializedSize = 0;163 this.sintValues2SerializedSize = 0;164 this.slongValues2SerializedSize = 0;165 this.floatValues2SerializedSize = 0;166 this.doubleValues2SerializedSize = 0;167 this.fixed32Values2SerializedSize = 0;168 this.fixed64Values2SerializedSize = 0;169 this.enumValues2SerializedSize = 0;170 //缩è¿14 + 3 = 17 ä¸ªç©ºæ ¼171 this._next_indent = " ";172 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦173 this._filedPad = 14;174};175//Example.Echoåå
¥åèç¼å176Example.Echo.prototype.write = function (buf) {177 this.getSerializedSize();178 //booleanValue179 if (this.booleanValue != null) {180 buf.writeBooleanField(8, this.booleanValue);181 }182 //booleanValues183 var booleanValues_len = this.booleanValues.length;184 if (booleanValues_len > 0) {185 buf.writeVar32(19);186 buf.writeVar32(this.booleanValuesSerializedSize);187 for (var i = 0; i < booleanValues_len; i++) {188 buf.writeBoolean(this.booleanValues[i]);189 }190 }191 //intValue192 if (this.intValue != null) {193 buf.writeVar32Field(24, this.intValue);194 }195 //intValues196 var intValues_len = this.intValues.length;197 if (intValues_len > 0) {198 buf.writeVar32(35);199 buf.writeVar32(this.intValuesSerializedSize);200 for (var i = 0; i < intValues_len; i++) {201 buf.writeVar32(this.intValues[i]);202 }203 }204 //longValue205 if (this.longValue != null) {206 buf.writeVar64Field(40, this.longValue);207 }208 //longValues209 var longValues_len = this.longValues.length;210 if (longValues_len > 0) {211 buf.writeVar32(51);212 buf.writeVar32(this.longValuesSerializedSize);213 for (var i = 0; i < longValues_len; i++) {214 buf.writeVar64(this.longValues[i]);215 }216 }217 //sintValue218 if (this.sintValue != null) {219 buf.writeSintField(56, this.sintValue);220 }221 //sintValues222 var sintValues_len = this.sintValues.length;223 if (sintValues_len > 0) {224 buf.writeVar32(67);225 buf.writeVar32(this.sintValuesSerializedSize);226 for (var i = 0; i < sintValues_len; i++) {227 buf.writeSint(this.sintValues[i]);228 }229 }230 //slongValue231 if (this.slongValue != null) {232 buf.writeSlongField(72, this.slongValue);233 }234 //slongValues235 var slongValues_len = this.slongValues.length;236 if (slongValues_len > 0) {237 buf.writeVar32(83);238 buf.writeVar32(this.slongValuesSerializedSize);239 for (var i = 0; i < slongValues_len; i++) {240 buf.writeSlong(this.slongValues[i]);241 }242 }243 //floatValue244 if (this.floatValue != null) {245 buf.writeFloatField(89, this.floatValue);246 }247 //floatValues248 var floatValues_len = this.floatValues.length;249 if (floatValues_len > 0) {250 buf.writeVar32(99);251 buf.writeVar32(this.floatValuesSerializedSize);252 for (var i = 0; i < floatValues_len; i++) {253 buf.writeFloat(this.floatValues[i]);254 }255 }256 //doubleValue257 if (this.doubleValue != null) {258 buf.writeDoubleField(106, this.doubleValue);259 }260 //doubleValues261 var doubleValues_len = this.doubleValues.length;262 if (doubleValues_len > 0) {263 buf.writeVar32(115);264 buf.writeVar32(this.doubleValuesSerializedSize);265 for (var i = 0; i < doubleValues_len; i++) {266 buf.writeDouble(this.doubleValues[i]);267 }268 }269 //fixed32Value270 if (this.fixed32Value != null) {271 buf.writeFixed32Field(121, this.fixed32Value);272 }273 //fixed32Values274 var fixed32Values_len = this.fixed32Values.length;275 if (fixed32Values_len > 0) {276 buf.writeVar32(131);277 buf.writeVar32(this.fixed32ValuesSerializedSize);278 for (var i = 0; i < fixed32Values_len; i++) {279 buf.writeFixed32(this.fixed32Values[i]);280 }281 }282 //fixed64Value283 if (this.fixed64Value != null) {284 buf.writeFixed64Field(138, this.fixed64Value);285 }286 //fixed64Values287 var fixed64Values_len = this.fixed64Values.length;288 if (fixed64Values_len > 0) {289 buf.writeVar32(147);290 buf.writeVar32(this.fixed64ValuesSerializedSize);291 for (var i = 0; i < fixed64Values_len; i++) {292 buf.writeFixed64(this.fixed64Values[i]);293 }294 }295 //stringValue296 if (this.stringValue != null) {297 buf.writeStringField(155, this.stringValue);298 }299 //stringValues300 var stringValues_len = this.stringValues.length;301 for (var i = 0; stringValues_len; i++) {302 buf.writeStringField(163, this.stringValues[i]);303 }304 //beanValue305 if (this.beanValue != null) {306 buf.writeVar32(171);307 buf.writeVar32(this.beanValue.getSerializedSize());308 this.beanValue.write(buf);309 }310 //beanValues311 var beanValues_len = this.beanValues.length;312 if (beanValues_len > 0) {313 for (i = 0; i < beanValues_len; i++) {314 buf.writeVar32(179);315 buf.writeVar32(this.beanValues[i].getSerializedSize());316 this.beanValues[i].write(buf);317 }318 }319 //enumValue320 if (this.enumValue != null) {321 buf.writeVar32(187, this.enumValue);322 }323 //enumValues324 var enumValues_len = this.enumValues.length;325 if (enumValues_len > 0) {326 buf.writeVar32(195);327 buf.writeVar32(this.enumValuesSerializedSize);328 for (i = 0; i < enumValues_len; i++) {329 buf.writeVar32(this.enumValues[i]);330 }331 }332 if (this.booleanValue2 != null) {333 buf.writeBooleanField(200, this.booleanValue2);334 }335 var booleanValues2_len = this.booleanValues2.length;336 if (booleanValues2_len > 0) {337 buf.writeVar32(211);338 buf.writeVar32(this.booleanValues2SerializedSize);339 for (var i = 0; i < booleanValues2_len; i++) {340 buf.writeBoolean(this.booleanValues2[i]);341 }342 }343 if (this.intValue2 != null) {344 buf.writeVar32Field(216, this.intValue2);345 }346 var intValues2_len = this.intValues2.length;347 if (intValues2_len > 0) {348 buf.writeVar32(227);349 buf.writeVar32(this.intValues2SerializedSize);350 for (var i = 0; i < intValues2_len; i++) {351 buf.writeVar32(this.intValues2[i]);352 }353 }354 if (this.longValue2 != null) {355 buf.writeVar64Field(232, this.longValue2);356 }357 var longValues2_len = this.longValues2.length;358 if (longValues2_len > 0) {359 buf.writeVar32(243);360 buf.writeVar32(this.longValues2SerializedSize);361 for (var i = 0; i < longValues2_len; i++) {362 buf.writeVar64(this.longValues2[i]);363 }364 }365 if (this.sintValue2 != null) {366 buf.writeSintField(248, this.sintValue2);367 }368 var sintValues2_len = this.sintValues2.length;369 if (sintValues2_len > 0) {370 buf.writeVar32(259);371 buf.writeVar32(this.sintValues2SerializedSize);372 for (var i = 0; i < sintValues2_len; i++) {373 buf.writeSint(this.sintValues2[i]);374 }375 }376 if (this.slongValue2 != null) {377 buf.writeSlongField(264, this.slongValue2);378 }379 var slongValues2_len = this.slongValues2.length;380 if (slongValues2_len > 0) {381 buf.writeVar32(275);382 buf.writeVar32(this.slongValues2SerializedSize);383 for (var i = 0; i < slongValues2_len; i++) {384 buf.writeSlong(this.slongValues2[i]);385 }386 }387 if (this.floatValue2 != null) {388 buf.writeFloatField(281, this.floatValue2);389 }390 var floatValues2_len = this.floatValues2.length;391 if (floatValues2_len > 0) {392 buf.writeVar32(291);393 buf.writeVar32(this.floatValues2SerializedSize);394 for (var i = 0; i < floatValues2_len; i++) {395 buf.writeFloat(this.floatValues2[i]);396 }397 }398 if (this.doubleValue2 != null) {399 buf.writeDoubleField(298, this.doubleValue2);400 }401 var doubleValues2_len = this.doubleValues2.length;402 if (doubleValues2_len > 0) {403 buf.writeVar32(307);404 buf.writeVar32(this.doubleValues2SerializedSize);405 for (var i = 0; i < doubleValues2_len; i++) {406 buf.writeDouble(this.doubleValues2[i]);407 }408 }409 if (this.fixed32Value2 != null) {410 buf.writeFixed32Field(313, this.fixed32Value2);411 }412 var fixed32Values2_len = this.fixed32Values2.length;413 if (fixed32Values2_len > 0) {414 buf.writeVar32(323);415 buf.writeVar32(this.fixed32Values2SerializedSize);416 for (var i = 0; i < fixed32Values2_len; i++) {417 buf.writeFixed32(this.fixed32Values2[i]);418 }419 }420 if (this.fixed64Value2 != null) {421 buf.writeFixed64Field(330, this.fixed64Value2);422 }423 var fixed64Values2_len = this.fixed64Values2.length;424 if (fixed64Values2_len > 0) {425 buf.writeVar32(339);426 buf.writeVar32(this.fixed64Values2SerializedSize);427 for (var i = 0; i < fixed64Values2_len; i++) {428 buf.writeFixed64(this.fixed64Values2[i]);429 }430 }431 if (this.stringValue2 != null) {432 buf.writeStringField(347, this.stringValue2);433 }434 var stringValues2_len = this.stringValues2.length;435 for (var i = 0; stringValues2_len; i++) {436 buf.writeStringField(355, this.stringValues2[i]);437 }438 if (this.beanValue2 != null) {439 buf.writeVar32(363);440 buf.writeVar32(this.beanValue2.getSerializedSize());441 this.beanValue2.write(buf);442 }443 var beanValues2_len = this.beanValues2.length;444 if (beanValues2_len > 0) {445 for (i = 0; i < beanValues2_len; i++) {446 buf.writeVar32(371);447 buf.writeVar32(this.beanValues2[i].getSerializedSize());448 this.beanValues2[i].write(buf);449 }450 }451 if (this.enumValue2 != null) {452 buf.writeVar32(379, this.enumValue2);453 }454 var enumValues2_len = this.enumValues2.length;455 if (enumValues2_len > 0) {456 buf.writeVar32(387);457 buf.writeVar32(this.enumValues2SerializedSize);458 for (i = 0; i < enumValues2_len; i++) {459 buf.writeVar32(this.enumValues2[i]);460 }461 }462};463//Example.Echo读ååèç¼å464Example.Echo.prototype.read = function (buf, endIndex) {465 while (true) {466 var tag = buf.readTag(endIndex);467 switch (tag) {468 case 0://end469 return;470 //booleanValue471 // 1 << 3 | 0472 case 8 :473 this.booleanValue = buf.readBoolean();474 break;475 //booleanValues476 // 2 << 3 | 3477 case 19 :478 var booleanValuesDataSize = buf.readVar32();479 var receiveBooleanValuesDataSize = 0;480 while (receiveBooleanValuesDataSize < booleanValuesDataSize) {481 var tempBooleanValues = buf.readBoolean();482 this.booleanValues.push(tempBooleanValues);483 }484 break;485 //intValue486 // 3 << 3 | 0487 case 24 :488 this.intValue = buf.readVar32();489 break;490 //intValues491 // 4 << 3 | 3492 case 35 :493 var intValuesDataSize = buf.readVar32();494 var receiveIntValuesDataSize = 0;495 while (receiveIntValuesDataSize < intValuesDataSize) {496 var tempIntValues = buf.readVar32();497 this.intValues.push(tempIntValues);498 }499 break;500 //longValue501 // 5 << 3 | 0502 case 40 :503 this.longValue = buf.readVar64();504 break;505 //longValues506 // 6 << 3 | 3507 case 51 :508 var longValuesDataSize = buf.readVar32();509 var receiveLongValuesDataSize = 0;510 while (receiveLongValuesDataSize < longValuesDataSize) {511 var tempLongValues = buf.readVar64();512 this.longValues.push(tempLongValues);513 }514 break;515 //sintValue516 // 7 << 3 | 0517 case 56 :518 this.sintValue = buf.readSint();519 break;520 //sintValues521 // 8 << 3 | 3522 case 67 :523 var sintValuesDataSize = buf.readVar32();524 var receiveSintValuesDataSize = 0;525 while (receiveSintValuesDataSize < sintValuesDataSize) {526 var tempSintValues = buf.readSint();527 this.sintValues.push(tempSintValues);528 }529 break;530 //slongValue531 // 9 << 3 | 0532 case 72 :533 this.slongValue = buf.readSlong();534 break;535 //slongValues536 // 10 << 3 | 3537 case 83 :538 var slongValuesDataSize = buf.readVar32();539 var receiveSlongValuesDataSize = 0;540 while (receiveSlongValuesDataSize < slongValuesDataSize) {541 var tempSlongValues = buf.readSlong();542 this.slongValues.push(tempSlongValues);543 }544 break;545 //floatValue546 // 11 << 3 | 1547 case 89 :548 this.floatValue = buf.readFloat();549 break;550 //floatValues551 // 12 << 3 | 3552 case 99 :553 var floatValuesDataSize = buf.readVar32();554 var receiveFloatValuesDataSize = 0;555 while (receiveFloatValuesDataSize < floatValuesDataSize) {556 var tempFloatValues = buf.readFloat();557 this.floatValues.push(tempFloatValues);558 }559 break;560 //doubleValue561 // 13 << 3 | 2562 case 106 :563 this.doubleValue = buf.readDouble();564 break;565 //doubleValues566 // 14 << 3 | 3567 case 115 :568 var doubleValuesDataSize = buf.readVar32();569 var receiveDoubleValuesDataSize = 0;570 while (receiveDoubleValuesDataSize < doubleValuesDataSize) {571 var tempDoubleValues = buf.readDouble();572 this.doubleValues.push(tempDoubleValues);573 }574 break;575 //fixed32Value576 // 15 << 3 | 1577 case 121 :578 this.fixed32Value = buf.readFixed32();579 break;580 //fixed32Values581 // 16 << 3 | 3582 case 131 :583 var fixed32ValuesDataSize = buf.readVar32();584 var receiveFixed32ValuesDataSize = 0;585 while (receiveFixed32ValuesDataSize < fixed32ValuesDataSize) {586 var tempFixed32Values = buf.readFixed32();587 this.fixed32Values.push(tempFixed32Values);588 }589 break;590 //fixed64Value591 // 17 << 3 | 2592 case 138 :593 this.fixed64Value = buf.readFixed64();594 break;595 //fixed64Values596 // 18 << 3 | 3597 case 147 :598 var fixed64ValuesDataSize = buf.readVar32();599 var receiveFixed64ValuesDataSize = 0;600 while (receiveFixed64ValuesDataSize < fixed64ValuesDataSize) {601 var tempFixed64Values = buf.readFixed64();602 this.fixed64Values.push(tempFixed64Values);603 }604 break;605 //stringValue606 // 19 << 3 | 3607 case 155 :608 this.stringValue = buf.readString();609 break;610 //stringValues611 // 20 << 3 | 3612 case 163 :613 this.stringValues.push(buf.readString());614 break;615 //beanValue616 // 21 << 3 | 3617 case 171 :618 this.beanValue = new Example.EchoBean();619 this.beanValue.read(buf, buf.readVar32() + buf.getReaderIndex());620 break;621 //beanValues622 // 22 << 3 | 3623 case 179 :624 var tempExampleBeanValuesBean = new Example.EchoBean();625 tempExampleBeanValuesBean.read(buf, buf.readVar32() + buf.getReaderIndex());626 this.beanValues.push(tempExampleBeanValuesBean);627 break;628 //enumValue629 // 23 << 3 | 3630 case 187 :631 this.enumValue = Example.EchoEnum.checkReadValue(buf.readVar32());632 break;633 //enumValues634 // 24 << 3 | 3635 case 195 :636 var enumValuesDataSize = buf.readVar32();637 var receiveEnumValuesDataSize = 0;638 while (receiveEnumValuesDataSize < enumValuesDataSize) {639 var tempEnumValues = buf.readVar32();640 receiveEnumValuesDataSize = receiveEnumValuesDataSize + io.computeVar32Size(tempEnumValues);641 this.enumValues.push(Example.EchoEnum.checkReadValue(tempEnumValues));642 }643 break;644 // 25 << 3 | 0645 case 200 :646 this.booleanValue2 = buf.readBoolean();647 break;648 // 26 << 3 | 3649 case 211 :650 var booleanValues2DataSize = buf.readVar32();651 var receiveBooleanValues2DataSize = 0;652 while (receiveBooleanValues2DataSize < booleanValues2DataSize) {653 var tempBooleanValues2 = buf.readBoolean();654 this.booleanValues2.push(tempBooleanValues2);655 }656 break;657 // 27 << 3 | 0658 case 216 :659 this.intValue2 = buf.readVar32();660 break;661 // 28 << 3 | 3662 case 227 :663 var intValues2DataSize = buf.readVar32();664 var receiveIntValues2DataSize = 0;665 while (receiveIntValues2DataSize < intValues2DataSize) {666 var tempIntValues2 = buf.readVar32();667 this.intValues2.push(tempIntValues2);668 }669 break;670 // 29 << 3 | 0671 case 232 :672 this.longValue2 = buf.readVar64();673 break;674 // 30 << 3 | 3675 case 243 :676 var longValues2DataSize = buf.readVar32();677 var receiveLongValues2DataSize = 0;678 while (receiveLongValues2DataSize < longValues2DataSize) {679 var tempLongValues2 = buf.readVar64();680 this.longValues2.push(tempLongValues2);681 }682 break;683 // 31 << 3 | 0684 case 248 :685 this.sintValue2 = buf.readSint();686 break;687 // 32 << 3 | 3688 case 259 :689 var sintValues2DataSize = buf.readVar32();690 var receiveSintValues2DataSize = 0;691 while (receiveSintValues2DataSize < sintValues2DataSize) {692 var tempSintValues2 = buf.readSint();693 this.sintValues2.push(tempSintValues2);694 }695 break;696 // 33 << 3 | 0697 case 264 :698 this.slongValue2 = buf.readSlong();699 break;700 // 34 << 3 | 3701 case 275 :702 var slongValues2DataSize = buf.readVar32();703 var receiveSlongValues2DataSize = 0;704 while (receiveSlongValues2DataSize < slongValues2DataSize) {705 var tempSlongValues2 = buf.readSlong();706 this.slongValues2.push(tempSlongValues2);707 }708 break;709 // 35 << 3 | 1710 case 281 :711 this.floatValue2 = buf.readFloat();712 break;713 // 36 << 3 | 3714 case 291 :715 var floatValues2DataSize = buf.readVar32();716 var receiveFloatValues2DataSize = 0;717 while (receiveFloatValues2DataSize < floatValues2DataSize) {718 var tempFloatValues2 = buf.readFloat();719 this.floatValues2.push(tempFloatValues2);720 }721 break;722 // 37 << 3 | 2723 case 298 :724 this.doubleValue2 = buf.readDouble();725 break;726 // 38 << 3 | 3727 case 307 :728 var doubleValues2DataSize = buf.readVar32();729 var receiveDoubleValues2DataSize = 0;730 while (receiveDoubleValues2DataSize < doubleValues2DataSize) {731 var tempDoubleValues2 = buf.readDouble();732 this.doubleValues2.push(tempDoubleValues2);733 }734 break;735 // 39 << 3 | 1736 case 313 :737 this.fixed32Value2 = buf.readFixed32();738 break;739 // 40 << 3 | 3740 case 323 :741 var fixed32Values2DataSize = buf.readVar32();742 var receiveFixed32Values2DataSize = 0;743 while (receiveFixed32Values2DataSize < fixed32Values2DataSize) {744 var tempFixed32Values2 = buf.readFixed32();745 this.fixed32Values2.push(tempFixed32Values2);746 }747 break;748 // 41 << 3 | 2749 case 330 :750 this.fixed64Value2 = buf.readFixed64();751 break;752 // 42 << 3 | 3753 case 339 :754 var fixed64Values2DataSize = buf.readVar32();755 var receiveFixed64Values2DataSize = 0;756 while (receiveFixed64Values2DataSize < fixed64Values2DataSize) {757 var tempFixed64Values2 = buf.readFixed64();758 this.fixed64Values2.push(tempFixed64Values2);759 }760 break;761 // 43 << 3 | 3762 case 347 :763 this.stringValue2 = buf.readString();764 break;765 // 44 << 3 | 3766 case 355 :767 this.stringValues2.push(buf.readString());768 break;769 // 45 << 3 | 3770 case 363 :771 this.beanValue2 = new Example.EchoBean();772 this.beanValue2.read(buf, buf.readVar32() + buf.getReaderIndex());773 break;774 // 46 << 3 | 3775 case 371 :776 var tempExampleBeanValues2Bean = new Example.EchoBean();777 tempExampleBeanValues2Bean.read(buf, buf.readVar32() + buf.getReaderIndex());778 this.beanValues2.push(tempExampleBeanValues2Bean);779 break;780 // 47 << 3 | 3781 case 379 :782 this.enumValue2 = Example.EchoEnum.checkReadValue(buf.readVar32());783 break;784 // 48 << 3 | 3785 case 387 :786 var enumValues2DataSize = buf.readVar32();787 var receiveEnumValues2DataSize = 0;788 while (receiveEnumValues2DataSize < enumValues2DataSize) {789 var tempEnumValues2 = buf.readVar32();790 receiveEnumValues2DataSize = receiveEnumValues2DataSize + io.computeVar32Size(tempEnumValues2);791 this.enumValues2.push(Example.EchoEnum.checkReadValue(tempEnumValues2));792 }793 break;794 default://skip795 buf.skipTag(tag);796 break;797 }798 }799};800//Example.Echo计ç®åºåå大å°801Example.Echo.prototype.getSerializedSize = function () {802 var size = this.serializedSize;803 if (size > -1) {804 return size;805 }806 size = 0;807 //booleanValue808 if (this.booleanValue != null) {809 // tag size å·²ç»å®æäºè®¡ç® 8810 size += io.computeBooleanFieldSize(1, this.booleanValue);811 }812 //booleanValues813 var booleanValues_len = this.booleanValues.length;814 var booleanValuesDataSize = 0;815 for (var i = 0; i < booleanValues_len; i++) {816 booleanValuesDataSize += io.computeBooleanSize(this.booleanValues[i]);817 }818 this.booleanValuesSerializedSize = booleanValuesDataSize;819 if (booleanValuesDataSize > 0) {820 // tag size å·²ç»å®æäºè®¡ç® 19821 size += 1 + this.booleanValuesSerializedSize + io.computeVar32Size(this.booleanValuesSerializedSize);822 }823 //intValue824 if (this.intValue != null) {825 // tag size å·²ç»å®æäºè®¡ç® 24826 size += io.computeVar32FieldSize(1, this.intValue);827 }828 //intValues829 var intValues_len = this.intValues.length;830 var intValuesDataSize = 0;831 for (var i = 0; i < intValues_len; i++) {832 intValuesDataSize += io.computeVar32Size(this.intValues[i]);833 }834 this.intValuesSerializedSize = intValuesDataSize;835 if (intValuesDataSize > 0) {836 // tag size å·²ç»å®æäºè®¡ç® 35837 size += 1 + this.intValuesSerializedSize + io.computeVar32Size(this.intValuesSerializedSize);838 }839 //longValue840 if (this.longValue != null) {841 // tag size å·²ç»å®æäºè®¡ç® 40842 size += io.computeVar64FieldSize(1, this.longValue);843 }844 //longValues845 var longValues_len = this.longValues.length;846 var longValuesDataSize = 0;847 for (var i = 0; i < longValues_len; i++) {848 longValuesDataSize += io.computeVar64Size(this.longValues[i]);849 }850 this.longValuesSerializedSize = longValuesDataSize;851 if (longValuesDataSize > 0) {852 // tag size å·²ç»å®æäºè®¡ç® 51853 size += 1 + this.longValuesSerializedSize + io.computeVar32Size(this.longValuesSerializedSize);854 }855 //sintValue856 if (this.sintValue != null) {857 // tag size å·²ç»å®æäºè®¡ç® 56858 size += io.computeSintFieldSize(1, this.sintValue);859 }860 //sintValues861 var sintValues_len = this.sintValues.length;862 var sintValuesDataSize = 0;863 for (var i = 0; i < sintValues_len; i++) {864 sintValuesDataSize += io.computeSintSize(this.sintValues[i]);865 }866 this.sintValuesSerializedSize = sintValuesDataSize;867 if (sintValuesDataSize > 0) {868 // tag size å·²ç»å®æäºè®¡ç® 67869 size += 1 + this.sintValuesSerializedSize + io.computeVar32Size(this.sintValuesSerializedSize);870 }871 //slongValue872 if (this.slongValue != null) {873 // tag size å·²ç»å®æäºè®¡ç® 72874 size += io.computeSlongFieldSize(1, this.slongValue);875 }876 //slongValues877 var slongValues_len = this.slongValues.length;878 var slongValuesDataSize = 0;879 for (var i = 0; i < slongValues_len; i++) {880 slongValuesDataSize += io.computeSlongSize(this.slongValues[i]);881 }882 this.slongValuesSerializedSize = slongValuesDataSize;883 if (slongValuesDataSize > 0) {884 // tag size å·²ç»å®æäºè®¡ç® 83885 size += 1 + this.slongValuesSerializedSize + io.computeVar32Size(this.slongValuesSerializedSize);886 }887 //floatValue888 if (this.floatValue != null) {889 // tag size å·²ç»å®æäºè®¡ç® 89890 size += io.computeFloatFieldSize(1, this.floatValue);891 }892 //floatValues893 var floatValues_len = this.floatValues.length;894 var floatValuesDataSize = 0;895 for (var i = 0; i < floatValues_len; i++) {896 floatValuesDataSize += io.computeFloatSize(this.floatValues[i]);897 }898 this.floatValuesSerializedSize = floatValuesDataSize;899 if (floatValuesDataSize > 0) {900 // tag size å·²ç»å®æäºè®¡ç® 99901 size += 1 + this.floatValuesSerializedSize + io.computeVar32Size(this.floatValuesSerializedSize);902 }903 //doubleValue904 if (this.doubleValue != null) {905 // tag size å·²ç»å®æäºè®¡ç® 106906 size += io.computeDoubleFieldSize(1, this.doubleValue);907 }908 //doubleValues909 var doubleValues_len = this.doubleValues.length;910 var doubleValuesDataSize = 0;911 for (var i = 0; i < doubleValues_len; i++) {912 doubleValuesDataSize += io.computeDoubleSize(this.doubleValues[i]);913 }914 this.doubleValuesSerializedSize = doubleValuesDataSize;915 if (doubleValuesDataSize > 0) {916 // tag size å·²ç»å®æäºè®¡ç® 115917 size += 1 + this.doubleValuesSerializedSize + io.computeVar32Size(this.doubleValuesSerializedSize);918 }919 //fixed32Value920 if (this.fixed32Value != null) {921 // tag size å·²ç»å®æäºè®¡ç® 121922 size += io.computeFixed32FieldSize(1, this.fixed32Value);923 }924 //fixed32Values925 var fixed32Values_len = this.fixed32Values.length;926 var fixed32ValuesDataSize = 0;927 for (var i = 0; i < fixed32Values_len; i++) {928 fixed32ValuesDataSize += io.computeFixed32Size(this.fixed32Values[i]);929 }930 this.fixed32ValuesSerializedSize = fixed32ValuesDataSize;931 if (fixed32ValuesDataSize > 0) {932 // tag size å·²ç»å®æäºè®¡ç® 131933 size += 2 + this.fixed32ValuesSerializedSize + io.computeVar32Size(this.fixed32ValuesSerializedSize);934 }935 //fixed64Value936 if (this.fixed64Value != null) {937 // tag size å·²ç»å®æäºè®¡ç® 138938 size += io.computeFixed64FieldSize(2, this.fixed64Value);939 }940 //fixed64Values941 var fixed64Values_len = this.fixed64Values.length;942 var fixed64ValuesDataSize = 0;943 for (var i = 0; i < fixed64Values_len; i++) {944 fixed64ValuesDataSize += io.computeFixed64Size(this.fixed64Values[i]);945 }946 this.fixed64ValuesSerializedSize = fixed64ValuesDataSize;947 if (fixed64ValuesDataSize > 0) {948 // tag size å·²ç»å®æäºè®¡ç® 147949 size += 2 + this.fixed64ValuesSerializedSize + io.computeVar32Size(this.fixed64ValuesSerializedSize);950 }951 //stringValue952 if (this.stringValue != null) {953 // tag size å·²ç»å®æäºè®¡ç® 155954 size += io.computeStringFieldSize(2, this.stringValue);955 }956 //stringValues957 var stringValues_len = this.stringValues.length;958 if (stringValues_len > 0) {959 for (var i = 0; i < stringValues_len; i++) {960 //tag size å·²ç»å®æäºè®¡ç® 163961 size += 2 + io.computeStringSize(this.stringValues[i]);962 }963 }964 //beanValue965 if (this.beanValue != null) {966 var beanValueBeanSize = this.beanValue.getSerializedSize();967 // tag size å·²ç»å®æäºè®¡ç® 171968 size += beanValueBeanSize + io.computeVar32FieldSize(2, beanValueBeanSize);969 }970 //beanValues971 var beanValues_len = this.beanValues.length;972 for (var i = 0; i < beanValues_len; i++) {973 var beanValuesBeanSize = this.beanValues[i].getSerializedSize()974 // tag size å·²ç»å®æäºè®¡ç® 179975 size += beanValuesBeanSize + io.computeVar32FieldSize(2, beanValuesBeanSize);976 }977 //enumValue978 // tag size å·²ç»å®æäºè®¡ç® 187979 size += io.computeVar32FieldSize(2, this.enumValue);980 //enumValues981 var enumValues_len = this.enumValues.length;982 var enumValuesDataSize = 0;983 for (var i = 0; i < enumValues_len; i++) {984 enumValuesDataSize += io.computeVar32Size(this.enumValues[i]);985 }986 this.enumValuesSerializedSize = enumValuesDataSize;987 if (enumValuesDataSize > 0) {988 // tag size å·²ç»å®æäºè®¡ç® 195989 size += 2 + this.enumValuesSerializedSize + io.computeVar32Size(this.enumValuesSerializedSize);990 }991 if (this.booleanValue2 != null) {992 // tag size å·²ç»å®æäºè®¡ç® 200993 size += io.computeBooleanFieldSize(2, this.booleanValue2);994 }995 var booleanValues2_len = this.booleanValues2.length;996 var booleanValues2DataSize = 0;997 for (var i = 0; i < booleanValues2_len; i++) {998 booleanValues2DataSize += io.computeBooleanSize(this.booleanValues2[i]);999 }1000 this.booleanValues2SerializedSize = booleanValues2DataSize;1001 if (booleanValues2DataSize > 0) {1002 // tag size å·²ç»å®æäºè®¡ç® 2111003 size += 2 + this.booleanValues2SerializedSize + io.computeVar32Size(this.booleanValues2SerializedSize);1004 }1005 if (this.intValue2 != null) {1006 // tag size å·²ç»å®æäºè®¡ç® 2161007 size += io.computeVar32FieldSize(2, this.intValue2);1008 }1009 var intValues2_len = this.intValues2.length;1010 var intValues2DataSize = 0;1011 for (var i = 0; i < intValues2_len; i++) {1012 intValues2DataSize += io.computeVar32Size(this.intValues2[i]);1013 }1014 this.intValues2SerializedSize = intValues2DataSize;1015 if (intValues2DataSize > 0) {1016 // tag size å·²ç»å®æäºè®¡ç® 2271017 size += 2 + this.intValues2SerializedSize + io.computeVar32Size(this.intValues2SerializedSize);1018 }1019 if (this.longValue2 != null) {1020 // tag size å·²ç»å®æäºè®¡ç® 2321021 size += io.computeVar64FieldSize(2, this.longValue2);1022 }1023 var longValues2_len = this.longValues2.length;1024 var longValues2DataSize = 0;1025 for (var i = 0; i < longValues2_len; i++) {1026 longValues2DataSize += io.computeVar64Size(this.longValues2[i]);1027 }1028 this.longValues2SerializedSize = longValues2DataSize;1029 if (longValues2DataSize > 0) {1030 // tag size å·²ç»å®æäºè®¡ç® 2431031 size += 2 + this.longValues2SerializedSize + io.computeVar32Size(this.longValues2SerializedSize);1032 }1033 if (this.sintValue2 != null) {1034 // tag size å·²ç»å®æäºè®¡ç® 2481035 size += io.computeSintFieldSize(2, this.sintValue2);1036 }1037 var sintValues2_len = this.sintValues2.length;1038 var sintValues2DataSize = 0;1039 for (var i = 0; i < sintValues2_len; i++) {1040 sintValues2DataSize += io.computeSintSize(this.sintValues2[i]);1041 }1042 this.sintValues2SerializedSize = sintValues2DataSize;1043 if (sintValues2DataSize > 0) {1044 // tag size å·²ç»å®æäºè®¡ç® 2591045 size += 2 + this.sintValues2SerializedSize + io.computeVar32Size(this.sintValues2SerializedSize);1046 }1047 if (this.slongValue2 != null) {1048 // tag size å·²ç»å®æäºè®¡ç® 2641049 size += io.computeSlongFieldSize(2, this.slongValue2);1050 }1051 var slongValues2_len = this.slongValues2.length;1052 var slongValues2DataSize = 0;1053 for (var i = 0; i < slongValues2_len; i++) {1054 slongValues2DataSize += io.computeSlongSize(this.slongValues2[i]);1055 }1056 this.slongValues2SerializedSize = slongValues2DataSize;1057 if (slongValues2DataSize > 0) {1058 // tag size å·²ç»å®æäºè®¡ç® 2751059 size += 2 + this.slongValues2SerializedSize + io.computeVar32Size(this.slongValues2SerializedSize);1060 }1061 if (this.floatValue2 != null) {1062 // tag size å·²ç»å®æäºè®¡ç® 2811063 size += io.computeFloatFieldSize(2, this.floatValue2);1064 }1065 var floatValues2_len = this.floatValues2.length;1066 var floatValues2DataSize = 0;1067 for (var i = 0; i < floatValues2_len; i++) {1068 floatValues2DataSize += io.computeFloatSize(this.floatValues2[i]);1069 }1070 this.floatValues2SerializedSize = floatValues2DataSize;1071 if (floatValues2DataSize > 0) {1072 // tag size å·²ç»å®æäºè®¡ç® 2911073 size += 2 + this.floatValues2SerializedSize + io.computeVar32Size(this.floatValues2SerializedSize);1074 }1075 if (this.doubleValue2 != null) {1076 // tag size å·²ç»å®æäºè®¡ç® 2981077 size += io.computeDoubleFieldSize(2, this.doubleValue2);1078 }1079 var doubleValues2_len = this.doubleValues2.length;1080 var doubleValues2DataSize = 0;1081 for (var i = 0; i < doubleValues2_len; i++) {1082 doubleValues2DataSize += io.computeDoubleSize(this.doubleValues2[i]);1083 }1084 this.doubleValues2SerializedSize = doubleValues2DataSize;1085 if (doubleValues2DataSize > 0) {1086 // tag size å·²ç»å®æäºè®¡ç® 3071087 size += 2 + this.doubleValues2SerializedSize + io.computeVar32Size(this.doubleValues2SerializedSize);1088 }1089 if (this.fixed32Value2 != null) {1090 // tag size å·²ç»å®æäºè®¡ç® 3131091 size += io.computeFixed32FieldSize(2, this.fixed32Value2);1092 }1093 var fixed32Values2_len = this.fixed32Values2.length;1094 var fixed32Values2DataSize = 0;1095 for (var i = 0; i < fixed32Values2_len; i++) {1096 fixed32Values2DataSize += io.computeFixed32Size(this.fixed32Values2[i]);1097 }1098 this.fixed32Values2SerializedSize = fixed32Values2DataSize;1099 if (fixed32Values2DataSize > 0) {1100 // tag size å·²ç»å®æäºè®¡ç® 3231101 size += 2 + this.fixed32Values2SerializedSize + io.computeVar32Size(this.fixed32Values2SerializedSize);1102 }1103 if (this.fixed64Value2 != null) {1104 // tag size å·²ç»å®æäºè®¡ç® 3301105 size += io.computeFixed64FieldSize(2, this.fixed64Value2);1106 }1107 var fixed64Values2_len = this.fixed64Values2.length;1108 var fixed64Values2DataSize = 0;1109 for (var i = 0; i < fixed64Values2_len; i++) {1110 fixed64Values2DataSize += io.computeFixed64Size(this.fixed64Values2[i]);1111 }1112 this.fixed64Values2SerializedSize = fixed64Values2DataSize;1113 if (fixed64Values2DataSize > 0) {1114 // tag size å·²ç»å®æäºè®¡ç® 3391115 size += 2 + this.fixed64Values2SerializedSize + io.computeVar32Size(this.fixed64Values2SerializedSize);1116 }1117 if (this.stringValue2 != null) {1118 // tag size å·²ç»å®æäºè®¡ç® 3471119 size += io.computeStringFieldSize(2, this.stringValue2);1120 }1121 var stringValues2_len = this.stringValues2.length;1122 if (stringValues2_len > 0) {1123 for (var i = 0; i < stringValues2_len; i++) {1124 //tag size å·²ç»å®æäºè®¡ç® 3551125 size += 2 + io.computeStringSize(this.stringValues2[i]);1126 }1127 }1128 if (this.beanValue2 != null) {1129 var beanValue2BeanSize = this.beanValue2.getSerializedSize();1130 // tag size å·²ç»å®æäºè®¡ç® 3631131 size += beanValue2BeanSize + io.computeVar32FieldSize(2, beanValue2BeanSize);1132 }1133 var beanValues2_len = this.beanValues2.length;1134 for (var i = 0; i < beanValues2_len; i++) {1135 var beanValues2BeanSize = this.beanValues2[i].getSerializedSize()1136 // tag size å·²ç»å®æäºè®¡ç® 3711137 size += beanValues2BeanSize + io.computeVar32FieldSize(2, beanValues2BeanSize);1138 }1139 // tag size å·²ç»å®æäºè®¡ç® 3791140 size += io.computeVar32FieldSize(2, this.enumValue2);1141 var enumValues2_len = this.enumValues2.length;1142 var enumValues2DataSize = 0;1143 for (var i = 0; i < enumValues2_len; i++) {1144 enumValues2DataSize += io.computeVar32Size(this.enumValues2[i]);1145 }1146 this.enumValues2SerializedSize = enumValues2DataSize;1147 if (enumValues2DataSize > 0) {1148 // tag size å·²ç»å®æäºè®¡ç® 3871149 size += 2 + this.enumValues2SerializedSize + io.computeVar32Size(this.enumValues2SerializedSize);1150 }1151 this.serializedSize = size;1152 return size;1153};1154//Example.Echoæ ¼å¼åå符串1155Example.Echo.prototype.toString = function (_indent) {1156 _indent = _indent == undefined ? "" : _indent;1157 var _str = "";1158 _str = _str + "Echo" + "{";1159 //booleanValue1160 _str = _str + "\n";1161 _str = _str + _indent + rightPad("booleanValue", this._filedPad) + " = " + this.booleanValue;1162 //booleanValues1163 _str = _str + "\n";1164 _str = _str + _indent + rightPad("booleanValues", this._filedPad) + " = ";1165 var booleanValues_len = this.booleanValues.length;1166 if (booleanValues_len > 0) {1167 _str = _str + "[";1168 for (var i = 0; booleanValues_len; i++) {1169 _str = _str + "\n";1170 _str = _str + this._next_indent;1171 _str = _str + _indent + this.booleanValues[i];1172 }1173 _str = _str + "\n";1174 _str = _str + this._next_indent;1175 _str = _str + _indent + "]";1176 } else {1177 _str = _str + "null ";1178 }1179 //intValue1180 _str = _str + "\n";1181 _str = _str + _indent + rightPad("intValue", this._filedPad) + " = " + this.intValue;1182 //intValues1183 _str = _str + "\n";1184 _str = _str + _indent + rightPad("intValues", this._filedPad) + " = ";1185 var intValues_len = this.intValues.length;1186 if (intValues_len > 0) {1187 _str = _str + "[";1188 for (var i = 0; intValues_len; i++) {1189 _str = _str + "\n";1190 _str = _str + this._next_indent;1191 _str = _str + _indent + this.intValues[i];1192 }1193 _str = _str + "\n";1194 _str = _str + this._next_indent;1195 _str = _str + _indent + "]";1196 } else {1197 _str = _str + "null ";1198 }1199 //longValue1200 _str = _str + "\n";1201 _str = _str + _indent + rightPad("longValue", this._filedPad) + " = " + this.longValue;1202 //longValues1203 _str = _str + "\n";1204 _str = _str + _indent + rightPad("longValues", this._filedPad) + " = ";1205 var longValues_len = this.longValues.length;1206 if (longValues_len > 0) {1207 _str = _str + "[";1208 for (var i = 0; longValues_len; i++) {1209 _str = _str + "\n";1210 _str = _str + this._next_indent;1211 _str = _str + _indent + this.longValues[i];1212 }1213 _str = _str + "\n";1214 _str = _str + this._next_indent;1215 _str = _str + _indent + "]";1216 } else {1217 _str = _str + "null ";1218 }1219 //sintValue1220 _str = _str + "\n";1221 _str = _str + _indent + rightPad("sintValue", this._filedPad) + " = " + this.sintValue;1222 //sintValues1223 _str = _str + "\n";1224 _str = _str + _indent + rightPad("sintValues", this._filedPad) + " = ";1225 var sintValues_len = this.sintValues.length;1226 if (sintValues_len > 0) {1227 _str = _str + "[";1228 for (var i = 0; sintValues_len; i++) {1229 _str = _str + "\n";1230 _str = _str + this._next_indent;1231 _str = _str + _indent + this.sintValues[i];1232 }1233 _str = _str + "\n";1234 _str = _str + this._next_indent;1235 _str = _str + _indent + "]";1236 } else {1237 _str = _str + "null ";1238 }1239 //slongValue1240 _str = _str + "\n";1241 _str = _str + _indent + rightPad("slongValue", this._filedPad) + " = " + this.slongValue;1242 //slongValues1243 _str = _str + "\n";1244 _str = _str + _indent + rightPad("slongValues", this._filedPad) + " = ";1245 var slongValues_len = this.slongValues.length;1246 if (slongValues_len > 0) {1247 _str = _str + "[";1248 for (var i = 0; slongValues_len; i++) {1249 _str = _str + "\n";1250 _str = _str + this._next_indent;1251 _str = _str + _indent + this.slongValues[i];1252 }1253 _str = _str + "\n";1254 _str = _str + this._next_indent;1255 _str = _str + _indent + "]";1256 } else {1257 _str = _str + "null ";1258 }1259 //floatValue1260 _str = _str + "\n";1261 _str = _str + _indent + rightPad("floatValue", this._filedPad) + " = " + this.floatValue;1262 //floatValues1263 _str = _str + "\n";1264 _str = _str + _indent + rightPad("floatValues", this._filedPad) + " = ";1265 var floatValues_len = this.floatValues.length;1266 if (floatValues_len > 0) {1267 _str = _str + "[";1268 for (var i = 0; floatValues_len; i++) {1269 _str = _str + "\n";1270 _str = _str + this._next_indent;1271 _str = _str + _indent + this.floatValues[i];1272 }1273 _str = _str + "\n";1274 _str = _str + this._next_indent;1275 _str = _str + _indent + "]";1276 } else {1277 _str = _str + "null ";1278 }1279 //doubleValue1280 _str = _str + "\n";1281 _str = _str + _indent + rightPad("doubleValue", this._filedPad) + " = " + this.doubleValue;1282 //doubleValues1283 _str = _str + "\n";1284 _str = _str + _indent + rightPad("doubleValues", this._filedPad) + " = ";1285 var doubleValues_len = this.doubleValues.length;1286 if (doubleValues_len > 0) {1287 _str = _str + "[";1288 for (var i = 0; doubleValues_len; i++) {1289 _str = _str + "\n";1290 _str = _str + this._next_indent;1291 _str = _str + _indent + this.doubleValues[i];1292 }1293 _str = _str + "\n";1294 _str = _str + this._next_indent;1295 _str = _str + _indent + "]";1296 } else {1297 _str = _str + "null ";1298 }1299 //fixed32Value1300 _str = _str + "\n";1301 _str = _str + _indent + rightPad("fixed32Value", this._filedPad) + " = " + this.fixed32Value;1302 //fixed32Values1303 _str = _str + "\n";1304 _str = _str + _indent + rightPad("fixed32Values", this._filedPad) + " = ";1305 var fixed32Values_len = this.fixed32Values.length;1306 if (fixed32Values_len > 0) {1307 _str = _str + "[";1308 for (var i = 0; fixed32Values_len; i++) {1309 _str = _str + "\n";1310 _str = _str + this._next_indent;1311 _str = _str + _indent + this.fixed32Values[i];1312 }1313 _str = _str + "\n";1314 _str = _str + this._next_indent;1315 _str = _str + _indent + "]";1316 } else {1317 _str = _str + "null ";1318 }1319 //fixed64Value1320 _str = _str + "\n";1321 _str = _str + _indent + rightPad("fixed64Value", this._filedPad) + " = " + this.fixed64Value;1322 //fixed64Values1323 _str = _str + "\n";1324 _str = _str + _indent + rightPad("fixed64Values", this._filedPad) + " = ";1325 var fixed64Values_len = this.fixed64Values.length;1326 if (fixed64Values_len > 0) {1327 _str = _str + "[";1328 for (var i = 0; fixed64Values_len; i++) {1329 _str = _str + "\n";1330 _str = _str + this._next_indent;1331 _str = _str + _indent + this.fixed64Values[i];1332 }1333 _str = _str + "\n";1334 _str = _str + this._next_indent;1335 _str = _str + _indent + "]";1336 } else {1337 _str = _str + "null ";1338 }1339 //stringValue1340 _str = _str + "\n";1341 _str = _str + _indent + rightPad("stringValue", this._filedPad) + " = " + this.stringValue;1342 //stringValues1343 _str = _str + "\n";1344 _str = _str + _indent + rightPad("stringValues", this._filedPad) + " = ";1345 var stringValues_len = this.stringValues.length;1346 if (stringValues_len > 0) {1347 _str = _str + "[";1348 for (var i = 0; stringValues_len; i++) {1349 _str = _str + "\n";1350 _str = _str + this._next_indent;1351 _str = _str + _indent + this.stringValues[i];1352 }1353 _str = _str + "\n";1354 _str = _str + this._next_indent;1355 _str = _str + _indent + "]";1356 } else {1357 _str = _str + "null ";1358 }1359 //beanValue1360 _str = _str + "\n";1361 if (this.beanValue != null) {1362 _str = _str + _indent + rightPad("beanValue", this._filedPad) + " = " + this.beanValue.toString(_indent + this._next_indent);1363 } else {1364 _str = _str + _indent + rightPad("beanValue", this._filedPad) + " = " + "null";1365 }1366 //beanValues1367 _str = _str + "\n";1368 _str = _str + _indent + rightPad("beanValues", this._filedPad) + " = ";1369 var beanValues_len = this.beanValues.length;1370 if (beanValues_len > 0) {1371 _str = _str + "[";1372 for (var i = 0; beanValues_len; i++) {1373 _str = _str + "\n";1374 _str = _str + this._next_indent;1375 _str = _str + _indent + this.beanValues[i].toString(_indent + this._next_indent);1376 }1377 _str = _str + "\n";1378 _str = _str + this._next_indent;1379 _str = _str + _indent + "]";1380 } else {1381 _str = _str + "null ";1382 }1383 //enumValue1384 _str = _str + "\n";1385 _str = _str + _indent + rightPad("enumValue", this._filedPad) + " = " + Example.EchoEnum.valueToStr(this.enumValue);1386 //enumValues1387 _str = _str + "\n";1388 _str = _str + _indent + rightPad("enumValues", this._filedPad) + " = ";1389 var enumValues_len = this.enumValues.length;1390 if (enumValues_len > 0) {1391 _str = _str + "[";1392 for (var i = 0; enumValues_len; i++) {1393 _str = _str + "\n";1394 _str = _str + this._next_indent;1395 _str = _str + _indent + Example.EchoEnum.valueToStr(this.enumValues[i]);1396 }1397 _str = _str + "\n";1398 _str = _str + this._next_indent;1399 _str = _str + _indent + "]";1400 } else {1401 _str = _str + "null ";1402 }1403 _str = _str + "\n";1404 _str = _str + _indent + rightPad("booleanValue2", this._filedPad) + " = " + this.booleanValue2;1405 _str = _str + "\n";1406 _str = _str + _indent + rightPad("booleanValues2", this._filedPad) + " = ";1407 var booleanValues2_len = this.booleanValues2.length;1408 if (booleanValues2_len > 0) {1409 _str = _str + "[";1410 for (var i = 0; booleanValues2_len; i++) {1411 _str = _str + "\n";1412 _str = _str + this._next_indent;1413 _str = _str + _indent + this.booleanValues2[i];1414 }1415 _str = _str + "\n";1416 _str = _str + this._next_indent;1417 _str = _str + _indent + "]";1418 } else {1419 _str = _str + "null ";1420 }1421 _str = _str + "\n";1422 _str = _str + _indent + rightPad("intValue2", this._filedPad) + " = " + this.intValue2;1423 _str = _str + "\n";1424 _str = _str + _indent + rightPad("intValues2", this._filedPad) + " = ";1425 var intValues2_len = this.intValues2.length;1426 if (intValues2_len > 0) {1427 _str = _str + "[";1428 for (var i = 0; intValues2_len; i++) {1429 _str = _str + "\n";1430 _str = _str + this._next_indent;1431 _str = _str + _indent + this.intValues2[i];1432 }1433 _str = _str + "\n";1434 _str = _str + this._next_indent;1435 _str = _str + _indent + "]";1436 } else {1437 _str = _str + "null ";1438 }1439 _str = _str + "\n";1440 _str = _str + _indent + rightPad("longValue2", this._filedPad) + " = " + this.longValue2;1441 _str = _str + "\n";1442 _str = _str + _indent + rightPad("longValues2", this._filedPad) + " = ";1443 var longValues2_len = this.longValues2.length;1444 if (longValues2_len > 0) {1445 _str = _str + "[";1446 for (var i = 0; longValues2_len; i++) {1447 _str = _str + "\n";1448 _str = _str + this._next_indent;1449 _str = _str + _indent + this.longValues2[i];1450 }1451 _str = _str + "\n";1452 _str = _str + this._next_indent;1453 _str = _str + _indent + "]";1454 } else {1455 _str = _str + "null ";1456 }1457 _str = _str + "\n";1458 _str = _str + _indent + rightPad("sintValue2", this._filedPad) + " = " + this.sintValue2;1459 _str = _str + "\n";1460 _str = _str + _indent + rightPad("sintValues2", this._filedPad) + " = ";1461 var sintValues2_len = this.sintValues2.length;1462 if (sintValues2_len > 0) {1463 _str = _str + "[";1464 for (var i = 0; sintValues2_len; i++) {1465 _str = _str + "\n";1466 _str = _str + this._next_indent;1467 _str = _str + _indent + this.sintValues2[i];1468 }1469 _str = _str + "\n";1470 _str = _str + this._next_indent;1471 _str = _str + _indent + "]";1472 } else {1473 _str = _str + "null ";1474 }1475 _str = _str + "\n";1476 _str = _str + _indent + rightPad("slongValue2", this._filedPad) + " = " + this.slongValue2;1477 _str = _str + "\n";1478 _str = _str + _indent + rightPad("slongValues2", this._filedPad) + " = ";1479 var slongValues2_len = this.slongValues2.length;1480 if (slongValues2_len > 0) {1481 _str = _str + "[";1482 for (var i = 0; slongValues2_len; i++) {1483 _str = _str + "\n";1484 _str = _str + this._next_indent;1485 _str = _str + _indent + this.slongValues2[i];1486 }1487 _str = _str + "\n";1488 _str = _str + this._next_indent;1489 _str = _str + _indent + "]";1490 } else {1491 _str = _str + "null ";1492 }1493 _str = _str + "\n";1494 _str = _str + _indent + rightPad("floatValue2", this._filedPad) + " = " + this.floatValue2;1495 _str = _str + "\n";1496 _str = _str + _indent + rightPad("floatValues2", this._filedPad) + " = ";1497 var floatValues2_len = this.floatValues2.length;1498 if (floatValues2_len > 0) {1499 _str = _str + "[";1500 for (var i = 0; floatValues2_len; i++) {1501 _str = _str + "\n";1502 _str = _str + this._next_indent;1503 _str = _str + _indent + this.floatValues2[i];1504 }1505 _str = _str + "\n";1506 _str = _str + this._next_indent;1507 _str = _str + _indent + "]";1508 } else {1509 _str = _str + "null ";1510 }1511 _str = _str + "\n";1512 _str = _str + _indent + rightPad("doubleValue2", this._filedPad) + " = " + this.doubleValue2;1513 _str = _str + "\n";1514 _str = _str + _indent + rightPad("doubleValues2", this._filedPad) + " = ";1515 var doubleValues2_len = this.doubleValues2.length;1516 if (doubleValues2_len > 0) {1517 _str = _str + "[";1518 for (var i = 0; doubleValues2_len; i++) {1519 _str = _str + "\n";1520 _str = _str + this._next_indent;1521 _str = _str + _indent + this.doubleValues2[i];1522 }1523 _str = _str + "\n";1524 _str = _str + this._next_indent;1525 _str = _str + _indent + "]";1526 } else {1527 _str = _str + "null ";1528 }1529 _str = _str + "\n";1530 _str = _str + _indent + rightPad("fixed32Value2", this._filedPad) + " = " + this.fixed32Value2;1531 _str = _str + "\n";1532 _str = _str + _indent + rightPad("fixed32Values2", this._filedPad) + " = ";1533 var fixed32Values2_len = this.fixed32Values2.length;1534 if (fixed32Values2_len > 0) {1535 _str = _str + "[";1536 for (var i = 0; fixed32Values2_len; i++) {1537 _str = _str + "\n";1538 _str = _str + this._next_indent;1539 _str = _str + _indent + this.fixed32Values2[i];1540 }1541 _str = _str + "\n";1542 _str = _str + this._next_indent;1543 _str = _str + _indent + "]";1544 } else {1545 _str = _str + "null ";1546 }1547 _str = _str + "\n";1548 _str = _str + _indent + rightPad("fixed64Value2", this._filedPad) + " = " + this.fixed64Value2;1549 _str = _str + "\n";1550 _str = _str + _indent + rightPad("fixed64Values2", this._filedPad) + " = ";1551 var fixed64Values2_len = this.fixed64Values2.length;1552 if (fixed64Values2_len > 0) {1553 _str = _str + "[";1554 for (var i = 0; fixed64Values2_len; i++) {1555 _str = _str + "\n";1556 _str = _str + this._next_indent;1557 _str = _str + _indent + this.fixed64Values2[i];1558 }1559 _str = _str + "\n";1560 _str = _str + this._next_indent;1561 _str = _str + _indent + "]";1562 } else {1563 _str = _str + "null ";1564 }1565 _str = _str + "\n";1566 _str = _str + _indent + rightPad("stringValue2", this._filedPad) + " = " + this.stringValue2;1567 _str = _str + "\n";1568 _str = _str + _indent + rightPad("stringValues2", this._filedPad) + " = ";1569 var stringValues2_len = this.stringValues2.length;1570 if (stringValues2_len > 0) {1571 _str = _str + "[";1572 for (var i = 0; stringValues2_len; i++) {1573 _str = _str + "\n";1574 _str = _str + this._next_indent;1575 _str = _str + _indent + this.stringValues2[i];1576 }1577 _str = _str + "\n";1578 _str = _str + this._next_indent;1579 _str = _str + _indent + "]";1580 } else {1581 _str = _str + "null ";1582 }1583 _str = _str + "\n";1584 if (this.beanValue2 != null) {1585 _str = _str + _indent + rightPad("beanValue2", this._filedPad) + " = " + this.beanValue2.toString(_indent + this._next_indent);1586 } else {1587 _str = _str + _indent + rightPad("beanValue2", this._filedPad) + " = " + "null";1588 }1589 _str = _str + "\n";1590 _str = _str + _indent + rightPad("beanValues2", this._filedPad) + " = ";1591 var beanValues2_len = this.beanValues2.length;1592 if (beanValues2_len > 0) {1593 _str = _str + "[";1594 for (var i = 0; beanValues2_len; i++) {1595 _str = _str + "\n";1596 _str = _str + this._next_indent;1597 _str = _str + _indent + this.beanValues2[i].toString(_indent + this._next_indent);1598 }1599 _str = _str + "\n";1600 _str = _str + this._next_indent;1601 _str = _str + _indent + "]";1602 } else {1603 _str = _str + "null ";1604 }1605 _str = _str + "\n";1606 _str = _str + _indent + rightPad("enumValue2", this._filedPad) + " = " + Example.EchoEnum.valueToStr(this.enumValue2);1607 _str = _str + "\n";1608 _str = _str + _indent + rightPad("enumValues2", this._filedPad) + " = ";1609 var enumValues2_len = this.enumValues2.length;1610 if (enumValues2_len > 0) {1611 _str = _str + "[";1612 for (var i = 0; enumValues2_len; i++) {1613 _str = _str + "\n";1614 _str = _str + this._next_indent;1615 _str = _str + _indent + Example.EchoEnum.valueToStr(this.enumValues2[i]);1616 }1617 _str = _str + "\n";1618 _str = _str + this._next_indent;1619 _str = _str + _indent + "]";1620 } else {1621 _str = _str + "null ";1622 }1623 _str = _str + "\n";1624 _str = _str + _indent + "}";1625 return _str;1626};1627/**1628 *1629 * Echoä¸çä¸ä¸ªbean1630 */1631Example.EchoBean = function () {1632 //ç±»å:int 1633 this.value = 0;1634 this.serializedSize = -1;1635 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦1636 this._filedPad = 5;1637};1638//Example.EchoBeanåå
¥åèç¼å1639Example.EchoBean.prototype.write = function (buf) {1640 if (this.value != null) {1641 buf.writeVar32Field(8, this.value);1642 }1643};1644//Example.EchoBean读ååèç¼å1645Example.EchoBean.prototype.read = function (buf, endIndex) {1646 while (true) {1647 var tag = buf.readTag(endIndex);1648 switch (tag) {1649 case 0://end1650 return;1651 // 1 << 3 | 01652 case 8 :1653 this.value = buf.readVar32();1654 break;1655 default://skip1656 buf.skipTag(tag);1657 break;1658 }1659 }1660};1661//Example.EchoBean计ç®åºåå大å°1662Example.EchoBean.prototype.getSerializedSize = function () {1663 var size = this.serializedSize;1664 if (size > -1) {1665 return size;1666 }1667 size = 0;1668 if (this.value != null) {1669 // tag size å·²ç»å®æäºè®¡ç® 81670 size += io.computeVar32FieldSize(1, this.value);1671 }1672 this.serializedSize = size;1673 return size;1674};1675//Example.EchoBeanæ ¼å¼åå符串1676Example.EchoBean.prototype.toString = function (_indent) {1677 _indent = _indent == undefined ? "" : _indent;1678 var _str = "";1679 _str = _str + "EchoBean" + "{";1680 _str = _str + "\n";1681 _str = _str + _indent + rightPad("value", this._filedPad) + " = " + this.value;1682 _str = _str + "\n";1683 _str = _str + _indent + "}";1684 return _str;1685};1686Example.Sample = function () {1687 //ç±»å:int 1688 this.value = 0;1689 //list:int 1690 this.values = new Array(0);1691 this.serializedSize = -1;1692 this.valuesSerializedSize = 0;1693 //缩è¿6 + 3 = 9 ä¸ªç©ºæ ¼1694 this._next_indent = " ";1695 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦1696 this._filedPad = 6;1697};1698//Example.Sampleåå
¥åèç¼å1699Example.Sample.prototype.write = function (buf) {1700 this.getSerializedSize();1701 if (this.value != null) {1702 buf.writeVar32Field(8, this.value);1703 }1704 var values_len = this.values.length;1705 if (values_len > 0) {1706 buf.writeVar32(19);1707 buf.writeVar32(this.valuesSerializedSize);1708 for (var i = 0; i < values_len; i++) {1709 buf.writeVar32(this.values[i]);1710 }1711 }1712};1713//Example.Sample读ååèç¼å1714Example.Sample.prototype.read = function (buf, endIndex) {1715 while (true) {1716 var tag = buf.readTag(endIndex);1717 switch (tag) {1718 case 0://end1719 return;1720 // 1 << 3 | 01721 case 8 :1722 this.value = buf.readVar32();1723 break;1724 // 2 << 3 | 31725 case 19 :1726 var valuesDataSize = buf.readVar32();1727 var receiveValuesDataSize = 0;1728 while (receiveValuesDataSize < valuesDataSize) {1729 var tempValues = buf.readVar32();1730 this.values.push(tempValues);1731 }1732 break;1733 default://skip1734 buf.skipTag(tag);1735 break;1736 }1737 }1738};1739//Example.Sample计ç®åºåå大å°1740Example.Sample.prototype.getSerializedSize = function () {1741 var size = this.serializedSize;1742 if (size > -1) {1743 return size;1744 }1745 size = 0;1746 if (this.value != null) {1747 // tag size å·²ç»å®æäºè®¡ç® 81748 size += io.computeVar32FieldSize(1, this.value);1749 }1750 var values_len = this.values.length;1751 var valuesDataSize = 0;1752 for (var i = 0; i < values_len; i++) {1753 valuesDataSize += io.computeVar32Size(this.values[i]);1754 }1755 this.valuesSerializedSize = valuesDataSize;1756 if (valuesDataSize > 0) {1757 // tag size å·²ç»å®æäºè®¡ç® 191758 size += 1 + this.valuesSerializedSize + io.computeVar32Size(this.valuesSerializedSize);1759 }1760 this.serializedSize = size;1761 return size;1762};1763//Example.Sampleæ ¼å¼åå符串1764Example.Sample.prototype.toString = function (_indent) {1765 _indent = _indent == undefined ? "" : _indent;1766 var _str = "";1767 _str = _str + "Sample" + "{";1768 _str = _str + "\n";1769 _str = _str + _indent + rightPad("value", this._filedPad) + " = " + this.value;1770 _str = _str + "\n";1771 _str = _str + _indent + rightPad("values", this._filedPad) + " = ";1772 var values_len = this.values.length;1773 if (values_len > 0) {1774 _str = _str + "[";1775 for (var i = 0; values_len; i++) {1776 _str = _str + "\n";1777 _str = _str + this._next_indent;1778 _str = _str + _indent + this.values[i];1779 }1780 _str = _str + "\n";1781 _str = _str + this._next_indent;1782 _str = _str + _indent + "]";1783 } else {1784 _str = _str + "null ";1785 }1786 _str = _str + "\n";1787 _str = _str + _indent + "}";1788 return _str;1789};1790Example.CSEchoMessage = function () {1791 //ç±»å:Example.Echo 1792 this.echo = null;1793 this.serializedSize = -1;1794 //缩è¿4 + 3 = 7 ä¸ªç©ºæ ¼1795 this._next_indent = " ";1796 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦1797 this._filedPad = 4;1798};1799Example.CSEchoMessage.MESSAGE_ID = 1000103;1800Example.CSEchoMessage.prototype.getMessageId = function () {1801 return Example.CSEchoMessage.MESSAGE_ID;1802};1803//Example.CSEchoMessageåå
¥åèç¼å1804Example.CSEchoMessage.prototype.write = function (buf) {1805 if (this.echo != null) {1806 buf.writeVar32(11);1807 buf.writeVar32(this.echo.getSerializedSize());1808 this.echo.write(buf);1809 }1810};1811//Example.CSEchoMessage读ååèç¼å1812Example.CSEchoMessage.prototype.read = function (buf, endIndex) {1813 while (true) {1814 var tag = buf.readTag(endIndex);1815 switch (tag) {1816 case 0://end1817 return;1818 // 1 << 3 | 31819 case 11 :1820 this.echo = new Example.Echo();1821 this.echo.read(buf, buf.readVar32() + buf.getReaderIndex());1822 break;1823 default://skip1824 buf.skipTag(tag);1825 break;1826 }1827 }1828};1829//Example.CSEchoMessage计ç®åºåå大å°1830Example.CSEchoMessage.prototype.getSerializedSize = function () {1831 var size = this.serializedSize;1832 if (size > -1) {1833 return size;1834 }1835 size = 0;1836 if (this.echo != null) {1837 var echoBeanSize = this.echo.getSerializedSize();1838 // tag size å·²ç»å®æäºè®¡ç® 111839 size += echoBeanSize + io.computeVar32FieldSize(1, echoBeanSize);1840 }1841 this.serializedSize = size;1842 return size;1843};1844//Example.CSEchoMessageæ ¼å¼åå符串1845Example.CSEchoMessage.prototype.toString = function (_indent) {1846 _indent = _indent == undefined ? "" : _indent;1847 var _str = "";1848 _str = _str + "CSEchoMessage[1000103]" + "{";1849 _str = _str + "\n";1850 if (this.echo != null) {1851 _str = _str + _indent + rightPad("echo", this._filedPad) + " = " + this.echo.toString(_indent + this._next_indent);1852 } else {1853 _str = _str + _indent + rightPad("echo", this._filedPad) + " = " + "null";1854 }1855 _str = _str + "\n";1856 _str = _str + _indent + "}";1857 return _str;1858};1859Example.SCEchoMessage = function () {1860 //ç±»å:Example.Echo 1861 this.echo = null;1862 this.serializedSize = -1;1863 //缩è¿4 + 3 = 7 ä¸ªç©ºæ ¼1864 this._next_indent = " ";1865 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦1866 this._filedPad = 4;1867};1868Example.SCEchoMessage.MESSAGE_ID = 1000104;1869Example.SCEchoMessage.prototype.getMessageId = function () {1870 return Example.SCEchoMessage.MESSAGE_ID;1871};1872//Example.SCEchoMessageåå
¥åèç¼å1873Example.SCEchoMessage.prototype.write = function (buf) {1874 if (this.echo != null) {1875 buf.writeVar32(11);1876 buf.writeVar32(this.echo.getSerializedSize());1877 this.echo.write(buf);1878 }1879};1880//Example.SCEchoMessage读ååèç¼å1881Example.SCEchoMessage.prototype.read = function (buf, endIndex) {1882 while (true) {1883 var tag = buf.readTag(endIndex);1884 switch (tag) {1885 case 0://end1886 return;1887 // 1 << 3 | 31888 case 11 :1889 this.echo = new Example.Echo();1890 this.echo.read(buf, buf.readVar32() + buf.getReaderIndex());1891 break;1892 default://skip1893 buf.skipTag(tag);1894 break;1895 }1896 }1897};1898//Example.SCEchoMessage计ç®åºåå大å°1899Example.SCEchoMessage.prototype.getSerializedSize = function () {1900 var size = this.serializedSize;1901 if (size > -1) {1902 return size;1903 }1904 size = 0;1905 if (this.echo != null) {1906 var echoBeanSize = this.echo.getSerializedSize();1907 // tag size å·²ç»å®æäºè®¡ç® 111908 size += echoBeanSize + io.computeVar32FieldSize(1, echoBeanSize);1909 }1910 this.serializedSize = size;1911 return size;1912};1913//Example.SCEchoMessageæ ¼å¼åå符串1914Example.SCEchoMessage.prototype.toString = function (_indent) {1915 _indent = _indent == undefined ? "" : _indent;1916 var _str = "";1917 _str = _str + "SCEchoMessage[1000104]" + "{";1918 _str = _str + "\n";1919 if (this.echo != null) {1920 _str = _str + _indent + rightPad("echo", this._filedPad) + " = " + this.echo.toString(_indent + this._next_indent);1921 } else {1922 _str = _str + _indent + rightPad("echo", this._filedPad) + " = " + "null";1923 }1924 _str = _str + "\n";1925 _str = _str + _indent + "}";1926 return _str;1927};1928Example.CSSampleMessage = function () {1929 //ç±»å:Example.Sample 1930 this.sample = null;1931 this.serializedSize = -1;1932 //缩è¿6 + 3 = 9 ä¸ªç©ºæ ¼1933 this._next_indent = " ";1934 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦1935 this._filedPad = 6;1936};1937Example.CSSampleMessage.MESSAGE_ID = 1000105;1938Example.CSSampleMessage.prototype.getMessageId = function () {1939 return Example.CSSampleMessage.MESSAGE_ID;1940};1941//Example.CSSampleMessageåå
¥åèç¼å1942Example.CSSampleMessage.prototype.write = function (buf) {1943 if (this.sample != null) {1944 buf.writeVar32(11);1945 buf.writeVar32(this.sample.getSerializedSize());1946 this.sample.write(buf);1947 }1948};1949//Example.CSSampleMessage读ååèç¼å1950Example.CSSampleMessage.prototype.read = function (buf, endIndex) {1951 while (true) {1952 var tag = buf.readTag(endIndex);1953 switch (tag) {1954 case 0://end1955 return;1956 // 1 << 3 | 31957 case 11 :1958 this.sample = new Example.Sample();1959 this.sample.read(buf, buf.readVar32() + buf.getReaderIndex());1960 break;1961 default://skip1962 buf.skipTag(tag);1963 break;1964 }1965 }1966};1967//Example.CSSampleMessage计ç®åºåå大å°1968Example.CSSampleMessage.prototype.getSerializedSize = function () {1969 var size = this.serializedSize;1970 if (size > -1) {1971 return size;1972 }1973 size = 0;1974 if (this.sample != null) {1975 var sampleBeanSize = this.sample.getSerializedSize();1976 // tag size å·²ç»å®æäºè®¡ç® 111977 size += sampleBeanSize + io.computeVar32FieldSize(1, sampleBeanSize);1978 }1979 this.serializedSize = size;1980 return size;1981};1982//Example.CSSampleMessageæ ¼å¼åå符串1983Example.CSSampleMessage.prototype.toString = function (_indent) {1984 _indent = _indent == undefined ? "" : _indent;1985 var _str = "";1986 _str = _str + "CSSampleMessage[1000105]" + "{";1987 _str = _str + "\n";1988 if (this.sample != null) {1989 _str = _str + _indent + rightPad("sample", this._filedPad) + " = " + this.sample.toString(_indent + this._next_indent);1990 } else {1991 _str = _str + _indent + rightPad("sample", this._filedPad) + " = " + "null";1992 }1993 _str = _str + "\n";1994 _str = _str + _indent + "}";1995 return _str;1996};1997Example.SCSampleMessage = function () {1998 //ç±»å:Example.Sample 1999 this.sample = null;2000 this.serializedSize = -1;2001 //缩è¿6 + 3 = 9 ä¸ªç©ºæ ¼2002 this._next_indent = " ";2003 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦2004 this._filedPad = 6;2005};2006Example.SCSampleMessage.MESSAGE_ID = 1000106;2007Example.SCSampleMessage.prototype.getMessageId = function () {2008 return Example.SCSampleMessage.MESSAGE_ID;2009};2010//Example.SCSampleMessageåå
¥åèç¼å2011Example.SCSampleMessage.prototype.write = function (buf) {2012 if (this.sample != null) {2013 buf.writeVar32(11);2014 buf.writeVar32(this.sample.getSerializedSize());2015 this.sample.write(buf);2016 }2017};2018//Example.SCSampleMessage读ååèç¼å2019Example.SCSampleMessage.prototype.read = function (buf, endIndex) {2020 while (true) {2021 var tag = buf.readTag(endIndex);2022 switch (tag) {2023 case 0://end2024 return;2025 // 1 << 3 | 32026 case 11 :2027 this.sample = new Example.Sample();2028 this.sample.read(buf, buf.readVar32() + buf.getReaderIndex());2029 break;2030 default://skip2031 buf.skipTag(tag);2032 break;2033 }2034 }2035};2036//Example.SCSampleMessage计ç®åºåå大å°2037Example.SCSampleMessage.prototype.getSerializedSize = function () {2038 var size = this.serializedSize;2039 if (size > -1) {2040 return size;2041 }2042 size = 0;2043 if (this.sample != null) {2044 var sampleBeanSize = this.sample.getSerializedSize();2045 // tag size å·²ç»å®æäºè®¡ç® 112046 size += sampleBeanSize + io.computeVar32FieldSize(1, sampleBeanSize);2047 }2048 this.serializedSize = size;2049 return size;2050};2051//Example.SCSampleMessageæ ¼å¼åå符串2052Example.SCSampleMessage.prototype.toString = function (_indent) {2053 _indent = _indent == undefined ? "" : _indent;2054 var _str = "";2055 _str = _str + "SCSampleMessage[1000106]" + "{";2056 _str = _str + "\n";2057 if (this.sample != null) {2058 _str = _str + _indent + rightPad("sample", this._filedPad) + " = " + this.sample.toString(_indent + this._next_indent);2059 } else {2060 _str = _str + _indent + rightPad("sample", this._filedPad) + " = " + "null";2061 }2062 _str = _str + "\n";2063 _str = _str + _indent + "}";2064 return _str;2065};2066Example.CSSampleLongMessage = function () {2067 //ç±»å:long 2068 this.value = 0;2069 this.serializedSize = -1;2070 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦2071 this._filedPad = 5;2072};2073Example.CSSampleLongMessage.MESSAGE_ID = 1000107;2074Example.CSSampleLongMessage.prototype.getMessageId = function () {2075 return Example.CSSampleLongMessage.MESSAGE_ID;2076};2077//Example.CSSampleLongMessageåå
¥åèç¼å2078Example.CSSampleLongMessage.prototype.write = function (buf) {2079 if (this.value != null) {2080 buf.writeVar64Field(8, this.value);2081 }2082};2083//Example.CSSampleLongMessage读ååèç¼å2084Example.CSSampleLongMessage.prototype.read = function (buf, endIndex) {2085 while (true) {2086 var tag = buf.readTag(endIndex);2087 switch (tag) {2088 case 0://end2089 return;2090 // 1 << 3 | 02091 case 8 :2092 this.value = buf.readVar64();2093 break;2094 default://skip2095 buf.skipTag(tag);2096 break;2097 }2098 }2099};2100//Example.CSSampleLongMessage计ç®åºåå大å°2101Example.CSSampleLongMessage.prototype.getSerializedSize = function () {2102 var size = this.serializedSize;2103 if (size > -1) {2104 return size;2105 }2106 size = 0;2107 if (this.value != null) {2108 // tag size å·²ç»å®æäºè®¡ç® 82109 size += io.computeVar64FieldSize(1, this.value);2110 }2111 this.serializedSize = size;2112 return size;2113};2114//Example.CSSampleLongMessageæ ¼å¼åå符串2115Example.CSSampleLongMessage.prototype.toString = function (_indent) {2116 _indent = _indent == undefined ? "" : _indent;2117 var _str = "";2118 _str = _str + "CSSampleLongMessage[1000107]" + "{";2119 _str = _str + "\n";2120 _str = _str + _indent + rightPad("value", this._filedPad) + " = " + this.value;2121 _str = _str + "\n";2122 _str = _str + _indent + "}";2123 return _str;2124};2125Example.SCSampleLongMessage = function () {2126 //ç±»å:long 2127 this.value = 0;2128 this.serializedSize = -1;2129 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦2130 this._filedPad = 5;2131};2132Example.SCSampleLongMessage.MESSAGE_ID = 1000108;2133Example.SCSampleLongMessage.prototype.getMessageId = function () {2134 return Example.SCSampleLongMessage.MESSAGE_ID;2135};2136//Example.SCSampleLongMessageåå
¥åèç¼å2137Example.SCSampleLongMessage.prototype.write = function (buf) {2138 if (this.value != null) {2139 buf.writeVar64Field(8, this.value);2140 }2141};2142//Example.SCSampleLongMessage读ååèç¼å2143Example.SCSampleLongMessage.prototype.read = function (buf, endIndex) {2144 while (true) {2145 var tag = buf.readTag(endIndex);2146 switch (tag) {2147 case 0://end2148 return;2149 // 1 << 3 | 02150 case 8 :2151 this.value = buf.readVar64();2152 break;2153 default://skip2154 buf.skipTag(tag);2155 break;2156 }2157 }2158};2159//Example.SCSampleLongMessage计ç®åºåå大å°2160Example.SCSampleLongMessage.prototype.getSerializedSize = function () {2161 var size = this.serializedSize;2162 if (size > -1) {2163 return size;2164 }2165 size = 0;2166 if (this.value != null) {2167 // tag size å·²ç»å®æäºè®¡ç® 82168 size += io.computeVar64FieldSize(1, this.value);2169 }2170 this.serializedSize = size;2171 return size;2172};2173//Example.SCSampleLongMessageæ ¼å¼åå符串2174Example.SCSampleLongMessage.prototype.toString = function (_indent) {2175 _indent = _indent == undefined ? "" : _indent;2176 var _str = "";2177 _str = _str + "SCSampleLongMessage[1000108]" + "{";2178 _str = _str + "\n";2179 _str = _str + _indent + rightPad("value", this._filedPad) + " = " + this.value;2180 _str = _str + "\n";2181 _str = _str + _indent + "}";2182 return _str;2183};2184Example.CSSampleStrMessage = function () {2185 //ç±»å:String 2186 this.value = null;2187 this.serializedSize = -1;2188 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦2189 this._filedPad = 5;2190};2191Example.CSSampleStrMessage.MESSAGE_ID = 1000109;2192Example.CSSampleStrMessage.prototype.getMessageId = function () {2193 return Example.CSSampleStrMessage.MESSAGE_ID;2194};2195//Example.CSSampleStrMessageåå
¥åèç¼å2196Example.CSSampleStrMessage.prototype.write = function (buf) {2197 if (this.value != null) {2198 buf.writeStringField(11, this.value);2199 }2200};2201//Example.CSSampleStrMessage读ååèç¼å2202Example.CSSampleStrMessage.prototype.read = function (buf, endIndex) {2203 while (true) {2204 var tag = buf.readTag(endIndex);2205 switch (tag) {2206 case 0://end2207 return;2208 // 1 << 3 | 32209 case 11 :2210 this.value = buf.readString();2211 break;2212 default://skip2213 buf.skipTag(tag);2214 break;2215 }2216 }2217};2218//Example.CSSampleStrMessage计ç®åºåå大å°2219Example.CSSampleStrMessage.prototype.getSerializedSize = function () {2220 var size = this.serializedSize;2221 if (size > -1) {2222 return size;2223 }2224 size = 0;2225 if (this.value != null) {2226 // tag size å·²ç»å®æäºè®¡ç® 112227 size += io.computeStringFieldSize(1, this.value);2228 }2229 this.serializedSize = size;2230 return size;2231};2232//Example.CSSampleStrMessageæ ¼å¼åå符串2233Example.CSSampleStrMessage.prototype.toString = function (_indent) {2234 _indent = _indent == undefined ? "" : _indent;2235 var _str = "";2236 _str = _str + "CSSampleStrMessage[1000109]" + "{";2237 _str = _str + "\n";2238 _str = _str + _indent + rightPad("value", this._filedPad) + " = " + this.value;2239 _str = _str + "\n";2240 _str = _str + _indent + "}";2241 return _str;2242};2243Example.SCSampleStrMessage = function () {2244 //ç±»å:String 2245 this.value = null;2246 this.serializedSize = -1;2247 //æ ¼å¼åæ¶ç»ä¸å段é¿åº¦2248 this._filedPad = 5;2249};2250Example.SCSampleStrMessage.MESSAGE_ID = 1000110;2251Example.SCSampleStrMessage.prototype.getMessageId = function () {2252 return Example.SCSampleStrMessage.MESSAGE_ID;2253};2254//Example.SCSampleStrMessageåå
¥åèç¼å2255Example.SCSampleStrMessage.prototype.write = function (buf) {2256 if (this.value != null) {2257 buf.writeStringField(11, this.value);2258 }2259};2260//Example.SCSampleStrMessage读ååèç¼å2261Example.SCSampleStrMessage.prototype.read = function (buf, endIndex) {2262 while (true) {2263 var tag = buf.readTag(endIndex);2264 switch (tag) {2265 case 0://end2266 return;2267 // 1 << 3 | 32268 case 11 :2269 this.value = buf.readString();2270 break;2271 default://skip2272 buf.skipTag(tag);2273 break;2274 }2275 }2276};2277//Example.SCSampleStrMessage计ç®åºåå大å°2278Example.SCSampleStrMessage.prototype.getSerializedSize = function () {2279 var size = this.serializedSize;2280 if (size > -1) {2281 return size;2282 }2283 size = 0;2284 if (this.value != null) {2285 // tag size å·²ç»å®æäºè®¡ç® 112286 size += io.computeStringFieldSize(1, this.value);2287 }2288 this.serializedSize = size;2289 return size;2290};2291//Example.SCSampleStrMessageæ ¼å¼åå符串2292Example.SCSampleStrMessage.prototype.toString = function (_indent) {2293 _indent = _indent == undefined ? "" : _indent;2294 var _str = "";2295 _str = _str + "SCSampleStrMessage[1000110]" + "{";2296 _str = _str + "\n";2297 _str = _str + _indent + rightPad("value", this._filedPad) + " = " + this.value;2298 _str = _str + "\n";2299 _str = _str + _indent + "}";2300 return _str;2301};2302Example.SCEchoMessage.MessageDecoder = function () {2303 this.getEmptyMessage = function () {2304 return new Example.SCEchoMessage();2305 }2306};2307io.regMessageDecoder(Example.SCEchoMessage.MESSAGE_ID, new Example.SCEchoMessage.MessageDecoder(), "Example.SCEchoMessage");2308Example.SCSampleMessage.MessageDecoder = function () {2309 this.getEmptyMessage = function () {2310 return new Example.SCSampleMessage();2311 }2312};2313io.regMessageDecoder(Example.SCSampleMessage.MESSAGE_ID, new Example.SCSampleMessage.MessageDecoder(), "Example.SCSampleMessage");2314Example.SCSampleLongMessage.MessageDecoder = function () {2315 this.getEmptyMessage = function () {2316 return new Example.SCSampleLongMessage();2317 }2318};2319io.regMessageDecoder(Example.SCSampleLongMessage.MESSAGE_ID, new Example.SCSampleLongMessage.MessageDecoder(), "Example.SCSampleLongMessage");2320Example.SCSampleStrMessage.MessageDecoder = function () {2321 this.getEmptyMessage = function () {2322 return new Example.SCSampleStrMessage();2323 }2324};...
deepequal-map.js
Source:deepequal-map.js
1'use strict';2/* eslint-disable no-restricted-properties */3const common = require('../common.js');4const assert = require('assert');5const bench = common.createBenchmark(main, {6 n: [5e2],7 len: [5e2],8 method: [9 'deepEqual_primitiveOnly',10 'deepStrictEqual_primitiveOnly',11 'deepEqual_objectOnly',12 'deepStrictEqual_objectOnly',13 'deepEqual_mixed',14 'deepStrictEqual_mixed',15 'deepEqual_looseMatches',16 'notDeepEqual_primitiveOnly',17 'notDeepStrictEqual_primitiveOnly',18 'notDeepEqual_objectOnly',19 'notDeepStrictEqual_objectOnly',20 'notDeepEqual_mixed',21 'notDeepStrictEqual_mixed',22 'notDeepEqual_looseMatches',23 ]24});25function benchmark(method, n, values, values2) {26 const actual = new Map(values);27 // Prevent reference equal elements28 const deepCopy = JSON.parse(JSON.stringify(values2 ? values2 : values));29 const expected = new Map(deepCopy);30 bench.start();31 for (var i = 0; i < n; ++i) {32 method(actual, expected);33 }34 bench.end(n);35}36function main(conf) {37 const n = +conf.n;38 const len = +conf.len;39 const array = Array(len).fill(1);40 var values, values2;41 switch (conf.method) {42 case '':43 // Empty string falls through to next line as default, mostly for tests.44 case 'deepEqual_primitiveOnly':45 values = array.map((_, i) => [`str_${i}`, 123]);46 benchmark(assert.deepEqual, n, values);47 break;48 case 'deepStrictEqual_primitiveOnly':49 values = array.map((_, i) => [`str_${i}`, 123]);50 benchmark(assert.deepStrictEqual, n, values);51 break;52 case 'deepEqual_objectOnly':53 values = array.map((_, i) => [[`str_${i}`, 1], 123]);54 benchmark(assert.deepEqual, n, values);55 break;56 case 'deepStrictEqual_objectOnly':57 values = array.map((_, i) => [[`str_${i}`, 1], 123]);58 benchmark(assert.deepStrictEqual, n, values);59 break;60 case 'deepEqual_mixed':61 values = array.map((_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]);62 benchmark(assert.deepEqual, n, values);63 break;64 case 'deepStrictEqual_mixed':65 values = array.map((_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]);66 benchmark(assert.deepStrictEqual, n, values);67 break;68 case 'deepEqual_looseMatches':69 values = array.map((_, i) => [i, i]);70 values2 = values.slice().map((v) => [String(v[0]), String(v[1])]);71 benchmark(assert.deepEqual, n, values, values2);72 break;73 case 'notDeepEqual_primitiveOnly':74 values = array.map((_, i) => [`str_${i}`, 123]);75 values2 = values.slice(0);76 values2[Math.floor(len / 2)] = ['w00t', 123];77 benchmark(assert.notDeepEqual, n, values, values2);78 break;79 case 'notDeepStrictEqual_primitiveOnly':80 values = array.map((_, i) => [`str_${i}`, 123]);81 values2 = values.slice(0);82 values2[Math.floor(len / 2)] = ['w00t', 123];83 benchmark(assert.notDeepStrictEqual, n, values, values2);84 break;85 case 'notDeepEqual_objectOnly':86 values = array.map((_, i) => [[`str_${i}`, 1], 123]);87 values2 = values.slice(0);88 values2[Math.floor(len / 2)] = [['w00t'], 123];89 benchmark(assert.notDeepEqual, n, values, values2);90 break;91 case 'notDeepStrictEqual_objectOnly':92 values = array.map((_, i) => [[`str_${i}`, 1], 123]);93 values2 = values.slice(0);94 values2[Math.floor(len / 2)] = [['w00t'], 123];95 benchmark(assert.notDeepStrictEqual, n, values, values2);96 break;97 case 'notDeepEqual_mixed':98 values = array.map((_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]);99 values2 = values.slice(0);100 values2[0] = ['w00t', 123];101 benchmark(assert.notDeepEqual, n, values, values2);102 break;103 case 'notDeepStrictEqual_mixed':104 values = array.map((_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]);105 values2 = values.slice(0);106 values2[0] = ['w00t', 123];107 benchmark(assert.notDeepStrictEqual, n, values, values2);108 break;109 case 'notDeepEqual_looseMatches':110 values = array.map((_, i) => [i, i]);111 values2 = values.slice().map((v) => [String(v[0]), String(v[1])]);112 values2[len - 1] = [String(len + 1), String(len + 1)];113 benchmark(assert.notDeepEqual, n, values, values2);114 break;115 default:116 throw new Error('Unsupported method');117 }...
deepequal-set.js
Source:deepequal-set.js
1'use strict';2/* eslint-disable no-restricted-properties */3const common = require('../common.js');4const assert = require('assert');5const bench = common.createBenchmark(main, {6 n: [5e2],7 len: [5e2],8 method: [9 'deepEqual_primitiveOnly',10 'deepStrictEqual_primitiveOnly',11 'deepEqual_objectOnly',12 'deepStrictEqual_objectOnly',13 'deepEqual_mixed',14 'deepStrictEqual_mixed',15 'deepEqual_looseMatches',16 'notDeepEqual_primitiveOnly',17 'notDeepStrictEqual_primitiveOnly',18 'notDeepEqual_objectOnly',19 'notDeepStrictEqual_objectOnly',20 'notDeepEqual_mixed',21 'notDeepStrictEqual_mixed',22 'notDeepEqual_looseMatches',23 ]24});25function benchmark(method, n, values, values2) {26 const actual = new Set(values);27 // Prevent reference equal elements28 const deepCopy = JSON.parse(JSON.stringify(values2 ? values2 : values));29 const expected = new Set(deepCopy);30 bench.start();31 for (var i = 0; i < n; ++i) {32 method(actual, expected);33 }34 bench.end(n);35}36function main(conf) {37 const n = +conf.n;38 const len = +conf.len;39 const array = Array(len).fill(1);40 var values, values2;41 switch (conf.method) {42 case '':43 // Empty string falls through to next line as default, mostly for tests.44 case 'deepEqual_primitiveOnly':45 values = array.map((_, i) => `str_${i}`);46 benchmark(assert.deepEqual, n, values);47 break;48 case 'deepStrictEqual_primitiveOnly':49 values = array.map((_, i) => `str_${i}`);50 benchmark(assert.deepStrictEqual, n, values);51 break;52 case 'deepEqual_objectOnly':53 values = array.map((_, i) => [`str_${i}`, null]);54 benchmark(assert.deepEqual, n, values);55 break;56 case 'deepStrictEqual_objectOnly':57 values = array.map((_, i) => [`str_${i}`, null]);58 benchmark(assert.deepStrictEqual, n, values);59 break;60 case 'deepEqual_mixed':61 values = array.map((_, i) => {62 return i % 2 ? [`str_${i}`, null] : `str_${i}`;63 });64 benchmark(assert.deepEqual, n, values);65 break;66 case 'deepStrictEqual_mixed':67 values = array.map((_, i) => {68 return i % 2 ? [`str_${i}`, null] : `str_${i}`;69 });70 benchmark(assert.deepStrictEqual, n, values);71 break;72 case 'deepEqual_looseMatches':73 values = array.map((_, i) => i);74 values2 = values.slice().map((v) => String(v));75 benchmark(assert.deepEqual, n, values, values2);76 break;77 case 'notDeepEqual_primitiveOnly':78 values = array.map((_, i) => `str_${i}`);79 values2 = values.slice(0);80 values2[Math.floor(len / 2)] = 'w00t';81 benchmark(assert.notDeepEqual, n, values, values2);82 break;83 case 'notDeepStrictEqual_primitiveOnly':84 values = array.map((_, i) => `str_${i}`);85 values2 = values.slice(0);86 values2[Math.floor(len / 2)] = 'w00t';87 benchmark(assert.notDeepStrictEqual, n, values, values2);88 break;89 case 'notDeepEqual_objectOnly':90 values = array.map((_, i) => [`str_${i}`, null]);91 values2 = values.slice(0);92 values2[Math.floor(len / 2)] = ['w00t'];93 benchmark(assert.notDeepEqual, n, values, values2);94 break;95 case 'notDeepStrictEqual_objectOnly':96 values = array.map((_, i) => [`str_${i}`, null]);97 values2 = values.slice(0);98 values2[Math.floor(len / 2)] = ['w00t'];99 benchmark(assert.notDeepStrictEqual, n, values, values2);100 break;101 case 'notDeepEqual_mixed':102 values = array.map((_, i) => {103 return i % 2 ? [`str_${i}`, null] : `str_${i}`;104 });105 values2 = values.slice();106 values2[0] = 'w00t';107 benchmark(assert.notDeepEqual, n, values, values2);108 break;109 case 'notDeepStrictEqual_mixed':110 values = array.map((_, i) => {111 return i % 2 ? [`str_${i}`, null] : `str_${i}`;112 });113 values2 = values.slice();114 values2[0] = 'w00t';115 benchmark(assert.notDeepStrictEqual, n, values, values2);116 break;117 case 'notDeepEqual_looseMatches':118 values = array.map((_, i) => i);119 values2 = values.slice().map((v) => String(v));120 values2[len - 1] = String(len + 1);121 benchmark(assert.notDeepEqual, n, values, values2);122 break;123 default:124 throw new Error('Unsupported method');125 }...
Using AI Code Generation
1import { values2 } from 'fast-check-monorepo';2console.log(values2);3import { values2 } from 'fast-check-monorepo';4console.log(values2);5import { values2 } from 'fast-check-monorepo';6console.log(values2);7import { values2 } from 'fast-check-monorepo';8console.log(values2);9import { values2 } from 'fast-check-monorepo';10console.log(values2);11import { values2 } from 'fast-check-monorepo';12console.log(values2);13import { values2 } from 'fast-check-monorepo';14console.log(values2);15import { values2 } from 'fast-check-monorepo';16console.log(values2);17import { values2 } from 'fast-check-monorepo';18console.log(values2);19import { values2 } from 'fast-check-monorepo';20console.log(values2);21import { values2 } from 'fast-check-monorepo';22console.log(values2);23import { values2 } from 'fast-check-monorepo';24console.log(values2);25import { values2 } from 'fast-check-monorepo';26console.log(values2);27import { values2
Using AI Code Generation
1const { values2 } = require('fast-check');2const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary');3const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');4const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');5const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');6const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');7const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');8const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');9const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');10const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');11const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');12const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');13const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');14const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');15const { values2 } = require('fast-check/lib/check/arbitrary/definition/ValuesArbitrary.js');16const { values2 } = require('fast-check/lib/check/arbitrary/
Using AI Code Generation
1const { values2 } = require('fast-check-monorepo');2const { values2 } = require('fast-check');3const { values2 } = require('fast-check-monorepo');4const { values2 } = require('fast-check');5const { values2 } = require('fast-check-monorepo');6const { values2 } = require('fast-check');7const { values2 } = require('fast-check-monorepo');8const { values2 } = require('fast-check');9const { values2 } = require('fast-check-monorepo');10const { values2 } = require('fast-check');11const { values2 } = require('fast-check-monorepo');
Using AI Code Generation
1const fc = require('fast-check');2const { values2 } = require('fast-check-monorepo');3const myArb = values2([1, 2, 3]);4fc.assert(5 fc.property(myArb, (value) => {6 return value === 1 || value === 2 || value === 3;7 })8);9const { values2 } = require('./src/arbitrary/values2');10module.exports = {11};12const fc = require('fast-check');13const { values2 } = require('fast-check-monorepo');14const myArb = values2([1, 2, 3]);15fc.assert(16 fc.property(myArb, (value) => {17 return value === 1 || value === 2 || value === 3;18 })19);
Using AI Code Generation
1const { values2 } = require('fast-check-monorepo');2const { values } = require('fast-check');3describe('test', () => {4 it('test', () => {5 values2().forEach((v) => {6 console.log(v);7 });8 });9});
Using AI Code Generation
1import { values2 } from 'fast-check-monorepo';2const values = values2();3console.log(values);4import { values2 } from 'fast-check-monorepo';5const values = values2();6console.log(values);7import { values2 } from 'fast-check-monorepo';8const values = values2();9console.log(values);10import { values2 } from 'fast-check-monorepo';11const values = values2();12console.log(values);13import { values2 } from 'fast-check-monorepo';14const values = values2();15console.log(values);16import { values2 } from 'fast-check-monorepo';17const values = values2();18console.log(values);19import { values2 } from 'fast-check-monorepo';20const values = values2();21console.log(values);22import { values2 } from 'fast-check-monorepo';23const values = values2();24console.log(values);25import { values2 } from 'fast-check-monorepo';26const values = values2();27console.log(values);28import { values2 } from 'fast-check-monorepo
Using AI Code Generation
1const { values2 } = require('fast-check');2const { values } = require('fast-check/lib/check/arbitrary/definition/ValueArbitrary');3console.log(values2(1, 2, 3));4console.log(values(1, 2, 3));5{6 "scripts": {7 },8 "dependencies": {9 }10}11| Packages / Softwares | Version(s) |
Using AI Code Generation
1const {values2} = require("fast-check-monorepo/dist/lib/check/runner/Runner.js");2const fc = require("fast-check");3const {property} = fc;4const {map} = require("immutable");5const {List} = require("immutable");6const {Map} = require("immutable");7const {Set} = require("immutable");8const {Seq} = require("immutable");9const {Record} = require("immutable");10const {Stack} = require("immutable");11const {Range} = require("immutable");12const {Repeat} = require("immutable");13const {OrderedMap} = require("immutable");14const {OrderedSet} = require("immutable");15const {is} = require("immutable");16const {fromJS} = require("immutable");17const {isImmutable} = require("immutable");18const {isKeyed} = require("immutable");19const {isIndexed} = require("immutable");20const {isAssociative} = require("immutable");21const {isOrdered} = require("immutable");22const {isValueObject} = require("immutable");23const {hash} = require("immutable");24const {equals} = require("immutable");25const {Collection} = require("immutable");26const {KeyedCollection} = require("immutable");27const {IndexedCollection} = require("immutable");28const {SetCollection} = require("immutable");29const {StackCollection} = require("immutable");30const {MapPrototype} = require("immutable");31const {OrderedMapPrototype} = require("immutable");32const {ListPrototype} = require("immutable");33const {StackPrototype} = require("immutable");34const {SeqPrototype} = require("immutable");35const {SetPrototype} = require("immutable");36const {OrderedSetPrototype} = require("immutable");37const {RangePrototype} = require("immutable");38const {RepeatPrototype} = require("immutable");39const {Iterable} = require("immutable");40const {Iterator} = require("immutable");41const {IteratorPrototype} = require("immutable");42const {KeyedIterable} = require("immutable");43const {IndexedIterable} = require("immutable");44const {SetIterable} = require("immutable");45const {KeyedSeq} = require("immutable");46const {IndexedSeq} = require("immutable");47const {SetSeq} = require("immutable");48const {ArraySeq} = require("immutable");49const {ObjectSeq} = require("immutable");
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!