How to use nFlags method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

TableCellChanges.js

Source:TableCellChanges.js Github

copy

Full Screen

1/*2 * (c) Copyright Ascensio System SIA 2010-20193 *4 * This program is a free software product. You can redistribute it and/or5 * modify it under the terms of the GNU Affero General Public License (AGPL)6 * version 3 as published by the Free Software Foundation. In accordance with7 * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect8 * that Ascensio System SIA expressly excludes the warranty of non-infringement9 * of any third-party rights.10 *11 * This program is distributed WITHOUT ANY WARRANTY; without even the implied12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For13 * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html14 *15 * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha16 * street, Riga, Latvia, EU, LV-1050.17 *18 * The interactive user interfaces in modified source and object code versions19 * of the Program must display Appropriate Legal Notices, as required under20 * Section 5 of the GNU AGPL version 3.21 *22 * Pursuant to Section 7(b) of the License you must retain the original Product23 * logo when distributing the program. Pursuant to Section 7(e) we decline to24 * grant you any rights under trademark law for use of our trademarks.25 *26 * All the Product's GUI elements, including illustrations and icon sets, as27 * well as technical writing content are licensed under the terms of the28 * Creative Commons Attribution-ShareAlike 4.0 International. See the License29 * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode30 *31 */32"use strict";33/**34 * User: Ilja.Kirillov35 * Date: 07.11.201636 * Time: 16:5737 */38AscDFH.changesFactory[AscDFH.historyitem_TableCell_GridSpan] = CChangesTableCellGridSpan;39AscDFH.changesFactory[AscDFH.historyitem_TableCell_Margins] = CChangesTableCellMargins;40AscDFH.changesFactory[AscDFH.historyitem_TableCell_Shd] = CChangesTableCellShd;41AscDFH.changesFactory[AscDFH.historyitem_TableCell_VMerge] = CChangesTableCellVMerge;42AscDFH.changesFactory[AscDFH.historyitem_TableCell_Border_Left] = CChangesTableCellBorderLeft;43AscDFH.changesFactory[AscDFH.historyitem_TableCell_Border_Right] = CChangesTableCellBorderRight;44AscDFH.changesFactory[AscDFH.historyitem_TableCell_Border_Top] = CChangesTableCellBorderTop;45AscDFH.changesFactory[AscDFH.historyitem_TableCell_Border_Bottom] = CChangesTableCellBorderBottom;46AscDFH.changesFactory[AscDFH.historyitem_TableCell_VAlign] = CChangesTableCellVAlign;47AscDFH.changesFactory[AscDFH.historyitem_TableCell_W] = CChangesTableCellW;48AscDFH.changesFactory[AscDFH.historyitem_TableCell_Pr] = CChangesTableCellPr;49AscDFH.changesFactory[AscDFH.historyitem_TableCell_TextDirection] = CChangesTableCellTextDirection;50AscDFH.changesFactory[AscDFH.historyitem_TableCell_NoWrap] = CChangesTableCellNoWrap;51AscDFH.changesFactory[AscDFH.historyitem_TableCell_HMerge] = CChangesTableCellHMerge;52AscDFH.changesFactory[AscDFH.historyitem_TableCell_PrChange] = CChangesTableCellPrChange;53//----------------------------------------------------------------------------------------------------------------------54// Карта зависимости изменений55//----------------------------------------------------------------------------------------------------------------------56AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_GridSpan] = [57 AscDFH.historyitem_TableCell_GridSpan,58 AscDFH.historyitem_TableCell_Pr59];60AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Margins] = [61 AscDFH.historyitem_TableCell_Margins,62 AscDFH.historyitem_TableCell_Pr63];64AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Shd] = [65 AscDFH.historyitem_TableCell_Shd,66 AscDFH.historyitem_TableCell_Pr67];68AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_VMerge] = [69 AscDFH.historyitem_TableCell_VMerge,70 AscDFH.historyitem_TableCell_Pr71];72AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Border_Left] = [73 AscDFH.historyitem_TableCell_Border_Left,74 AscDFH.historyitem_TableCell_Pr75];76AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Border_Right] = [77 AscDFH.historyitem_TableCell_Border_Right,78 AscDFH.historyitem_TableCell_Pr79];80AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Border_Top] = [81 AscDFH.historyitem_TableCell_Border_Top,82 AscDFH.historyitem_TableCell_Pr83];84AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Border_Bottom] = [85 AscDFH.historyitem_TableCell_Border_Bottom,86 AscDFH.historyitem_TableCell_Pr87];88AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_VAlign] = [89 AscDFH.historyitem_TableCell_VAlign,90 AscDFH.historyitem_TableCell_Pr91];92AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_W] = [93 AscDFH.historyitem_TableCell_W,94 AscDFH.historyitem_TableCell_Pr95];96AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Pr] = [97 AscDFH.historyitem_TableCell_GridSpan,98 AscDFH.historyitem_TableCell_Margins,99 AscDFH.historyitem_TableCell_Shd,100 AscDFH.historyitem_TableCell_VMerge,101 AscDFH.historyitem_TableCell_Border_Left,102 AscDFH.historyitem_TableCell_Border_Right,103 AscDFH.historyitem_TableCell_Border_Top,104 AscDFH.historyitem_TableCell_Border_Bottom,105 AscDFH.historyitem_TableCell_VAlign,106 AscDFH.historyitem_TableCell_W,107 AscDFH.historyitem_TableCell_Pr,108 AscDFH.historyitem_TableCell_TextDirection,109 AscDFH.historyitem_TableCell_NoWrap,110 AscDFH.historyitem_TableCell_HMerge,111 AscDFH.historyitem_TableCell_PrChange112];113AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_TextDirection] = [114 AscDFH.historyitem_TableCell_TextDirection,115 AscDFH.historyitem_TableCell_Pr116];117AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_NoWrap] = [118 AscDFH.historyitem_TableCell_NoWrap,119 AscDFH.historyitem_TableCell_Pr120];121AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_HMerge] = [122 AscDFH.historyitem_TableCell_HMerge,123 AscDFH.historyitem_TableCell_Pr124];125AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_PrChange] = [126 AscDFH.historyitem_TableCell_PrChange,127 AscDFH.historyitem_TableCell_Pr128];129/**130 * Общая функция объединения изменений, которые зависят только от себя и AscDFH.historyitem_TableCell_Pr131 * @param oChange132 * @returns {boolean}133 */134function private_TableCellChangesOnMergePr(oChange)135{136 if (oChange.Class !== this.Class)137 return true;138 if (oChange.Type === this.Type || oChange.Type === AscDFH.historyitem_TableCell_Pr)139 return false;140 return true;141}142//----------------------------------------------------------------------------------------------------------------------143/**144 * @constructor145 * @extends {AscDFH.CChangesBaseLongProperty}146 */147function CChangesTableCellGridSpan(Class, Old, New, Color)148{149 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);150}151CChangesTableCellGridSpan.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);152CChangesTableCellGridSpan.prototype.constructor = CChangesTableCellGridSpan;153CChangesTableCellGridSpan.prototype.Type = AscDFH.historyitem_TableCell_GridSpan;154CChangesTableCellGridSpan.prototype.private_SetValue = function(Value)155{156 var oCell = this.Class;157 oCell.Pr.GridSpan = Value;158 oCell.Recalc_CompiledPr();159 oCell.private_UpdateTableGrid();160};161CChangesTableCellGridSpan.prototype.Merge = private_TableCellChangesOnMergePr;162/**163 * @constructor164 * @extends {AscDFH.CChangesBaseProperty}165 */166function CChangesTableCellMargins(Class, Old, New, Color)167{168 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);169}170CChangesTableCellMargins.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);171CChangesTableCellMargins.prototype.constructor = CChangesTableCellMargins;172CChangesTableCellMargins.prototype.Type = AscDFH.historyitem_TableCell_Margins;173CChangesTableCellMargins.prototype.WriteToBinary = function(Writer)174{175 // Long : Flag176 // 1-bit : Is New undefined?177 // 2-bit : Is New null?178 // 3-bit : Is Old undefined?179 // 4-bit : Is Old null?180 // 5-bit : is New.Left undefined181 // 6-bit : is New.Top undefined182 // 7-bit : is New.Right undefined183 // 8-bit : is New.Bottom undefined184 // 9-bit : is Old.Left undefined185 // 10-bit : is Old.Top undefined186 // 11-bit : is Old.Right undefined187 // 12-bit : is Old.Bottom undefined188 // CTableMeasure : New.Left189 // CTableMeasure : New.Top190 // CTableMeasure : New.Right191 // CTableMeasure : New.Bottom192 // CTableMeasure : Old.Left193 // CTableMeasure : Old.Top194 // CTableMeasure : Old.Right195 // CTableMeasure : Old.Bottom196 var nFlags = 0;197 if (undefined === this.New)198 nFlags |= 1;199 if (null === this.New)200 nFlags |= 2;201 if (undefined === this.Old)202 nFlags |= 4;203 if (null === this.Old)204 nFlags |= 8;205 if (this.New)206 {207 if (this.New.Left)208 nFlags |= 16;209 if (this.New.Top)210 nFlags |= 32;211 if (this.New.Right)212 nFlags |= 64;213 if (this.New.Bottom)214 nFlags |= 128;215 }216 if (this.Old)217 {218 if (this.Old.Left)219 nFlags |= 256;220 if (this.Old.Top)221 nFlags |= 512;222 if (this.Old.Right)223 nFlags |= 1024;224 if (this.Old.Bottom)225 nFlags |= 2048;226 }227 Writer.WriteLong(nFlags);228 if (this.New)229 {230 if (this.New.Left)231 this.New.Left.WriteToBinary(Writer);232 if (this.New.Top)233 this.New.Top.WriteToBinary(Writer);234 if (this.New.Right)235 this.New.Right.WriteToBinary(Writer);236 if (this.New.Bottom)237 this.New.Bottom.WriteToBinary(Writer);238 }239 if (this.Old)240 {241 if (this.Old.Left)242 this.Old.Left.WriteToBinary(Writer);243 if (this.Old.Top)244 this.Old.Top.WriteToBinary(Writer);245 if (this.Old.Right)246 this.Old.Right.WriteToBinary(Writer);247 if (this.Old.Bottom)248 this.Old.Bottom.WriteToBinary(Writer);249 }250};251CChangesTableCellMargins.prototype.ReadFromBinary = function(Reader)252{253 // Long : Flag254 // 1-bit : Is New undefined?255 // 2-bit : Is New null?256 // 3-bit : Is Old undefined?257 // 4-bit : Is Old null?258 // 5-bit : is New.Left undefined259 // 6-bit : is New.Top undefined260 // 7-bit : is New.Right undefined261 // 8-bit : is New.Bottom undefined262 // 9-bit : is Old.Left undefined263 // 10-bit : is Old.Top undefined264 // 11-bit : is Old.Right undefined265 // 12-bit : is Old.Bottom undefined266 // CTableMeasure : New.Left267 // CTableMeasure : New.Top268 // CTableMeasure : New.Right269 // CTableMeasure : New.Bottom270 // CTableMeasure : Old.Left271 // CTableMeasure : Old.Top272 // CTableMeasure : Old.Right273 // CTableMeasure : Old.Bottom274 var nFlags = Reader.GetLong();275 if (nFlags & 1)276 {277 this.New = undefined;278 }279 else if (nFlags & 2)280 {281 this.New = null;282 }283 else284 {285 this.New = {286 Left : undefined,287 Top : undefined,288 Right : undefined,289 Bottom : undefined290 };291 if (nFlags & 16)292 {293 this.New.Left = new CTableMeasurement(tblwidth_Auto, 0);294 this.New.Left.ReadFromBinary(Reader);295 }296 if (nFlags & 32)297 {298 this.New.Top = new CTableMeasurement(tblwidth_Auto, 0);299 this.New.Top.ReadFromBinary(Reader);300 }301 if (nFlags & 64)302 {303 this.New.Right = new CTableMeasurement(tblwidth_Auto, 0);304 this.New.Right.ReadFromBinary(Reader);305 }306 if (nFlags & 128)307 {308 this.New.Bottom = new CTableMeasurement(tblwidth_Auto, 0);309 this.New.Bottom.ReadFromBinary(Reader);310 }311 }312 if (nFlags & 4)313 {314 this.Old = undefined;315 }316 else if (nFlags & 8)317 {318 this.Old = null;319 }320 else321 {322 this.Old = {323 Left : undefined,324 Top : undefined,325 Right : undefined,326 Bottom : undefined327 };328 if (nFlags & 256)329 {330 this.Old.Left = new CTableMeasurement(tblwidth_Auto, 0);331 this.Old.Left.ReadFromBinary(Reader);332 }333 if (nFlags & 512)334 {335 this.Old.Top = new CTableMeasurement(tblwidth_Auto, 0);336 this.Old.Top.ReadFromBinary(Reader);337 }338 if (nFlags & 1024)339 {340 this.Old.Right = new CTableMeasurement(tblwidth_Auto, 0);341 this.Old.Right.ReadFromBinary(Reader);342 }343 if (nFlags & 2048)344 {345 this.Old.Bottom = new CTableMeasurement(tblwidth_Auto, 0);346 this.Old.Bottom.ReadFromBinary(Reader);347 }348 }349};350CChangesTableCellMargins.prototype.private_SetValue = function(Value)351{352 var oCell = this.Class;353 oCell.Pr.TableCellMar = Value;354 oCell.Recalc_CompiledPr();355 oCell.private_UpdateTableGrid();356};357CChangesTableCellMargins.prototype.Merge = private_TableCellChangesOnMergePr;358/**359 * @constructor360 * @extends {AscDFH.CChangesBaseObjectProperty}361 */362function CChangesTableCellShd(Class, Old, New, Color)363{364 AscDFH.CChangesBaseObjectProperty.call(this, Class, Old, New, Color);365}366CChangesTableCellShd.prototype = Object.create(AscDFH.CChangesBaseObjectProperty.prototype);367CChangesTableCellShd.prototype.constructor = CChangesTableCellShd;368CChangesTableCellShd.prototype.Type = AscDFH.historyitem_TableCell_Shd;369CChangesTableCellShd.prototype.private_CreateObject = function()370{371 return new CDocumentShd();372};373CChangesTableCellShd.prototype.private_SetValue = function(Value)374{375 var oCell = this.Class;376 oCell.Pr.Shd = Value;377 oCell.Recalc_CompiledPr();378};379CChangesTableCellShd.prototype.Merge = private_TableCellChangesOnMergePr;380/**381 * @constructor382 * @extends {AscDFH.CChangesBaseLongProperty}383 */384function CChangesTableCellVMerge(Class, Old, New, Color)385{386 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);387}388CChangesTableCellVMerge.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);389CChangesTableCellVMerge.prototype.constructor = CChangesTableCellVMerge;390CChangesTableCellVMerge.prototype.Type = AscDFH.historyitem_TableCell_VMerge;391CChangesTableCellVMerge.prototype.private_SetValue = function(Value)392{393 var oCell = this.Class;394 oCell.Pr.VMerge = Value;395 oCell.Recalc_CompiledPr();396};397CChangesTableCellVMerge.prototype.Merge = private_TableCellChangesOnMergePr;398/**399 * @constructor400 * @extends {AscDFH.CChangesBaseProperty}401 */402function CChangesTableCellBorderLeft(Class, Old, New, Color)403{404 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);405}406CChangesTableCellBorderLeft.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);407CChangesTableCellBorderLeft.prototype.constructor = CChangesTableCellBorderLeft;408CChangesTableCellBorderLeft.prototype.Type = AscDFH.historyitem_TableCell_Border_Left;409CChangesTableCellBorderLeft.prototype.WriteToBinary = function(Writer)410{411 // Long : Flag412 // 1-bit : Is New undefined?413 // 2-bit : Is New null?414 // 3-bit : Is Old undefined?415 // 4-bit : Is Old null?416 // CDocumentBorder : New417 // CDocumentBorder : Old418 var nFlags = 0;419 if (undefined === this.New)420 nFlags |= 1;421 if (null === this.New)422 nFlags |= 2;423 if (undefined === this.Old)424 nFlags |= 4;425 if (null === this.Old)426 nFlags |= 8;427 Writer.WriteLong(nFlags);428 if (undefined !== this.New && null !== this.New)429 this.New.Write_ToBinary(Writer);430 if (undefined !== this.Old && null !== this.Old)431 this.Old.Write_ToBinary(Writer);432};433CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader)434{435 // Long : Flag436 // 1-bit : Is New undefined?437 // 2-bit : Is New null?438 // 3-bit : Is Old undefined?439 // 4-bit : Is Old null?440 // CDocumentBorder : New441 // CDocumentBorder : Old442 var nFlags = Reader.GetLong();443 if (nFlags & 1)444 {445 this.New = undefined;446 }447 else if (nFlags & 2)448 {449 this.New = null;450 }451 else452 {453 this.New = new CDocumentBorder();454 this.New.Read_FromBinary(Reader);455 }456 if (nFlags & 4)457 {458 this.Old = undefined;459 }460 else if (nFlags & 8)461 {462 this.Old = null;463 }464 else465 {466 this.Old = new CDocumentBorder();467 this.Old.Read_FromBinary(Reader);468 }469};470CChangesTableCellBorderLeft.prototype.private_SetValue = function(Value)471{472 var oCell = this.Class;473 oCell.Pr.TableCellBorders.Left = Value;474 oCell.Recalc_CompiledPr();475};476CChangesTableCellBorderLeft.prototype.Merge = private_TableCellChangesOnMergePr;477/**478 * @constructor479 * @extends {AscDFH.CChangesBaseProperty}480 */481function CChangesTableCellBorderTop(Class, Old, New, Color)482{483 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);484}485CChangesTableCellBorderTop.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);486CChangesTableCellBorderTop.prototype.constructor = CChangesTableCellBorderTop;487CChangesTableCellBorderTop.prototype.Type = AscDFH.historyitem_TableCell_Border_Top;488CChangesTableCellBorderTop.prototype.WriteToBinary = function(Writer)489{490 // Long : Flag491 // 1-bit : Is New undefined?492 // 2-bit : Is New null?493 // 3-bit : Is Old undefined?494 // 4-bit : Is Old null?495 // CDocumentBorder : New496 // CDocumentBorder : Old497 var nFlags = 0;498 if (undefined === this.New)499 nFlags |= 1;500 if (null === this.New)501 nFlags |= 2;502 if (undefined === this.Old)503 nFlags |= 4;504 if (null === this.Old)505 nFlags |= 8;506 Writer.WriteLong(nFlags);507 if (undefined !== this.New && null !== this.New)508 this.New.Write_ToBinary(Writer);509 if (undefined !== this.Old && null !== this.Old)510 this.Old.Write_ToBinary(Writer);511};512CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader)513{514 // Long : Flag515 // 1-bit : Is New undefined?516 // 2-bit : Is New null?517 // 3-bit : Is Old undefined?518 // 4-bit : Is Old null?519 // CDocumentBorder : New520 // CDocumentBorder : Old521 var nFlags = Reader.GetLong();522 if (nFlags & 1)523 {524 this.New = undefined;525 }526 else if (nFlags & 2)527 {528 this.New = null;529 }530 else531 {532 this.New = new CDocumentBorder();533 this.New.Read_FromBinary(Reader);534 }535 if (nFlags & 4)536 {537 this.Old = undefined;538 }539 else if (nFlags & 8)540 {541 this.Old = null;542 }543 else544 {545 this.Old = new CDocumentBorder();546 this.Old.Read_FromBinary(Reader);547 }548};549CChangesTableCellBorderTop.prototype.private_SetValue = function(Value)550{551 var oCell = this.Class;552 oCell.Pr.TableCellBorders.Top = Value;553 oCell.Recalc_CompiledPr();554};555CChangesTableCellBorderTop.prototype.Merge = private_TableCellChangesOnMergePr;556/**557 * @constructor558 * @extends {AscDFH.CChangesBaseProperty}559 */560function CChangesTableCellBorderRight(Class, Old, New, Color)561{562 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);563}564CChangesTableCellBorderRight.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);565CChangesTableCellBorderRight.prototype.constructor = CChangesTableCellBorderRight;566CChangesTableCellBorderRight.prototype.Type = AscDFH.historyitem_TableCell_Border_Right;567CChangesTableCellBorderRight.prototype.WriteToBinary = function(Writer)568{569 // Long : Flag570 // 1-bit : Is New undefined?571 // 2-bit : Is New null?572 // 3-bit : Is Old undefined?573 // 4-bit : Is Old null?574 // CDocumentBorder : New575 // CDocumentBorder : Old576 var nFlags = 0;577 if (undefined === this.New)578 nFlags |= 1;579 if (null === this.New)580 nFlags |= 2;581 if (undefined === this.Old)582 nFlags |= 4;583 if (null === this.Old)584 nFlags |= 8;585 Writer.WriteLong(nFlags);586 if (undefined !== this.New && null !== this.New)587 this.New.Write_ToBinary(Writer);588 if (undefined !== this.Old && null !== this.Old)589 this.Old.Write_ToBinary(Writer);590};591CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader)592{593 // Long : Flag594 // 1-bit : Is New undefined?595 // 2-bit : Is New null?596 // 3-bit : Is Old undefined?597 // 4-bit : Is Old null?598 // CDocumentBorder : New599 // CDocumentBorder : Old600 var nFlags = Reader.GetLong();601 if (nFlags & 1)602 {603 this.New = undefined;604 }605 else if (nFlags & 2)606 {607 this.New = null;608 }609 else610 {611 this.New = new CDocumentBorder();612 this.New.Read_FromBinary(Reader);613 }614 if (nFlags & 4)615 {616 this.Old = undefined;617 }618 else if (nFlags & 8)619 {620 this.Old = null;621 }622 else623 {624 this.Old = new CDocumentBorder();625 this.Old.Read_FromBinary(Reader);626 }627};628CChangesTableCellBorderRight.prototype.private_SetValue = function(Value)629{630 var oCell = this.Class;631 oCell.Pr.TableCellBorders.Right = Value;632 oCell.Recalc_CompiledPr();633};634CChangesTableCellBorderRight.prototype.Merge = private_TableCellChangesOnMergePr;635/**636 * @constructor637 * @extends {AscDFH.CChangesBaseProperty}638 */639function CChangesTableCellBorderBottom(Class, Old, New, Color)640{641 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);642}643CChangesTableCellBorderBottom.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);644CChangesTableCellBorderBottom.prototype.constructor = CChangesTableCellBorderBottom;645CChangesTableCellBorderBottom.prototype.Type = AscDFH.historyitem_TableCell_Border_Bottom;646CChangesTableCellBorderBottom.prototype.WriteToBinary = function(Writer)647{648 // Long : Flag649 // 1-bit : Is New undefined?650 // 2-bit : Is New null?651 // 3-bit : Is Old undefined?652 // 4-bit : Is Old null?653 // CDocumentBorder : New654 // CDocumentBorder : Old655 var nFlags = 0;656 if (undefined === this.New)657 nFlags |= 1;658 if (null === this.New)659 nFlags |= 2;660 if (undefined === this.Old)661 nFlags |= 4;662 if (null === this.Old)663 nFlags |= 8;664 Writer.WriteLong(nFlags);665 if (undefined !== this.New && null !== this.New)666 this.New.Write_ToBinary(Writer);667 if (undefined !== this.Old && null !== this.Old)668 this.Old.Write_ToBinary(Writer);669};670CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader)671{672 // Long : Flag673 // 1-bit : Is New undefined?674 // 2-bit : Is New null?675 // 3-bit : Is Old undefined?676 // 4-bit : Is Old null?677 // CDocumentBorder : New678 // CDocumentBorder : Old679 var nFlags = Reader.GetLong();680 if (nFlags & 1)681 {682 this.New = undefined;683 }684 else if (nFlags & 2)685 {686 this.New = null;687 }688 else689 {690 this.New = new CDocumentBorder();691 this.New.Read_FromBinary(Reader);692 }693 if (nFlags & 4)694 {695 this.Old = undefined;696 }697 else if (nFlags & 8)698 {699 this.Old = null;700 }701 else702 {703 this.Old = new CDocumentBorder();704 this.Old.Read_FromBinary(Reader);705 }706};707CChangesTableCellBorderBottom.prototype.private_SetValue = function(Value)708{709 var oCell = this.Class;710 oCell.Pr.TableCellBorders.Bottom = Value;711 oCell.Recalc_CompiledPr();712};713CChangesTableCellBorderBottom.prototype.Merge = private_TableCellChangesOnMergePr;714/**715 * @constructor716 * @extends {AscDFH.CChangesBaseLongProperty}717 */718function CChangesTableCellVAlign(Class, Old, New, Color)719{720 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);721}722CChangesTableCellVAlign.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);723CChangesTableCellVAlign.prototype.constructor = CChangesTableCellVAlign;724CChangesTableCellVAlign.prototype.Type = AscDFH.historyitem_TableCell_VAlign;725CChangesTableCellVAlign.prototype.private_SetValue = function(Value)726{727 var oCell = this.Class;728 oCell.Pr.VAlign = Value;729 oCell.Recalc_CompiledPr();730};731CChangesTableCellVAlign.prototype.Merge = private_TableCellChangesOnMergePr;732/**733 * @constructor734 * @extends {AscDFH.CChangesBaseObjectValue}735 */736function CChangesTableCellW(Class, Old, New, Color)737{738 AscDFH.CChangesBaseObjectValue.call(this, Class, Old, New, Color);739}740CChangesTableCellW.prototype = Object.create(AscDFH.CChangesBaseObjectValue.prototype);741CChangesTableCellW.prototype.constructor = CChangesTableCellW;742CChangesTableCellW.prototype.Type = AscDFH.historyitem_TableCell_W;743CChangesTableCellW.prototype.private_CreateObject = function()744{745 return new CTableMeasurement(tblwidth_Auto, 0);746};747CChangesTableCellW.prototype.private_SetValue = function(Value)748{749 var oCell = this.Class;750 oCell.Pr.TableCellW = Value;751 oCell.Recalc_CompiledPr();752 oCell.private_UpdateTableGrid();753};754CChangesTableCellW.prototype.Merge = private_TableCellChangesOnMergePr;755/**756 * @constructor757 * @extends {AscDFH.CChangesBaseObjectValue}758 */759function CChangesTableCellPr(Class, Old, New, Color)760{761 AscDFH.CChangesBaseObjectValue.call(this, Class, Old, New, Color);762}763CChangesTableCellPr.prototype = Object.create(AscDFH.CChangesBaseObjectValue.prototype);764CChangesTableCellPr.prototype.constructor = CChangesTableCellPr;765CChangesTableCellPr.prototype.Type = AscDFH.historyitem_TableCell_Pr;766CChangesTableCellPr.prototype.private_CreateObject = function()767{768 return new CTableCellPr();769};770CChangesTableCellPr.prototype.private_SetValue = function(Value)771{772 var oCell = this.Class;773 oCell.Pr = Value;774 oCell.Recalc_CompiledPr();775 oCell.private_UpdateTableGrid();776};777CChangesTableCellPr.prototype.Merge = function(oChange)778{779 if (this.Class !== oChange.Class)780 return true;781 if (this.Type === oChange.Type)782 return false;783 if (!this.New)784 this.New = new CTableCellPr();785 switch(oChange.Type)786 {787 case AscDFH.historyitem_TableCell_GridSpan:788 {789 this.New.GridSpan = oChange.New;790 break;791 }792 case AscDFH.historyitem_TableCell_Margins:793 {794 this.New.TableCellMar = oChange.New;795 break;796 }797 case AscDFH.historyitem_TableCell_Shd:798 {799 this.New.Shd = oChange.New;800 break;801 }802 case AscDFH.historyitem_TableCell_VMerge:803 {804 this.New.VMerge = oChange.New;805 break;806 }807 case AscDFH.historyitem_TableCell_Border_Left:808 {809 this.New.TableCellBorders.Left = oChange.New;810 break;811 }812 case AscDFH.historyitem_TableCell_Border_Right:813 {814 this.New.TableCellBorders.Right = oChange.New;815 break;816 }817 case AscDFH.historyitem_TableCell_Border_Top:818 {819 this.New.TableCellBorders.Top = oChange.New;820 break;821 }822 case AscDFH.historyitem_TableCell_Border_Bottom:823 {824 this.New.TableCellBorders.Bottom = oChange.New;825 break;826 }827 case AscDFH.historyitem_TableCell_VAlign:828 {829 this.New.VAlign = oChange.New;830 break;831 }832 case AscDFH.historyitem_TableCell_W:833 {834 this.New.TableCellW = oChange.New;835 break;836 }837 case AscDFH.historyitem_TableCell_TextDirection:838 {839 this.New.TextDirection = oChange.New;840 break;841 }842 case AscDFH.historyitem_TableCell_NoWrap:843 {844 this.New.NoWrap = oChange.New;845 break;846 }847 case AscDFH.historyitem_TableCell_HMerge:848 {849 this.New.HMerge = oChange.New;850 break;851 }852 }853 return true;854};855/**856 * @constructor857 * @extends {AscDFH.CChangesBaseLongProperty}858 */859function CChangesTableCellTextDirection(Class, Old, New, Color)860{861 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);862}863CChangesTableCellTextDirection.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);864CChangesTableCellTextDirection.prototype.constructor = CChangesTableCellTextDirection;865CChangesTableCellTextDirection.prototype.Type = AscDFH.historyitem_TableCell_TextDirection;866CChangesTableCellTextDirection.prototype.private_SetValue = function(Value)867{868 var oCell = this.Class;869 oCell.Pr.TextDirection = Value;870 oCell.Recalc_CompiledPr();871};872CChangesTableCellTextDirection.prototype.Merge = private_TableCellChangesOnMergePr;873/**874 * @constructor875 * @extends {AscDFH.CChangesBaseBoolProperty}876 */877function CChangesTableCellNoWrap(Class, Old, New, Color)878{879 AscDFH.CChangesBaseBoolProperty.call(this, Class, Old, New, Color);880}881CChangesTableCellNoWrap.prototype = Object.create(AscDFH.CChangesBaseBoolProperty.prototype);882CChangesTableCellNoWrap.prototype.constructor = CChangesTableCellNoWrap;883CChangesTableCellNoWrap.prototype.Type = AscDFH.historyitem_TableCell_NoWrap;884CChangesTableCellNoWrap.prototype.private_SetValue = function(Value)885{886 var oCell = this.Class;887 oCell.Pr.NoWrap = Value;888 oCell.Recalc_CompiledPr();889};890CChangesTableCellNoWrap.prototype.Merge = private_TableCellChangesOnMergePr;891/**892 * @constructor893 * @extends {AscDFH.CChangesBaseLongProperty}894 */895function CChangesTableCellHMerge(Class, Old, New, Color)896{897 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);898}899CChangesTableCellHMerge.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);900CChangesTableCellHMerge.prototype.constructor = CChangesTableCellHMerge;901CChangesTableCellHMerge.prototype.Type = AscDFH.historyitem_TableCell_HMerge;902CChangesTableCellHMerge.prototype.private_SetValue = function(Value)903{904 var oCell = this.Class;905 oCell.Pr.HMerge = Value;906 oCell.Recalc_CompiledPr();907};908CChangesTableCellHMerge.prototype.Merge = private_TableCellChangesOnMergePr;909/**910 * @constructor911 * @extends {AscDFH.CChangesBase}912 */913function CChangesTableCellPrChange(Class, Old, New)914{915 AscDFH.CChangesBase.call(this, Class);916 this.Old = Old;917 this.New = New;918}919CChangesTableCellPrChange.prototype = Object.create(AscDFH.CChangesBase.prototype);920CChangesTableCellPrChange.prototype.constructor = CChangesTableCellPrChange;921CChangesTableCellPrChange.prototype.Type = AscDFH.historyitem_TableCell_PrChange;922CChangesTableCellPrChange.prototype.Undo = function()923{924 var oTableCell = this.Class;925 oTableCell.Pr.PrChange = this.Old.PrChange;926 oTableCell.Pr.ReviewInfo = this.Old.ReviewInfo;927 oTableCell.private_UpdateTrackRevisions();928};929CChangesTableCellPrChange.prototype.Redo = function()930{931 var oTableCell = this.Class;932 oTableCell.Pr.PrChange = this.New.PrChange;933 oTableCell.Pr.ReviewInfo = this.New.ReviewInfo;934 oTableCell.private_UpdateTrackRevisions();935};936CChangesTableCellPrChange.prototype.WriteToBinary = function(oWriter)937{938 // Long : Flags939 // 1-bit : is New.PrChange undefined ?940 // 2-bit : is New.ReviewInfo undefined ?941 // 3-bit : is Old.PrChange undefined ?942 // 4-bit : is Old.ReviewInfo undefined ?943 // Variable(CTableCellPr) : New.PrChange (1bit = 0)944 // Variable(CReviewInfo) : New.ReviewInfo (2bit = 0)945 // Variable(CTableCellPr) : Old.PrChange (3bit = 0)946 // Variable(CReviewInfo) : Old.ReviewInfo (4bit = 0)947 var nFlags = 0;948 if (undefined === this.New.PrChange)949 nFlags |= 1;950 if (undefined === this.New.ReviewInfo)951 nFlags |= 2;952 if (undefined === this.Old.PrChange)953 nFlags |= 4;954 if (undefined === this.Old.ReviewInfo)955 nFlags |= 8;956 oWriter.WriteLong(nFlags);957 if (undefined !== this.New.PrChange)958 this.New.PrChange.WriteToBinary(oWriter);959 if (undefined !== this.New.ReviewInfo)960 this.New.ReviewInfo.WriteToBinary(oWriter);961 if (undefined !== this.Old.PrChange)962 this.Old.PrChange.WriteToBinary(oWriter);963 if (undefined !== this.Old.ReviewInfo)964 this.Old.ReviewInfo.WriteToBinary(oWriter);965};966CChangesTableCellPrChange.prototype.ReadFromBinary = function(oReader)967{968 // Long : Flags969 // 1-bit : is New.PrChange undefined ?970 // 2-bit : is New.ReviewInfo undefined ?971 // 3-bit : is Old.PrChange undefined ?972 // 4-bit : is Old.ReviewInfo undefined ?973 // Variable(CTableCellPr) : New.PrChange (1bit = 0)974 // Variable(CReviewInfo) : New.ReviewInfo (2bit = 0)975 // Variable(CTableCellPr) : Old.PrChange (3bit = 0)976 // Variable(CReviewInfo) : Old.ReviewInfo (4bit = 0)977 var nFlags = oReader.GetLong();978 this.New = {979 PrChange : undefined,980 ReviewInfo : undefined981 };982 this.Old = {983 PrChange : undefined,984 ReviewInfo : undefined985 };986 if (nFlags & 1)987 {988 this.New.PrChange = undefined;989 }990 else991 {992 this.New.PrChange = new CTableCellPr();993 this.New.PrChange.ReadFromBinary(oReader);994 }995 if (nFlags & 2)996 {997 this.New.ReviewInfo = undefined;998 }999 else1000 {1001 this.New.ReviewInfo = new CReviewInfo();1002 this.New.ReviewInfo.ReadFromBinary(oReader);1003 }1004 if (nFlags & 4)1005 {1006 this.Old.PrChange = undefined;1007 }1008 else1009 {1010 this.Old.PrChange = new CTableCellPr();1011 this.Old.PrChange.ReadFromBinary(oReader);1012 }1013 if (nFlags & 8)1014 {1015 this.Old.ReviewInfo = undefined;1016 }1017 else1018 {1019 this.Old.ReviewInfo = new CReviewInfo();1020 this.Old.ReviewInfo.ReadFromBinary(oReader);1021 }1022};1023CChangesTableCellPrChange.prototype.CreateReverseChange = function()1024{1025 return new CChangesTableCellPrChange(this.Class, this.New, this.Old);1026};1027CChangesTableCellPrChange.prototype.Merge = function(oChange)1028{1029 if (this.Class !== oChange.Class)1030 return true;1031 if (oChange.Type === this.Type || AscDFH.historyitem_TableCell_Pr === oChange.Type)1032 return false;1033 return true;...

Full Screen

Full Screen

TableCellChanges.js.js

Source:TableCellChanges.js.js Github

copy

Full Screen

1/*2 * (c) Copyright Ascensio System SIA 2010-20173 *4 * This program is a free software product. You can redistribute it and/or5 * modify it under the terms of the GNU Affero General Public License (AGPL)6 * version 3 as published by the Free Software Foundation. In accordance with7 * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect8 * that Ascensio System SIA expressly excludes the warranty of non-infringement9 * of any third-party rights.10 *11 * This program is distributed WITHOUT ANY WARRANTY; without even the implied12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For13 * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html14 *15 * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,16 * EU, LV-1021.17 *18 * The interactive user interfaces in modified source and object code versions19 * of the Program must display Appropriate Legal Notices, as required under20 * Section 5 of the GNU AGPL version 3.21 *22 * Pursuant to Section 7(b) of the License you must retain the original Product23 * logo when distributing the program. Pursuant to Section 7(e) we decline to24 * grant you any rights under trademark law for use of our trademarks.25 *26 * All the Product's GUI elements, including illustrations and icon sets, as27 * well as technical writing content are licensed under the terms of the28 * Creative Commons Attribution-ShareAlike 4.0 International. See the License29 * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode30 *31 */32"use strict";33/**34 * User: Ilja.Kirillov35 * Date: 07.11.201636 * Time: 16:5737 */38AscDFH.changesFactory[AscDFH.historyitem_TableCell_GridSpan] = CChangesTableCellGridSpan;39AscDFH.changesFactory[AscDFH.historyitem_TableCell_Margins] = CChangesTableCellMargins;40AscDFH.changesFactory[AscDFH.historyitem_TableCell_Shd] = CChangesTableCellShd;41AscDFH.changesFactory[AscDFH.historyitem_TableCell_VMerge] = CChangesTableCellVMerge;42AscDFH.changesFactory[AscDFH.historyitem_TableCell_Border_Left] = CChangesTableCellBorderLeft;43AscDFH.changesFactory[AscDFH.historyitem_TableCell_Border_Right] = CChangesTableCellBorderRight;44AscDFH.changesFactory[AscDFH.historyitem_TableCell_Border_Top] = CChangesTableCellBorderTop;45AscDFH.changesFactory[AscDFH.historyitem_TableCell_Border_Bottom] = CChangesTableCellBorderBottom;46AscDFH.changesFactory[AscDFH.historyitem_TableCell_VAlign] = CChangesTableCellVAlign;47AscDFH.changesFactory[AscDFH.historyitem_TableCell_W] = CChangesTableCellW;48AscDFH.changesFactory[AscDFH.historyitem_TableCell_Pr] = CChangesTableCellPr;49AscDFH.changesFactory[AscDFH.historyitem_TableCell_TextDirection] = CChangesTableCellTextDirection;50AscDFH.changesFactory[AscDFH.historyitem_TableCell_NoWrap] = CChangesTableCellNoWrap;51//----------------------------------------------------------------------------------------------------------------------52// Карта зависимости изменений53//----------------------------------------------------------------------------------------------------------------------54AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_GridSpan] = [55 AscDFH.historyitem_TableCell_GridSpan,56 AscDFH.historyitem_TableCell_Pr57];58AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Margins] = [59 AscDFH.historyitem_TableCell_Margins,60 AscDFH.historyitem_TableCell_Pr61];62AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Shd] = [63 AscDFH.historyitem_TableCell_Shd,64 AscDFH.historyitem_TableCell_Pr65];66AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_VMerge] = [67 AscDFH.historyitem_TableCell_VMerge,68 AscDFH.historyitem_TableCell_Pr69];70AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Border_Left] = [71 AscDFH.historyitem_TableCell_Border_Left,72 AscDFH.historyitem_TableCell_Pr73];74AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Border_Right] = [75 AscDFH.historyitem_TableCell_Border_Right,76 AscDFH.historyitem_TableCell_Pr77];78AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Border_Top] = [79 AscDFH.historyitem_TableCell_Border_Top,80 AscDFH.historyitem_TableCell_Pr81];82AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Border_Bottom] = [83 AscDFH.historyitem_TableCell_Border_Bottom,84 AscDFH.historyitem_TableCell_Pr85];86AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_VAlign] = [87 AscDFH.historyitem_TableCell_VAlign,88 AscDFH.historyitem_TableCell_Pr89];90AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_W] = [91 AscDFH.historyitem_TableCell_W,92 AscDFH.historyitem_TableCell_Pr93];94AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_Pr] = [95 AscDFH.historyitem_TableCell_GridSpan,96 AscDFH.historyitem_TableCell_Margins,97 AscDFH.historyitem_TableCell_Shd,98 AscDFH.historyitem_TableCell_VMerge,99 AscDFH.historyitem_TableCell_Border_Left,100 AscDFH.historyitem_TableCell_Border_Right,101 AscDFH.historyitem_TableCell_Border_Top,102 AscDFH.historyitem_TableCell_Border_Bottom,103 AscDFH.historyitem_TableCell_VAlign,104 AscDFH.historyitem_TableCell_W,105 AscDFH.historyitem_TableCell_Pr,106 AscDFH.historyitem_TableCell_TextDirection,107 AscDFH.historyitem_TableCell_NoWrap108];109AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_TextDirection] = [110 AscDFH.historyitem_TableCell_TextDirection,111 AscDFH.historyitem_TableCell_Pr112];113AscDFH.changesRelationMap[AscDFH.historyitem_TableCell_NoWrap] = [114 AscDFH.historyitem_TableCell_NoWrap,115 AscDFH.historyitem_TableCell_Pr116];117/**118 * Общая функция объединения изменений, которые зависят только от себя и AscDFH.historyitem_TableCell_Pr119 * @param oChange120 * @returns {boolean}121 */122function private_TableCellChangesOnMergePr(oChange)123{124 if (oChange.Class !== this.Class)125 return true;126 if (oChange.Type === this.Type || oChange.Type === AscDFH.historyitem_TableCell_Pr)127 return false;128 return true;129}130//----------------------------------------------------------------------------------------------------------------------131/**132 * @constructor133 * @extends {AscDFH.CChangesBaseLongProperty}134 */135function CChangesTableCellGridSpan(Class, Old, New, Color)136{137 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);138}139CChangesTableCellGridSpan.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);140CChangesTableCellGridSpan.prototype.constructor = CChangesTableCellGridSpan;141CChangesTableCellGridSpan.prototype.Type = AscDFH.historyitem_TableCell_GridSpan;142CChangesTableCellGridSpan.prototype.private_SetValue = function(Value)143{144 var oCell = this.Class;145 oCell.Pr.GridSpan = Value;146 oCell.Recalc_CompiledPr();147};148CChangesTableCellGridSpan.prototype.Merge = private_TableCellChangesOnMergePr;149/**150 * @constructor151 * @extends {AscDFH.CChangesBaseProperty}152 */153function CChangesTableCellMargins(Class, Old, New, Color)154{155 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);156}157CChangesTableCellMargins.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);158CChangesTableCellMargins.prototype.constructor = CChangesTableCellMargins;159CChangesTableCellMargins.prototype.Type = AscDFH.historyitem_TableCell_Margins;160CChangesTableCellMargins.prototype.WriteToBinary = function(Writer)161{162 // Long : Flag163 // 1-bit : Is New undefined?164 // 2-bit : Is New null?165 // 3-bit : Is Old undefined?166 // 4-bit : Is Old null?167 // CTableMeasure : New.Left168 // CTableMeasure : New.Top169 // CTableMeasure : New.Right170 // CTableMeasure : New.Bottom171 // CTableMeasure : Old.Left172 // CTableMeasure : Old.Top173 // CTableMeasure : Old.Right174 // CTableMeasure : Old.Bottom175 var nFlags = 0;176 if (undefined === this.New)177 nFlags |= 1;178 if (null === this.New)179 nFlags |= 2;180 if (undefined === this.Old)181 nFlags |= 4;182 if (null === this.Old)183 nFlags |= 8;184 Writer.WriteLong(nFlags);185 if (undefined !== this.New && null !== this.New)186 {187 this.New.Left.Write_ToBinary(Writer);188 this.New.Top.Write_ToBinary(Writer);189 this.New.Right.Write_ToBinary(Writer);190 this.New.Bottom.Write_ToBinary(Writer);191 }192 if (undefined !== this.Old && null !== this.Old)193 {194 this.Old.Left.Write_ToBinary(Writer);195 this.Old.Top.Write_ToBinary(Writer);196 this.Old.Right.Write_ToBinary(Writer);197 this.Old.Bottom.Write_ToBinary(Writer);198 }199};200CChangesTableCellMargins.prototype.ReadFromBinary = function(Reader)201{202 // Long : Flag203 // 1-bit : Is New undefined?204 // 2-bit : Is New null?205 // 3-bit : Is Old undefined?206 // 4-bit : Is Old null?207 // CTableMeasure : New.Left208 // CTableMeasure : New.Top209 // CTableMeasure : New.Right210 // CTableMeasure : New.Bottom211 // CTableMeasure : Old.Left212 // CTableMeasure : Old.Top213 // CTableMeasure : Old.Right214 // CTableMeasure : Old.Bottom215 var nFlags = Reader.GetLong();216 if (nFlags & 1)217 {218 this.New = undefined;219 }220 else if (nFlags & 2)221 {222 this.New = null;223 }224 else225 {226 this.New = {227 Left : new CTableMeasurement(tblwidth_Auto, 0),228 Top : new CTableMeasurement(tblwidth_Auto, 0),229 Right : new CTableMeasurement(tblwidth_Auto, 0),230 Bottom : new CTableMeasurement(tblwidth_Auto, 0)231 };232 this.New.Left.Read_FromBinary(Reader);233 this.New.Top.Read_FromBinary(Reader);234 this.New.Right.Read_FromBinary(Reader);235 this.New.Bottom.Read_FromBinary(Reader);236 }237 if (nFlags & 4)238 {239 this.Old = undefined;240 }241 else if (nFlags & 8)242 {243 this.Old = null;244 }245 else246 {247 this.Old = {248 Left : new CTableMeasurement(tblwidth_Auto, 0),249 Top : new CTableMeasurement(tblwidth_Auto, 0),250 Right : new CTableMeasurement(tblwidth_Auto, 0),251 Bottom : new CTableMeasurement(tblwidth_Auto, 0)252 };253 this.Old.Left.Read_FromBinary(Reader);254 this.Old.Top.Read_FromBinary(Reader);255 this.Old.Right.Read_FromBinary(Reader);256 this.Old.Bottom.Read_FromBinary(Reader);257 }258};259CChangesTableCellMargins.prototype.private_SetValue = function(Value)260{261 var oCell = this.Class;262 oCell.Pr.TableCellMar = Value;263 oCell.Recalc_CompiledPr();264};265CChangesTableCellMargins.prototype.Merge = private_TableCellChangesOnMergePr;266/**267 * @constructor268 * @extends {AscDFH.CChangesBaseObjectProperty}269 */270function CChangesTableCellShd(Class, Old, New, Color)271{272 AscDFH.CChangesBaseObjectProperty.call(this, Class, Old, New, Color);273}274CChangesTableCellShd.prototype = Object.create(AscDFH.CChangesBaseObjectProperty.prototype);275CChangesTableCellShd.prototype.constructor = CChangesTableCellShd;276CChangesTableCellShd.prototype.Type = AscDFH.historyitem_TableCell_Shd;277CChangesTableCellShd.prototype.private_CreateObject = function()278{279 return new CDocumentShd();280};281CChangesTableCellShd.prototype.private_SetValue = function(Value)282{283 var oCell = this.Class;284 oCell.Pr.Shd = Value;285 oCell.Recalc_CompiledPr();286};287CChangesTableCellShd.prototype.Merge = private_TableCellChangesOnMergePr;288/**289 * @constructor290 * @extends {AscDFH.CChangesBaseLongProperty}291 */292function CChangesTableCellVMerge(Class, Old, New, Color)293{294 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);295}296CChangesTableCellVMerge.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);297CChangesTableCellVMerge.prototype.constructor = CChangesTableCellVMerge;298CChangesTableCellVMerge.prototype.Type = AscDFH.historyitem_TableCell_VMerge;299CChangesTableCellVMerge.prototype.private_SetValue = function(Value)300{301 var oCell = this.Class;302 oCell.Pr.VMerge = Value;303 oCell.Recalc_CompiledPr();304};305CChangesTableCellVMerge.prototype.Merge = private_TableCellChangesOnMergePr;306/**307 * @constructor308 * @extends {AscDFH.CChangesBaseProperty}309 */310function CChangesTableCellBorderLeft(Class, Old, New, Color)311{312 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);313}314CChangesTableCellBorderLeft.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);315CChangesTableCellBorderLeft.prototype.constructor = CChangesTableCellBorderLeft;316CChangesTableCellBorderLeft.prototype.Type = AscDFH.historyitem_TableCell_Border_Left;317CChangesTableCellBorderLeft.prototype.WriteToBinary = function(Writer)318{319 // Long : Flag320 // 1-bit : Is New undefined?321 // 2-bit : Is New null?322 // 3-bit : Is Old undefined?323 // 4-bit : Is Old null?324 // CDocumentBorder : New325 // CDocumentBorder : Old326 var nFlags = 0;327 if (undefined === this.New)328 nFlags |= 1;329 if (null === this.New)330 nFlags |= 2;331 if (undefined === this.Old)332 nFlags |= 4;333 if (null === this.Old)334 nFlags |= 8;335 Writer.WriteLong(nFlags);336 if (undefined !== this.New && null !== this.New)337 this.New.Write_ToBinary(Writer);338 if (undefined !== this.Old && null !== this.Old)339 this.Old.Write_ToBinary(Writer);340};341CChangesTableCellBorderLeft.prototype.ReadFromBinary = function(Reader)342{343 // Long : Flag344 // 1-bit : Is New undefined?345 // 2-bit : Is New null?346 // 3-bit : Is Old undefined?347 // 4-bit : Is Old null?348 // CDocumentBorder : New349 // CDocumentBorder : Old350 var nFlags = Reader.GetLong();351 if (nFlags & 1)352 {353 this.New = undefined;354 }355 else if (nFlags & 2)356 {357 this.New = null;358 }359 else360 {361 this.New = new CDocumentBorder();362 this.New.Read_FromBinary(Reader);363 }364 if (nFlags & 4)365 {366 this.Old = undefined;367 }368 else if (nFlags & 8)369 {370 this.Old = null;371 }372 else373 {374 this.Old = new CDocumentBorder();375 this.Old.Read_FromBinary(Reader);376 }377};378CChangesTableCellBorderLeft.prototype.private_SetValue = function(Value)379{380 var oCell = this.Class;381 oCell.Pr.TableCellBorders.Left = Value;382 oCell.Recalc_CompiledPr();383};384CChangesTableCellBorderLeft.prototype.Merge = private_TableCellChangesOnMergePr;385/**386 * @constructor387 * @extends {AscDFH.CChangesBaseProperty}388 */389function CChangesTableCellBorderTop(Class, Old, New, Color)390{391 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);392}393CChangesTableCellBorderTop.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);394CChangesTableCellBorderTop.prototype.constructor = CChangesTableCellBorderTop;395CChangesTableCellBorderTop.prototype.Type = AscDFH.historyitem_TableCell_Border_Top;396CChangesTableCellBorderTop.prototype.WriteToBinary = function(Writer)397{398 // Long : Flag399 // 1-bit : Is New undefined?400 // 2-bit : Is New null?401 // 3-bit : Is Old undefined?402 // 4-bit : Is Old null?403 // CDocumentBorder : New404 // CDocumentBorder : Old405 var nFlags = 0;406 if (undefined === this.New)407 nFlags |= 1;408 if (null === this.New)409 nFlags |= 2;410 if (undefined === this.Old)411 nFlags |= 4;412 if (null === this.Old)413 nFlags |= 8;414 Writer.WriteLong(nFlags);415 if (undefined !== this.New && null !== this.New)416 this.New.Write_ToBinary(Writer);417 if (undefined !== this.Old && null !== this.Old)418 this.Old.Write_ToBinary(Writer);419};420CChangesTableCellBorderTop.prototype.ReadFromBinary = function(Reader)421{422 // Long : Flag423 // 1-bit : Is New undefined?424 // 2-bit : Is New null?425 // 3-bit : Is Old undefined?426 // 4-bit : Is Old null?427 // CDocumentBorder : New428 // CDocumentBorder : Old429 var nFlags = Reader.GetLong();430 if (nFlags & 1)431 {432 this.New = undefined;433 }434 else if (nFlags & 2)435 {436 this.New = null;437 }438 else439 {440 this.New = new CDocumentBorder();441 this.New.Read_FromBinary(Reader);442 }443 if (nFlags & 4)444 {445 this.Old = undefined;446 }447 else if (nFlags & 8)448 {449 this.Old = null;450 }451 else452 {453 this.Old = new CDocumentBorder();454 this.Old.Read_FromBinary(Reader);455 }456};457CChangesTableCellBorderTop.prototype.private_SetValue = function(Value)458{459 var oCell = this.Class;460 oCell.Pr.TableCellBorders.Top = Value;461 oCell.Recalc_CompiledPr();462};463CChangesTableCellBorderTop.prototype.Merge = private_TableCellChangesOnMergePr;464/**465 * @constructor466 * @extends {AscDFH.CChangesBaseProperty}467 */468function CChangesTableCellBorderRight(Class, Old, New, Color)469{470 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);471}472CChangesTableCellBorderRight.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);473CChangesTableCellBorderRight.prototype.constructor = CChangesTableCellBorderRight;474CChangesTableCellBorderRight.prototype.Type = AscDFH.historyitem_TableCell_Border_Right;475CChangesTableCellBorderRight.prototype.WriteToBinary = function(Writer)476{477 // Long : Flag478 // 1-bit : Is New undefined?479 // 2-bit : Is New null?480 // 3-bit : Is Old undefined?481 // 4-bit : Is Old null?482 // CDocumentBorder : New483 // CDocumentBorder : Old484 var nFlags = 0;485 if (undefined === this.New)486 nFlags |= 1;487 if (null === this.New)488 nFlags |= 2;489 if (undefined === this.Old)490 nFlags |= 4;491 if (null === this.Old)492 nFlags |= 8;493 Writer.WriteLong(nFlags);494 if (undefined !== this.New && null !== this.New)495 this.New.Write_ToBinary(Writer);496 if (undefined !== this.Old && null !== this.Old)497 this.Old.Write_ToBinary(Writer);498};499CChangesTableCellBorderRight.prototype.ReadFromBinary = function(Reader)500{501 // Long : Flag502 // 1-bit : Is New undefined?503 // 2-bit : Is New null?504 // 3-bit : Is Old undefined?505 // 4-bit : Is Old null?506 // CDocumentBorder : New507 // CDocumentBorder : Old508 var nFlags = Reader.GetLong();509 if (nFlags & 1)510 {511 this.New = undefined;512 }513 else if (nFlags & 2)514 {515 this.New = null;516 }517 else518 {519 this.New = new CDocumentBorder();520 this.New.Read_FromBinary(Reader);521 }522 if (nFlags & 4)523 {524 this.Old = undefined;525 }526 else if (nFlags & 8)527 {528 this.Old = null;529 }530 else531 {532 this.Old = new CDocumentBorder();533 this.Old.Read_FromBinary(Reader);534 }535};536CChangesTableCellBorderRight.prototype.private_SetValue = function(Value)537{538 var oCell = this.Class;539 oCell.Pr.TableCellBorders.Right = Value;540 oCell.Recalc_CompiledPr();541};542CChangesTableCellBorderRight.prototype.Merge = private_TableCellChangesOnMergePr;543/**544 * @constructor545 * @extends {AscDFH.CChangesBaseProperty}546 */547function CChangesTableCellBorderBottom(Class, Old, New, Color)548{549 AscDFH.CChangesBaseProperty.call(this, Class, Old, New, Color);550}551CChangesTableCellBorderBottom.prototype = Object.create(AscDFH.CChangesBaseProperty.prototype);552CChangesTableCellBorderBottom.prototype.constructor = CChangesTableCellBorderBottom;553CChangesTableCellBorderBottom.prototype.Type = AscDFH.historyitem_TableCell_Border_Bottom;554CChangesTableCellBorderBottom.prototype.WriteToBinary = function(Writer)555{556 // Long : Flag557 // 1-bit : Is New undefined?558 // 2-bit : Is New null?559 // 3-bit : Is Old undefined?560 // 4-bit : Is Old null?561 // CDocumentBorder : New562 // CDocumentBorder : Old563 var nFlags = 0;564 if (undefined === this.New)565 nFlags |= 1;566 if (null === this.New)567 nFlags |= 2;568 if (undefined === this.Old)569 nFlags |= 4;570 if (null === this.Old)571 nFlags |= 8;572 Writer.WriteLong(nFlags);573 if (undefined !== this.New && null !== this.New)574 this.New.Write_ToBinary(Writer);575 if (undefined !== this.Old && null !== this.Old)576 this.Old.Write_ToBinary(Writer);577};578CChangesTableCellBorderBottom.prototype.ReadFromBinary = function(Reader)579{580 // Long : Flag581 // 1-bit : Is New undefined?582 // 2-bit : Is New null?583 // 3-bit : Is Old undefined?584 // 4-bit : Is Old null?585 // CDocumentBorder : New586 // CDocumentBorder : Old587 var nFlags = Reader.GetLong();588 if (nFlags & 1)589 {590 this.New = undefined;591 }592 else if (nFlags & 2)593 {594 this.New = null;595 }596 else597 {598 this.New = new CDocumentBorder();599 this.New.Read_FromBinary(Reader);600 }601 if (nFlags & 4)602 {603 this.Old = undefined;604 }605 else if (nFlags & 8)606 {607 this.Old = null;608 }609 else610 {611 this.Old = new CDocumentBorder();612 this.Old.Read_FromBinary(Reader);613 }614};615CChangesTableCellBorderBottom.prototype.private_SetValue = function(Value)616{617 var oCell = this.Class;618 oCell.Pr.TableCellBorders.Bottom = Value;619 oCell.Recalc_CompiledPr();620};621CChangesTableCellBorderBottom.prototype.Merge = private_TableCellChangesOnMergePr;622/**623 * @constructor624 * @extends {AscDFH.CChangesBaseLongProperty}625 */626function CChangesTableCellVAlign(Class, Old, New, Color)627{628 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);629}630CChangesTableCellVAlign.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);631CChangesTableCellVAlign.prototype.constructor = CChangesTableCellVAlign;632CChangesTableCellVAlign.prototype.Type = AscDFH.historyitem_TableCell_VAlign;633CChangesTableCellVAlign.prototype.private_SetValue = function(Value)634{635 var oCell = this.Class;636 oCell.Pr.VAlign = Value;637 oCell.Recalc_CompiledPr();638};639CChangesTableCellVAlign.prototype.Merge = private_TableCellChangesOnMergePr;640/**641 * @constructor642 * @extends {AscDFH.CChangesBaseObjectValue}643 */644function CChangesTableCellW(Class, Old, New, Color)645{646 AscDFH.CChangesBaseObjectValue.call(this, Class, Old, New, Color);647}648CChangesTableCellW.prototype = Object.create(AscDFH.CChangesBaseObjectValue.prototype);649CChangesTableCellW.prototype.constructor = CChangesTableCellW;650CChangesTableCellW.prototype.Type = AscDFH.historyitem_TableCell_W;651CChangesTableCellW.prototype.private_CreateObject = function()652{653 return new CTableMeasurement(tblwidth_Auto, 0);654};655CChangesTableCellW.prototype.private_SetValue = function(Value)656{657 var oCell = this.Class;658 oCell.Pr.TableCellW = Value;659 oCell.Recalc_CompiledPr();660};661CChangesTableCellW.prototype.Merge = private_TableCellChangesOnMergePr;662/**663 * @constructor664 * @extends {AscDFH.CChangesBaseObjectValue}665 */666function CChangesTableCellPr(Class, Old, New, Color)667{668 AscDFH.CChangesBaseObjectValue.call(this, Class, Old, New, Color);669}670CChangesTableCellPr.prototype = Object.create(AscDFH.CChangesBaseObjectValue.prototype);671CChangesTableCellPr.prototype.constructor = CChangesTableCellPr;672CChangesTableCellPr.prototype.Type = AscDFH.historyitem_TableCell_Pr;673CChangesTableCellPr.prototype.private_CreateObject = function()674{675 return new CTableCellPr();676};677CChangesTableCellPr.prototype.private_SetValue = function(Value)678{679 var oCell = this.Class;680 oCell.Pr = Value;681 oCell.Recalc_CompiledPr();682};683CChangesTableCellPr.prototype.Merge = function(oChange)684{685 if (this.Class !== oChange.Class)686 return true;687 if (this.Type === oChange.Type)688 return false;689 if (!this.New)690 this.New = new CTableCellPr();691 switch(oChange.Type)692 {693 case AscDFH.historyitem_TableCell_GridSpan:694 {695 this.New.GridSpan = oChange.New;696 break;697 }698 case AscDFH.historyitem_TableCell_Margins:699 {700 this.New.TableCellMar = oChange.New;701 break;702 }703 case AscDFH.historyitem_TableCell_Shd:704 {705 this.New.Shd = oChange.New;706 break;707 }708 case AscDFH.historyitem_TableCell_VMerge:709 {710 this.New.VMerge = oChange.New;711 break;712 }713 case AscDFH.historyitem_TableCell_Border_Left:714 {715 this.New.TableCellBorders.Left = oChange.New;716 break;717 }718 case AscDFH.historyitem_TableCell_Border_Right:719 {720 this.New.TableCellBorders.Right = oChange.New;721 break;722 }723 case AscDFH.historyitem_TableCell_Border_Top:724 {725 this.New.TableCellBorders.Top = oChange.New;726 break;727 }728 case AscDFH.historyitem_TableCell_Border_Bottom:729 {730 this.New.TableCellBorders.Bottom = oChange.New;731 break;732 }733 case AscDFH.historyitem_TableCell_VAlign:734 {735 this.New.VAlign = oChange.New;736 break;737 }738 case AscDFH.historyitem_TableCell_W:739 {740 this.New.TableCellW = oChange.New;741 break;742 }743 case AscDFH.historyitem_TableCell_TextDirection:744 {745 this.New.TextDirection = oChange.New;746 break;747 }748 case AscDFH.historyitem_TableCell_NoWrap:749 {750 this.New.NoWrap = oChange.New;751 break;752 }753 }754 return true;755};756/**757 * @constructor758 * @extends {AscDFH.CChangesBaseLongProperty}759 */760function CChangesTableCellTextDirection(Class, Old, New, Color)761{762 AscDFH.CChangesBaseLongProperty.call(this, Class, Old, New, Color);763}764CChangesTableCellTextDirection.prototype = Object.create(AscDFH.CChangesBaseLongProperty.prototype);765CChangesTableCellTextDirection.prototype.constructor = CChangesTableCellTextDirection;766CChangesTableCellTextDirection.prototype.Type = AscDFH.historyitem_TableCell_TextDirection;767CChangesTableCellTextDirection.prototype.private_SetValue = function(Value)768{769 var oCell = this.Class;770 oCell.Pr.TextDirection = Value;771 oCell.Recalc_CompiledPr();772};773CChangesTableCellTextDirection.prototype.Merge = private_TableCellChangesOnMergePr;774/**775 * @constructor776 * @extends {AscDFH.CChangesBaseBoolProperty}777 */778function CChangesTableCellNoWrap(Class, Old, New, Color)779{780 AscDFH.CChangesBaseBoolProperty.call(this, Class, Old, New, Color);781}782CChangesTableCellNoWrap.prototype = Object.create(AscDFH.CChangesBaseBoolProperty.prototype);783CChangesTableCellNoWrap.prototype.constructor = CChangesTableCellNoWrap;784CChangesTableCellNoWrap.prototype.Type = AscDFH.historyitem_TableCell_NoWrap;785CChangesTableCellNoWrap.prototype.private_SetValue = function(Value)786{787 var oCell = this.Class;788 oCell.Pr.NoWrap = Value;789 oCell.Recalc_CompiledPr();790};...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require("fast-check");2const nFlags = require("fast-check-monorepo").nFlags;3const nFlags2 = require("fast-check-monorepo").nFlags2;4fc.assert(5 fc.property(fc.nat(), n => {6 const res = nFlags(n);7 return res === nFlags2(n);8 })9);10const fc = require("fast-check");11const nFlags = require("fast-check-monorepo").nFlags;12const nFlags2 = require("fast-check-monorepo").nFlags2;13fc.assert(14 fc.property(fc.nat(), n => {15 const res = nFlags(n);16 return res === nFlags2(n);17 })18);19const fc = require("fast-check");20const nFlags = require("fast-check-monorepo").nFlags;21const nFlags2 = require("fast-check-monorepo").nFlags2;22fc.assert(23 fc.property(fc.nat(), n => {24 const res = nFlags(n);25 return res === nFlags2(n);26 })27);28const fc = require("fast-check");29const nFlags = require("fast-check-monorepo").nFlags;30const nFlags2 = require("fast-check-monorepo").nFlags2;31fc.assert(32 fc.property(fc.nat(), n => {33 const res = nFlags(n);34 return res === nFlags2(n);35 })36);37const fc = require("fast-check");38const nFlags = require("fast-check-monorepo").nFlags;39const nFlags2 = require("fast-check-monorepo").nFlags2;40fc.assert(41 fc.property(fc.nat(), n => {42 const res = nFlags(n);43 return res === nFlags2(n);44 })45);46const fc = require("fast-check");47const nFlags = require("fast-check-monorepo").nFlags;

Full Screen

Using AI Code Generation

copy

Full Screen

1const nFlags = require('n-flags');2console.log(nFlags);3console.log('test3');4const nFlags = require('n-flags');5console.log(nFlags);6console.log('test4');7const nFlags = require('n-flags');8console.log(nFlags);9console.log('test5');10const nFlags = require('n-flags');11console.log(nFlags);12console.log('test6');13const nFlags = require('n-flags');14console.log(nFlags);15console.log('test7');16const nFlags = require('n-flags');17console.log(nFlags);18console.log('test8');19const nFlags = require('n-flags');20console.log(nFlags);21console.log('test9');22const nFlags = require('n-flags');23console.log(nFlags);24console.log('test10');25const nFlags = require('n-flags');26console.log(nFlags);27console.log('test11');28const nFlags = require('n-flags');29console.log(nFlags);30console.log('test12');31const nFlags = require('n-flags');32console.log(nFlags);33console.log('test13');34const nFlags = require('n-flags');35console.log(nFlags);36console.log('test14');

Full Screen

Using AI Code Generation

copy

Full Screen

1const nFlags = require('nflags');2nFlags.defineString('name', 'John Doe', 'Name of the person to greet');3nFlags.defineNumber('age', 42, 'Age of the person to greet');4nFlags.parse();5console.log(`Hello ${nFlags.get('name')}! You are ${nFlags.get('age')} years old.`);6const nFlags = require('nflags');7nFlags.defineString('name', 'John Doe', 'Name of the person to greet');8nFlags.defineNumber('age', 42, 'Age of the person to greet');9nFlags.parse();10console.log(`Hello ${nFlags.get('name')}! You are ${nFlags.get('age')} years old.`);11const nFlags = require('nflags');12nFlags.defineString('name', 'John Doe', 'Name of the person to greet');13nFlags.defineNumber('age', 42, 'Age of the person to greet');14nFlags.parse();15console.log(`Hello ${nFlags.get('name')}! You are ${nFlags.get('age')} years old.`);16const nFlags = require('nflags');17nFlags.defineString('name', 'John Doe', 'Name of the person to greet');18nFlags.defineNumber('age', 42, 'Age of the person to greet');19nFlags.parse();20console.log(`Hello ${n

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2const { nFlags } = require('fast-check-monorepo');3const nFlagsGen = nFlags(3);4const result = fc.check(5 fc.property(nFlagsGen, (flags) => {6 console.log('flags', flags);7 return true;8 }),9 { verbose: true, seed: 42 }10);11console.log('result', result);

Full Screen

Using AI Code Generation

copy

Full Screen

1const nFlags = require('n-flags');2nFlags('test3.js', (err, flags) => {3 if (err) throw err;4 console.log(flags);5});6const nFlags = require('n-flags');7nFlags('test4.js', (err, flags) => {8 if (err) throw err;9 console.log(flags);10});11const nFlags = require('n-flags');12nFlags('test5.js', (err, flags) => {13 if (err) throw err;14 console.log(flags);15});16const nFlags = require('n-flags');17nFlags('test6.js', (err, flags) => {18 if (err) throw err;19 console.log(flags);20});21const nFlags = require('n-flags');22nFlags('test7.js', (err, flags) => {23 if (err) throw err;24 console.log(flags);25});26const nFlags = require('n-flags');27nFlags('test8.js', (err, flags) => {28 if (err) throw err;29 console.log(flags);30});31const nFlags = require('n-flags');32nFlags('test9.js', (err, flags) => {33 if (err) throw err;34 console.log(flags);35});36const nFlags = require('n-flags');37nFlags('test10.js', (err, flags) => {38 if (err) throw err;39 console.log(flags);40});41const nFlags = require('n-flags');42nFlags('test11.js', (err, flags) => {

Full Screen

Using AI Code Generation

copy

Full Screen

1const { nFlags } = require('fast-check');2const { nFlags: nFlags2 } = require('fast-check-monorepo');3const { nFlags } = require('fast-check');4const { nFlags: nFlags2 } = require('fast-check-monorepo');5const { nFlags } = require('fast-check');6const { nFlags: nFlags2 } = require('fast-check-monorepo');7const { nFlags } = require('fast-check');8const { nFlags: nFlags2 } = require('fast-check-monorepo');9const { nFlags } = require('fast-check');10const { nFlags: nFlags2 } = require('fast-check-monorepo');11const { nFlags } = require('fast-check');12const { nFlags: nFlags2 } = require('fast-check-monorepo');

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2const nFlags = require('fast-check-monorepo').nFlags;3const { range } = require('lodash');4const { flag } = require('commander');5fc.assert(6 fc.property(7 fc.nat(100),8 fc.nat(100),9 fc.nat(100),10 fc.nat(100),11 fc.nat(100),12 (a, b, c, d, e) => {13 const flags = [a, b, c, d, e];14 const flagCount = flags.reduce((acc, flag) => acc + flag, 0);15 const flagIndices = range(flagCount);16 return nFlags(flags)(flagIndices);17 }18);19const fc = require('fast-check');20const nFlags = require('fast-check-monorepo').nFlags;21const { range } = require('lodash');22const { flag } = require('commander');23fc.assert(24 fc.property(25 fc.nat(100),26 fc.nat(100),27 fc.nat(100),28 fc.nat(100),29 fc.nat(100),30 (a, b, c, d, e) => {31 const flags = [a, b, c, d, e];32 const flagCount = flags.reduce((acc, flag) => acc + flag, 0);33 const flagIndices = range(flagCount);34 return nFlags(flags)(flagIndices);35 }36);37const fc = require('fast-check');38const nFlags = require('fast-check-monorepo').nFlags;39const { range } = require('lodash');40const { flag } = require('commander');41fc.assert(42 fc.property(43 fc.nat(100),44 fc.nat(100),45 fc.nat(100),46 fc.nat(100),47 fc.nat(100),48 (a, b, c, d, e) => {49 const flags = [a, b, c, d, e];50 const flagCount = flags.reduce((acc, flag) => acc + flag, 0);51 const flagIndices = range(flagCount);

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require("fast-check");2fc.nFlags(5, 0.5);3const fc = require("fast-check");4fc.nFlags(5, 0.5);5const fc = require("fast-check");6fc.nFlags(5, 0.5);7const fc = require("fast-check");8fc.nFlags(5, 0.5);9const fc = require("fast-check");10fc.nFlags(5, 0.5);

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2fc.nFlags().then(function (value) {3 console.log(value);4});5{ flags: { nFlags: 1, nFlagsMax: 1 } }6const fc = require('fast-check');7fc.nFlags().then(function (value) {8 console.log(value);9});10{ flags: { nFlags: 1, nFlagsMax: 1 } }11const fc = require('fast-check');12fc.nFlags().then(function (value) {13 console.log(value);14});15{ flags: { nFlags: 1, nFlagsMax: 1 } }16const fc = require('fast-check');17fc.nFlags().then(function (value) {18 console.log(value);19});20{ flags: { nFlags: 1, nFlagsMax: 1 } }21const fc = require('fast-check');22fc.nFlags().then(function (value) {23 console.log(value);24});25{ flags: { nFlags: 1, nFlagsMax: 1 } }26const fc = require('fast-check');27fc.nFlags().then(function (value) {28 console.log(value);29});30{ flags: { nFlags: 1, nFlagsMax: 1 } }31const fc = require('fast-check');32fc.nFlags().then(function (value) {33 console.log(value);34});35{ flags: { nFlags: 1, nFlagsMax: 1 } }36const fc = require('fast-check');37fc.nFlags().then(function (

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