How to use oldCount method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

remember-the-fire-29.js

Source:remember-the-fire-29.js Github

copy

Full Screen

1document.addEventListener("DOMContentLoaded", function () {2 // Utils3 d3.selection.prototype.apply = d3.transition.prototype.apply = function () {4 const callback = arguments[0];5 arguments[0] = this;6 return callback.apply(null, arguments);7 };8 function commafy(x) {9 return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");10 }11 const lyricsData = [12 {13 lyric: "Harry Truman",14 wikiName: "Harry S. Truman",15 addendum: " (Harry S. Truman)",16 count: 188572,17 oldCount: 163452,18 url: "Harry_S._Truman",19 type: "person",20 },21 {22 lyric: "Doris Day",23 wikiName: "Doris Day",24 addendum: "",25 count: 180062,26 oldCount: 146857,27 url: "Doris_Day",28 type: "person",29 },30 {31 lyric: "Red China",32 wikiName: "Communist Party of China",33 addendum: " (Communist Party of China)",34 count: 78351,35 oldCount: 60654,36 url: "Communist_Party_of_China",37 type: "history",38 },39 {40 lyric: "Johnnie Ray",41 wikiName: "Johnnie Ray",42 addendum: " (Johnnie Ray)",43 count: 15651,44 oldCount: 14543,45 url: "Johnnie_Ray",46 type: "person",47 },48 {49 lyric: "South Pacific",50 wikiName: "South Pacific (musical)",51 addendum: " (musical)",52 count: 24372,53 oldCount: 23686,54 url: "South_Pacific_(musical)",55 type: "art",56 },57 {58 lyric: "Walter Winchell",59 wikiName: "Walter Winchell",60 addendum: "",61 count: 9309,62 oldCount: 8038,63 url: "Walter_Winchell",64 type: "person",65 },66 {67 lyric: "Joe DiMaggio",68 wikiName: "Joe DiMaggio",69 addendum: "",70 count: 86712,71 oldCount: 83330,72 url: "Joe_DiMaggio",73 type: "person",74 },75 {76 lyric: "Joe McCarthy",77 wikiName: "Joe McCarthy",78 addendum: " (Joseph McCarthy)",79 count: 79975,80 oldCount: 65057,81 url: "Joseph_McCarthy",82 type: "person",83 },84 {85 lyric: "Richard Nixon",86 wikiName: "Richard Nixon",87 addendum: "",88 count: 434072,89 oldCount: 332371,90 url: "Richard_Nixon",91 type: "person",92 },93 {94 lyric: "Studebaker",95 wikiName: "Studebaker",96 addendum: "",97 count: 27031,98 oldCount: 29181,99 url: "Studebaker",100 type: "history",101 },102 {103 lyric: "Television",104 wikiName: "Television",105 addendum: "",106 count: 114492,107 oldCount: 104753,108 url: "Television",109 type: "history",110 },111 {112 lyric: "North Korea, South Korea",113 wikiName: "Korean War",114 addendum: " (Korean War)",115 count: 231086,116 oldCount: 380753,117 url: "Korean_War",118 type: "history",119 },120 {121 lyric: "Marilyn Monroe",122 wikiName: "Marilyn Monroe",123 addendum: "",124 count: 501088,125 oldCount: 448649,126 url: "Marilyn_Monroe",127 type: "person",128 },129 {130 lyric: "Rosenbergs",131 wikiName: "Ethel and Julius Rosenberg",132 addendum: " (Ethel and Julius Rosenberg)",133 count: 62786,134 oldCount: 97269,135 url: "Julius_and_Ethel_Rosenberg",136 type: "person",137 },138 {139 lyric: "H-Bomb",140 wikiName: "Thermonuclear Weapon",141 addendum: " (Thermonuclear Weapon)",142 count: 48001,143 oldCount: 43537,144 url: "Thermonuclear_weapon",145 type: "history",146 },147 {148 lyric: "Sugar Ray",149 wikiName: "Sugar Ray Robinson",150 addendum: " (Sugar Ray Robinson)",151 count: 56210,152 oldCount: 38294,153 url: "Sugar_Ray_Robinson",154 type: "person",155 },156 {157 lyric: "Panmunjom",158 wikiName: "Korean Armistice Agreement",159 addendum: " (Korean Armistice Agreement)",160 count: 10226,161 oldCount: 27663,162 url: "Korean_Armistice_Agreement",163 type: "history",164 },165 {166 lyric: "Brando",167 wikiName: "Marlon Brando",168 addendum: " (Marlon Brando)",169 count: 366801,170 oldCount: 240932,171 url: "Marlon_Brando",172 type: "person",173 },174 {175 lyric: "The King and I",176 wikiName: "The King and I",177 addendum: "",178 count: 44626,179 oldCount: 43322,180 url: "The_King_and_I",181 type: "art",182 },183 {184 lyric: "The Catcher in the Rye",185 wikiName: "The Catcher in the Rye",186 addendum: "",187 count: 171571,188 oldCount: 148608,189 url: "The_Catcher_in_the_Rye",190 type: "art",191 },192 {193 lyric: "Eisenhower",194 wikiName: "Dwight D. Eisenhower",195 addendum: " (Dwight D. Eisenhower)",196 count: 253897,197 oldCount: 207811,198 url: "Dwight_D._Eisenhower",199 type: "person",200 },201 {202 lyric: "Vaccine",203 wikiName: "Polio Vaccine",204 addendum: " (Polio Vaccine)",205 count: 46848,206 oldCount: 42482,207 url: "Polio_vaccine",208 type: "history",209 },210 {211 lyric: "England's got a new Queen",212 wikiName: "Elizabeth II",213 addendum: " (Elizabeth II)",214 count: 1435839,215 oldCount: 1502400,216 url: "Elizabeth_II",217 type: "person",218 },219 {220 lyric: "Marciano",221 wikiName: "Rocky Marciano",222 addendum: " (Rocky Marciano)",223 count: 77587,224 oldCount: 57976,225 url: "Rocky_Marciano",226 type: "person",227 },228 {229 lyric: "Liberace",230 wikiName: "Liberace",231 addendum: "",232 count: 102840,233 oldCount: 103675,234 url: "Liberace",235 type: "person",236 },237 {238 lyric: "Santayana Goodbye",239 wikiName: "George Santayana",240 addendum: " (George Santayana)",241 count: 18343,242 oldCount: 15400,243 url: "George_Santayana",244 type: "person",245 },246 {247 lyric: "Joseph Stalin",248 wikiName: "Joseph Stalin",249 addendum: "",250 count: 466843,251 oldCount: 391533,252 url: "Joseph_Stalin",253 type: "person",254 },255 {256 lyric: "Malenkov",257 wikiName: "Georgy Malenkov",258 addendum: " (Georgy Malenkov)",259 count: 72582,260 oldCount: 55138,261 url: "Georgy_Malenkov",262 type: "person",263 },264 {265 lyric: "Nasser",266 wikiName: "Gamal Abdel Nasser",267 addendum: " (Gamal Abdel Nasser)",268 count: 56092,269 oldCount: 52268,270 url: "Gamal_Abdel_Nasser",271 type: "person",272 },273 {274 lyric: "Prokofiev",275 wikiName: "Sergei Prokofiev",276 addendum: " (Sergei Prokofiev)",277 count: 29582,278 oldCount: 30335,279 url: "Sergei_Prokofiev",280 type: "person",281 },282 {283 lyric: "Rockefeller",284 wikiName: "Winthrop Rockefeller",285 addendum: " (Winthrop Rockefeller)",286 count: 8261,287 oldCount: 5897,288 url: "Winthrop_Rockefeller",289 type: "person",290 },291 {292 lyric: "Campanella",293 wikiName: "Roy Campanella",294 addendum: " (Roy Campanella)",295 count: 12462,296 oldCount: 10971,297 url: "Roy_Campanella",298 type: "person",299 },300 {301 lyric: "Communist Bloc",302 wikiName: "Eastern Bloc",303 addendum: "",304 count: 46803,305 oldCount: 45353,306 url: "Eastern_Bloc",307 type: "history",308 },309 {310 lyric: "Roy Cohn",311 wikiName: "Roy Cohn",312 addendum: "",313 count: 89624,314 oldCount: 92419,315 url: "Roy_Cohn",316 type: "person",317 },318 {319 lyric: "Juan Peron",320 wikiName: "Juan Peron",321 addendum: "",322 count: 47829,323 oldCount: 51862,324 url: "Juan_Perón",325 type: "person",326 },327 {328 lyric: "Toscanini",329 wikiName: "Arturo Toscanini",330 addendum: " (Arturo Toscanini)",331 count: 11466,332 oldCount: 8601,333 url: "Arturo_Toscanini",334 type: "person",335 },336 {337 lyric: "Dacron",338 wikiName: "Dacron",339 addendum: "",340 count: 3649,341 oldCount: 3070,342 url: "Dacron",343 type: "history",344 },345 {346 lyric: "Dien Bien Phu Falls",347 wikiName: "Battle of Dien Bien Phu",348 addendum: " (Battle of Dien Bien Phu)",349 count: 30851,350 oldCount: 32717,351 url: "Battle_of_Dien_Bien_Phu",352 type: "history",353 },354 {355 lyric: "Rock Around the Clock",356 wikiName: "Rock Around the Clock",357 addendum: "",358 count: 10480,359 oldCount: 9698,360 url: "Rock_Around_the_Clock",361 type: "art",362 },363 {364 lyric: "Einstein",365 wikiName: "Albert Einstein",366 addendum: " (Albert Einstein)",367 count: 553216,368 oldCount: 553928,369 url: "Albert_Einstein",370 type: "person",371 },372 {373 lyric: "James Dean",374 wikiName: "James Dean",375 addendum: "",376 count: 203316,377 oldCount: 192401,378 url: "James_Dean",379 type: "person",380 },381 {382 lyric: "Brooklyn's got a winning team",383 wikiName: "Brooklyn Dodgers",384 addendum: " (Brooklyn Dodgers)",385 count: 6583,386 oldCount: 7719,387 url: "Brooklyn_Dodgers",388 type: "person",389 },390 {391 lyric: "Davy Crockett",392 wikiName: "Davy Crockett",393 addendum: "",394 count: 80832,395 oldCount: 75005,396 url: "Davy_Crockett",397 type: "art",398 },399 {400 lyric: "Peter Pan",401 wikiName: "Peter Pan",402 addendum: "",403 count: 96478,404 oldCount: 92549,405 url: "Peter_Pan",406 type: "art",407 },408 {409 lyric: "Elvis Presley",410 wikiName: "Elvis Presley",411 addendum: "",412 count: 802167,413 oldCount: 515112,414 url: "Elvis_Presley",415 type: "person",416 },417 {418 lyric: "Disneyland",419 wikiName: "Disneyland",420 addendum: "",421 count: 99339,422 oldCount: 92802,423 url: "Disneyland",424 type: "art",425 },426 {427 lyric: "Bardot",428 wikiName: "Brigitte Bardot",429 addendum: " (Brigitte Bardot)",430 count: 81669,431 oldCount: 77227,432 url: "Brigitte_Bardot",433 type: "person",434 },435 {436 lyric: "Budapest",437 wikiName: "Hungarian Revolution of 1956",438 addendum: " (Hungarian Revolution of 1956)",439 count: 37923,440 oldCount: 36753,441 url: "Hungarian_Revolution_of_1956",442 type: "history",443 },444 {445 lyric: "Alabama",446 wikiName: "Civil rights movement",447 addendum: " (Civil rights movement)",448 count: 82494,449 oldCount: 61735,450 url: "Civil_rights_movement",451 type: "history",452 },453 {454 lyric: "Krushchev",455 wikiName: "Nikita Khrushchev",456 addendum: " (Nikita Khrushchev)",457 count: 152873,458 oldCount: 145299,459 url: "Nikita_Khrushchev",460 type: "person",461 },462 {463 lyric: "Princess Grace",464 wikiName: "Grace Kelly",465 addendum: " (Grace Kelly)",466 count: 179498,467 oldCount: 226215,468 url: "Grace_Kelly",469 type: "person",470 },471 {472 lyric: "Peyton Place",473 wikiName: "Peyton Place (novel)",474 addendum: "(novel)",475 count: 4200,476 oldCount: 4460,477 url: "Peyton_Place_(novel)",478 type: "art",479 },480 {481 lyric: "Trouble in the Suez",482 wikiName: "Suez Crisis",483 addendum: " (Suez Crisis)",484 count: 98380,485 oldCount: 89746,486 url: "Suez_Crisis",487 type: "history",488 },489 {490 lyric: "Little Rock",491 wikiName: "Little Rock Nine",492 addendum: " (Little Rock Nine)",493 count: 40836,494 oldCount: 28375,495 url: "Little_Rock_Nine",496 type: "history",497 },498 {499 lyric: "Pasternak",500 wikiName: "Boris Pasternak",501 addendum: " (Boris Pasternak)",502 count: 22329,503 oldCount: 17638,504 url: "Boris_Pasternak",505 type: "person",506 },507 {508 lyric: "Mickey Mantle",509 wikiName: "Mickey Mantle",510 addendum: "",511 count: 52330,512 oldCount: 93543,513 url: "Mickey_Mantle",514 type: "person",515 },516 {517 lyric: "Kerouac",518 wikiName: "Jack Kerouac",519 addendum: " (Jack Kerouac)",520 count: 72887,521 oldCount: 62207,522 url: "Jack_Kerouac",523 type: "person",524 },525 {526 lyric: "Sputnik",527 wikiName: "Sputnik I",528 addendum: " (Sputnik I)",529 count: 55566,530 oldCount: 52602,531 url: "Sputnik_1",532 type: "history",533 },534 {535 lyric: "Chou En Lai",536 wikiName: "Zhou Enlai",537 addendum: " (Zhou Enlai)",538 count: 32585,539 oldCount: 26480,540 url: "Zhou_Enlai",541 type: "person",542 },543 {544 lyric: "Bridge on the River Kwai",545 wikiName: "The Bridge on the River Kwai",546 addendum: "",547 count: 44642,548 oldCount: 50741,549 url: "The_Bridge_on_the_River_Kwai",550 type: "art",551 },552 {553 lyric: "Lebanon",554 wikiName: "1958 Lebanon Crisis",555 addendum: " (1958 Lebanon Crisis)",556 count: 7030,557 oldCount: 6590,558 url: "1958_Lebanon_crisis",559 type: "history",560 },561 {562 lyric: "Charles de Gaulle",563 wikiName: "Charles de Gaulle",564 addendum: "",565 count: 92382,566 oldCount: 85876,567 url: "Charles_de_Gaulle",568 type: "person",569 },570 {571 lyric: "California baseball",572 wikiName: "Los Angeles Dodgers",573 addendum: " (Los Angeles Dodgers)",574 count: 48178,575 oldCount: 59598,576 url: "Los_Angeles_Dodgers",577 type: "person",578 },579 {580 lyric: "Starkweather homicide",581 wikiName: "Charles Starkweather",582 addendum: " (Charles Starkweather)",583 count: 32481,584 oldCount: 21201,585 url: "Charles_Starkweather",586 type: "person",587 },588 {589 lyric: "Children of Thalidomide",590 wikiName: "Thalidomide",591 addendum: " (Thalidomide)",592 count: 74394,593 oldCount: 75718,594 url: "Thalidomide",595 type: "history",596 },597 {598 lyric: "Buddy Holly",599 wikiName: "Buddy Holly",600 addendum: "",601 count: 138173,602 oldCount: 117868,603 url: "Buddy_Holly",604 type: "person",605 },606 {607 lyric: "Ben-Hur",608 wikiName: "Ben-Hur (1959 Film)",609 addendum: " (1959 Film)",610 count: 82105,611 oldCount: 42944,612 url: "Ben-Hur_(1959_film)",613 type: "art",614 },615 {616 lyric: "Space Monkey",617 wikiName: "Monkeys and apes in space",618 addendum: " (Monkeys and apes in space)",619 count: 13114,620 oldCount: 10139,621 url: "Monkeys_and_apes_in_space",622 type: "history",623 },624 {625 lyric: "Mafia",626 wikiName: "American Mafia",627 addendum: " (American Mafia)",628 count: 119648,629 oldCount: 109258,630 url: "American_Mafia",631 type: "history",632 },633 {634 lyric: "Hula hoops",635 wikiName: "Hula hoops",636 addendum: "",637 count: 10911,638 oldCount: 10074,639 url: "Hula_hoop",640 type: "history",641 },642 {643 lyric: "Castro",644 wikiName: "Fidel Castro",645 addendum: " (Fidel Castro)",646 count: 181502,647 oldCount: 132532,648 url: "Fidel_Castro",649 type: "person",650 },651 {652 lyric: "Edsel is a no-go",653 wikiName: "Edsel",654 addendum: " (Edsel)",655 count: 19815,656 oldCount: 19118,657 url: "Edsel",658 type: "history",659 },660 {661 lyric: "U-2",662 wikiName: "1960 U-2 Incident",663 addendum: " (1960 U-2 Incident)",664 count: 21584,665 oldCount: 19561,666 url: "1960_U-2_incident",667 type: "history",668 },669 {670 lyric: "Syngman Rhee",671 wikiName: "Syngman Rhee",672 addendum: "",673 count: 18650,674 oldCount: 19756,675 url: "Syngman_Rhee",676 type: "person",677 },678 {679 lyric: "Payola",680 wikiName: "Payola",681 addendum: "",682 count: 14849,683 oldCount: 12631,684 url: "Payola",685 type: "history",686 },687 {688 lyric: "Kennedy",689 wikiName: "John F. Kennedy",690 addendum: " (John F. Kennedy)",691 count: 566399,692 oldCount: 450499,693 url: "John_F._Kennedy",694 type: "person",695 },696 {697 lyric: "Chubby Checker",698 wikiName: "Chubby Checker",699 addendum: " (Chubby Checker)",700 count: 29487,701 oldCount: 26235,702 url: "Chubby_Checker",703 type: "person",704 },705 {706 lyric: "Psycho",707 wikiName: "Psycho (1960 film)",708 addendum: " (1960 film)",709 count: 85857,710 oldCount: 97732,711 url: "Psycho_(1960_film)",712 type: "art",713 },714 {715 lyric: "Belgians in the Congo",716 wikiName: "Congo Crisis",717 addendum: " (Congo Crisis)",718 count: 31804,719 oldCount: 24429,720 url: "Congo_Crisis",721 type: "history",722 },723 {724 lyric: "Hemingway",725 wikiName: "Ernest Hemingway",726 addendum: " (Ernest Hemingway)",727 count: 296433,728 oldCount: 269474,729 url: "Ernest_Hemingway",730 type: "person",731 },732 {733 lyric: "Eichmann",734 wikiName: "Adolf Eichmann",735 addendum: " (Adolf Eichmann)",736 count: 229728,737 oldCount: 229597,738 url: "Adolf_Eichmann",739 type: "person",740 },741 {742 lyric: "Stranger in a Strange Land",743 wikiName: "Stranger in a Strange Land",744 addendum: "",745 count: 23145,746 oldCount: 24073,747 url: "Stranger_in_a_Strange_Land",748 type: "art",749 },750 {751 lyric: "Dylan",752 wikiName: "Bob Dylan",753 addendum: " (Bob Dylan)",754 count: 306029,755 oldCount: 244956,756 url: "Bob_Dylan",757 type: "person",758 },759 {760 lyric: "Berlin",761 wikiName: "Berlin Wall",762 addendum: " (Berlin Wall)",763 count: 252693,764 oldCount: 190212,765 url: "Berlin_Wall",766 type: "history",767 },768 {769 lyric: "Bay of Pigs Invasion",770 wikiName: "Bay of Pigs Invasion",771 addendum: "",772 count: 93646,773 oldCount: 74306,774 url: "Bay_of_Pigs_Invasion",775 type: "history",776 },777 {778 lyric: "Lawrence of Arabia",779 wikiName: "Lawrence of Arabia",780 addendum: "",781 count: 98041,782 oldCount: 60932,783 url: "Lawrence_of_Arabia_(film)",784 type: "art",785 },786 {787 lyric: "British Beatlemania",788 wikiName: "The Beatles",789 addendum: " (The Beatles)",790 count: 434683,791 oldCount: 483972,792 url: "The_Beatles",793 type: "person",794 },795 {796 lyric: "Ole Miss",797 wikiName: "Ole Miss riot of 1962",798 addendum: " (Ole Miss riot of 1962)",799 count: 4839,800 oldCount: 3463,801 url: "Ole_Miss_riot_of_1962",802 type: "history",803 },804 {805 lyric: "John Glenn",806 wikiName: "John Glenn",807 addendum: "",808 count: 78537,809 oldCount: 60141,810 url: "John_Glenn",811 type: "history",812 },813 {814 lyric: "Liston beats Patterson",815 wikiName: "Sonny Liston",816 addendum: " (Sonny Liston)",817 count: 48499,818 oldCount: 29047,819 url: "Sonny_Liston",820 type: "person",821 },822 {823 lyric: "Pope Paul",824 wikiName: "Pope Paul VI",825 addendum: " (Pope Paul VI)",826 count: 28846,827 oldCount: 28303,828 url: "Pope_Paul_VI",829 type: "person",830 },831 {832 lyric: "Malcom X",833 wikiName: "Malcom X",834 addendum: "",835 count: 298567,836 oldCount: 236431,837 url: "Malcolm_X",838 type: "person",839 },840 {841 lyric: "British politican sex",842 wikiName: "Profumo affair",843 addendum: " (Profumo affair)",844 count: 38684,845 oldCount: 44359,846 url: "Profumo_affair",847 type: "history",848 },849 {850 lyric: "JFK blown away",851 wikiName: "Assassination of John F. Kennedy",852 addendum: " (Assassination of John F. Kennedy)",853 count: 155467,854 oldCount: 135381,855 url: "Assassination_of_John_F._Kennedy",856 type: "history",857 },858 {859 lyric: "Birth control",860 wikiName: 'Combined oral contraceptive pill (COCP or, "The Pill")',861 addendum: ' Combined oral contraceptive pill (COCP or, "The Pill")',862 count: 27960,863 oldCount: 32725,864 url: "Combined_oral_contraceptive_pill",865 type: "history",866 },867 {868 lyric: "Ho Chi Minh",869 wikiName: "Ho Chi Minh",870 addendum: "",871 count: 87123,872 oldCount: 108216,873 url: "Ho_Chi_Minh",874 type: "person",875 },876 {877 lyric: "Richard Nixon back again",878 wikiName: "Richard Nixon",879 addendum: "",880 count: 434072,881 oldCount: 332371,882 url: "Richard_Nixon",883 type: "person",884 },885 {886 lyric: "Moonshot",887 wikiName: "Apollo 11",888 addendum: " (Apollo 11)",889 count: 281735,890 oldCount: 131717,891 url: "Apollo_11",892 type: "history",893 },894 {895 lyric: "Woodstock",896 wikiName: "Woodstock",897 addendum: "",898 count: 252836,899 oldCount: 104405,900 url: "Woodstock",901 type: "art",902 },903 {904 lyric: "Watergate",905 wikiName: "Watergate scandal",906 addendum: " (Watergate scandal)",907 count: 379273,908 oldCount: 273397,909 url: "Watergate_scandal",910 type: "history",911 },912 {913 lyric: "Punk Rock",914 wikiName: "Punk Rock",915 addendum: "",916 count: 67237,917 oldCount: 62027,918 url: "Punk_rock",919 type: "art",920 },921 {922 lyric: "Begin",923 wikiName: "Menachem Begin",924 addendum: " (Menachem Begin)",925 count: 20913,926 oldCount: 20629,927 url: "Menachem_Begin",928 type: "person",929 },930 {931 lyric: "Reagan",932 wikiName: "Ronald Reagan",933 addendum: " (Ronald Reagan)",934 count: 428730,935 oldCount: 342044,936 url: "Ronald_Reagan",937 type: "person",938 },939 {940 lyric: "Palestine",941 wikiName: "Israeli-Palestinian conflict",942 addendum: " (Israeli-Palestinian conflict)",943 count: 80738,944 oldCount: 85175,945 url: "flict",946 type: "history",947 },948 {949 lyric: "Terror on the air line",950 wikiName: "Operation Entebbe",951 addendum: " (Operation Entebbe)",952 count: 57339,953 oldCount: 94174,954 url: "Operation_Entebbe",955 type: "history",956 },957 {958 lyric: "Ayatollah's in Iran",959 wikiName: "Iranian Revolution",960 addendum: " (Iranian Revolution)",961 count: 77193,962 oldCount: 62095,963 url: "Iranian_Revolution",964 type: "history",965 },966 {967 lyric: "Russians in Afghanistan",968 wikiName: "Soviet-Afghan War",969 addendum: " (Soviet-Afghan War)",970 count: 1129,971 oldCount: 1244,972 url: "Soviet-Afghan_War",973 type: "history",974 },975 {976 lyric: "Wheel of Fortune",977 wikiName: "Wheel of Fortune (U.S. game show)",978 addendum: " (U.S. game show)",979 count: 90659,980 oldCount: 57802,981 url: "Wheel_of_Fortune_(U.S._game_show)",982 type: "art",983 },984 {985 lyric: "Sally Ride",986 wikiName: "Sally Ride",987 addendum: "",988 count: 46992,989 oldCount: 56690,990 url: "Sally_Ride",991 type: "person",992 },993 {994 lyric: "Heavy metal suicide",995 wikiName: "Heavy metal music",996 addendum: " (Heavy metal music)",997 count: 75222,998 oldCount: 75334,999 url: "Heavy_metal_music",1000 type: "art",1001 },1002 {1003 lyric: "Foreign debts",1004 wikiName: "Foreign debts",1005 addendum: " (United States balance of trade)",1006 count: 545,1007 oldCount: 522,1008 url: "United_States_balance_of_trade",1009 type: "history",1010 },1011 {1012 lyric: "Homeless vets",1013 wikiName: "Vietnam veteran",1014 addendum: " (Vietnam veteran)",1015 count: 13470,1016 oldCount: 6335,1017 url: "Vietnam_veteran",1018 type: "history",1019 },1020 {1021 lyric: "AIDS",1022 wikiName: "AIDS",1023 addendum: "",1024 count: 62890,1025 oldCount: 36868,1026 url: "AIDS",1027 type: "history",1028 },1029 {1030 lyric: "Crack",1031 wikiName: "Crack cocaine",1032 addendum: " (Crack cocaine)",1033 count: 82538,1034 oldCount: 70295,1035 url: "Crack_cocaine",1036 type: "history",1037 },1038 {1039 lyric: "Bernie Goetz",1040 wikiName: "1984 New York City Subway shooting",1041 addendum: "(1984 New York City Subway shooting)",1042 count: 23081,1043 oldCount: 13312,1044 url: "1984_New_York_City_Subway_shooting",1045 type: "person",1046 },1047 {1048 lyric: "Hypodermics on the shore",1049 wikiName: "Syringe Tide",1050 addendum: " (Syringe Tide)",1051 count: 551,1052 oldCount: 558,1053 url: "Syringe_tide",1054 type: "history",1055 },1056 {1057 lyric: "China's under martial law",1058 wikiName: "1989 Tiananmen Square protests",1059 addendum: " (1989 Tiananmen Square protests)",1060 count: 116899,1061 oldCount: 666,1062 url: "1989_Tiananmen_Square_protests",1063 type: "history",1064 },1065 {1066 lyric: "Rock-and-roller cola wars",1067 wikiName: "Cola Wars",1068 addendum: " (Cola Wars)",1069 count: 7921,1070 oldCount: 6842,1071 url: "Cola_wars",1072 type: "history",1073 },1074 ];1075 lyricsData.reverse();1076 const filters = {1077 person: "person",1078 history: "history",1079 art: "art",1080 };1081 let showOld = false;1082 let showNew = true;1083 const oldColorMap = {1084 person: "#35597d",1085 history: "#826828",1086 art: "#852d31",1087 science: "#007b43",1088 };1089 const colorMap = {1090 person: "#66acf0",1091 history: "#fac84e",1092 art: "#ff575e",1093 science: "#00ec82",1094 };1095 let chartData = [];1096 let chartMax = 0;1097 let height = 0;1098 function updateData() {1099 // ------ FILTERS -------1100 chartData = [...lyricsData].filter((a) =>1101 Object.keys(filters).includes(a.type)1102 );1103 switch (sortBy) {1104 case 0:1105 break;1106 case 1:1107 chartData = chartData.sort((a, b) => (a.count > b.count ? 1 : -1));1108 break;1109 case 2:1110 chartData = chartData.sort((a, b) => (a.count < b.count ? 1 : -1));1111 break;1112 case 3:1113 chartData = chartData.sort((a, b) =>1114 a.oldCount > b.oldCount ? 1 : -11115 );1116 break;1117 case 4:1118 chartData = chartData.sort((a, b) =>1119 a.oldCount < b.oldCount ? 1 : -11120 );1121 break;1122 case 5:1123 chartData = chartData.sort((a, b) =>1124 a.count - a.oldCount > b.count - b.oldCount ? 1 : -11125 );1126 break;1127 case 6:1128 chartData = chartData.sort((a, b) =>1129 a.count - a.oldCount < b.count - b.oldCount ? 1 : -11130 );1131 break;1132 }1133 // ------ Height Adjustment ------1134 height = 20 * chartData.length;1135 chartFrame1136 .apply(transit)1137 .attr("height", height + margin.bottom + margin.top);1138 // ------ Axes Adjustments ------1139 chartMax = d3.max(chartData, (d) => Math.max(d.count, d.oldCount));1140 const xScale = d3.scaleLinear().range([0, width]).domain([0, chartMax]);1141 xAxis.attr("class", "x axis").call(d3.axisTop(xScale).tickSizeOuter(0));1142 const yScale = d31143 .scaleBand()1144 .range([height, 0])1145 .domain(chartData.map((d) => d.lyric))1146 .padding(0.2);1147 d3.select(".axis .tick:first-child").remove();1148 // ------ Bars ------1149 let barGroups = chart1150 .selectAll(".bar-group")1151 .data(chartData, (d) => d.lyric);1152 barGroups.exit().transition().duration(100).style("opacity", 0).remove();1153 // Enter/Merge1154 const newBarGroups = barGroups1155 .enter()1156 .append("g")1157 .attrs({1158 class: "bar-group",1159 })1160 .on("click", (d) =>1161 window.open(`https://www.wikipedia.org/wiki/${d.url}`)1162 );1163 newBarGroups.style("opacity", 0);1164 newBarGroups1165 .append("rect")1166 // .apply(transit)1167 .attrs({1168 class: "old-bar",1169 height: 0,1170 })1171 .styles({ fill: (d) => oldColorMap[d.type] });1172 newBarGroups1173 .append("rect")1174 // .apply(transit)1175 .attrs({1176 class: "bar",1177 height: yScale.bandwidth(),1178 })1179 .styles({ fill: (d) => colorMap[d.type] });1180 newBarGroups1181 .append("rect")1182 .attrs({1183 class: "hidden-bar",1184 fill: "orange",1185 height: yScale.bandwidth() * (1 / (1 - 0.2)),1186 y: -2,1187 })1188 .on("mousemove", (d) => {1189 tooltip1190 .styles({1191 left: d3.event.pageX - 50 + "px",1192 top: d3.event.pageY + 10 + "px",1193 display: "inline-block",1194 })1195 .html(1196 `${d.lyric} <i>${d.addendum}</i><br><b>${commafy(d.count)}</b>`1197 );1198 })1199 .on("mouseout", function (d) {1200 tooltip.style("display", "none");1201 });1202 newBarGroups.append("text").attrs({1203 class: "bar-text",1204 x: -8,1205 y: 12,1206 "text-anchor": "end",1207 });1208 newBarGroups.append("rect").attrs({1209 class: "bar-tick",1210 x: -6,1211 y: 7,1212 width: 4,1213 height: 1,1214 fill: "gray",1215 });1216 barGroups = newBarGroups.merge(barGroups);1217 // Update1218 barGroups1219 .apply(fadeTransit)1220 .style("opacity", 1)1221 .attrs({1222 transform: (d) => `translate(${0},${yScale(d.lyric)})`,1223 });1224 if (showOld && showNew) {1225 chart1226 .apply(transit)1227 .selectAll(".old-bar")1228 .attrs({1229 height: yScale.bandwidth() / 2,1230 });1231 chart1232 .apply(transit)1233 .selectAll(".bar")1234 .attrs({1235 y: yScale.bandwidth() / 2,1236 height: yScale.bandwidth() / 2,1237 });1238 } else if (showOld) {1239 chart.apply(transit).selectAll(".old-bar").attrs({1240 y: 0,1241 height: yScale.bandwidth(),1242 });1243 chart.apply(transit).selectAll(".bar").attrs({1244 height: 0,1245 });1246 } else if (showNew) {1247 chart.apply(transit).selectAll(".bar").attrs({1248 y: 0,1249 height: yScale.bandwidth(),1250 });1251 chart.apply(transit).selectAll(".old-bar").attrs({1252 height: 0,1253 });1254 } else {1255 chart.apply(transit).selectAll(".bar").attrs({1256 height: 0,1257 });1258 chart.apply(transit).selectAll(".old-bar").attrs({1259 height: 0,1260 });1261 }1262 // Text1263 switch (lyricType) {1264 case 0:1265 chart.selectAll(".bar-text").text((d) => d.lyric);1266 break;1267 case 1:1268 chart.selectAll(".bar-text").text((d) => d.wikiName);1269 break;1270 }1271 redraw();1272 }1273 const margin = { top: 80, right: 17, bottom: 30, left: 185 };1274 let width = 200;1275 // CHART1276 const chartDiv = document.getElementById("chart");1277 const chartFrame = d3.select(chartDiv);1278 const chart = chartFrame1279 .append("g")1280 .attr("transform", `translate(${margin.left},${margin.top})`);1281 // LEGEND1282 const legendDiv = document.getElementById("legend-chart");1283 const legendFrame = d3.select(legendDiv).append("g");1284 const tooltip = d3.select("body").append("div").attr("class", "toolTip");1285 let lyricType = 0;1286 d3.select("#selectLyricType").on("change", function () {1287 lyricType = this.selectedIndex;1288 updateData();1289 });1290 let sortBy = 0;1291 d3.select("#selectSort").on("change", function () {1292 sortBy = this.selectedIndex;1293 updateData();1294 });1295 const xAxis = chart.append("g");1296 const xAxisLabel = chart1297 .append("text")1298 .attr("y", -50)1299 .attr("dy", "1em")1300 .style("text-anchor", "middle")1301 .text("Wikipedia Page Views in One Month");1302 chart.append("image").attrs({1303 id: "billy",1304 "xlink:href": "https://tomlum.s3.us-east-2.amazonaws.com/billy.png",1305 width: 90,1306 height: 80,1307 y: -75,1308 x: -92,1309 });1310 function makeCheckBox(text, func, color, x, y, initial = true) {1311 const legend = legendFrame.append("g").attr("class", "legend-text");1312 legend1313 .attrs({1314 transform: `translate(${x},${y})`,1315 style: "cursor: pointer",1316 })1317 .append("rect")1318 .attrs({1319 y: -15 / 2,1320 width: 15,1321 height: 15,1322 fill: color,1323 });1324 legend1325 .append("text")1326 .attrs({1327 class: "check-text",1328 x: 20,1329 y: 1,1330 "dominant-baseline": "middle",1331 style: "text-anchor: left",1332 })1333 .text(text);1334 const check = legend1335 .append("polyline")1336 .attrs({1337 points: [2, -2, 6, 4, 13, -5],1338 stroke: "black",1339 fill: "none",1340 display: !initial ? "none" : "default",1341 })1342 .attr("stroke-width", 2);1343 legend.on("click", () => {1344 let result = func();1345 if (result) {1346 check.attr("display", "default");1347 } else {1348 check.attr("display", "none");1349 }1350 updateData();1351 });1352 return legend;1353 }1354 function filterFunc(type) {1355 return () => {1356 if (filters[type]) {1357 delete filters[type];1358 return false;1359 } else {1360 filters[type] = type;1361 return true;1362 }1363 };1364 }1365 makeCheckBox("Person", filterFunc(filters.person), colorMap["person"], 0, 10);1366 makeCheckBox(1367 "History",1368 filterFunc(filters.history),1369 colorMap["history"],1370 100,1371 101372 );1373 makeCheckBox("Art", filterFunc(filters.art), colorMap["art"], 200, 10);1374 makeCheckBox(1375 "2019",1376 () => {1377 if (showNew) {1378 showNew = false;1379 return false;1380 } else {1381 showNew = true;1382 return true;1383 }1384 },1385 "#cacaca",1386 0,1387 40,1388 true1389 );1390 makeCheckBox(1391 "2018",1392 () => {1393 if (showOld) {1394 showOld = false;1395 return false;1396 } else {1397 showOld = true;1398 return true;1399 }1400 },1401 "#888",1402 100,1403 40,1404 false1405 );1406 function redraw() {1407 width =1408 (chartDiv.clientWidth || chartDiv.parentNode.clientWidth) -1409 margin.left -1410 margin.right;1411 chart.attr("width", width);1412 xScale = d31413 .scaleLinear()1414 .range([0, width])1415 .domain([0, d3.max(lyricsData, (d) => Math.max(d.count, d.oldCount))]);1416 chart.selectAll(".bar").attr("width", (d) => xScale(d.count));1417 chart.selectAll(".old-bar").attr("width", (d) => xScale(d.oldCount));1418 chart.selectAll(".hidden-bar").attr("width", (d) => width);1419 xAxis1420 .call(1421 d31422 .axisTop(xScale)1423 .ticks(Math.max(width / 70, 5))1424 .tickSize(height)1425 .tickFormat(d3.formatPrefix("1.0", 1e4))1426 )1427 .attr("transform", "translate(0," + height + ")");1428 xAxisLabel.attr("x", 0 + width / 2);1429 d3.select(".tick").remove();1430 }1431 window.addEventListener("resize", redraw);1432 function transit(x) {1433 return x.transition().ease(d3.easeQuadInOut).duration(500);1434 }1435 function fadeTransit(x) {1436 return x.transition().duration(300);1437 }1438 updateData();1439 document.getElementById("loading").remove();...

Full Screen

Full Screen

post.js

Source:post.js Github

copy

Full Screen

1"use strict";2let apiUrl = "api";3let likePost = async (id) => {4 document5 .querySelector(`#likes_btn_${id}`)6 .setAttribute("disabled", "disabled");7 try {8 let req = await fetch(`${apiUrl}/like.php?id=${id}&type=post`);9 if (!req.ok) throw "Request not found";10 console.log(req);11 await req;12 let oldCount = +document.querySelector(`#likes_count_${id}`).innerHTML;13 document.querySelector(`#likes_count_${id}`).innerHTML = oldCount + 1;14 document.querySelector(`#likes_btn_${id}`).style.display = "none";15 document.querySelector(`#unlikes_btn_${id}`).style.display = "block";16 } catch (ex) {17 console.log(ex);18 } finally {19 document.querySelector(`#likes_btn_${id}`).removeAttribute("disabled");20 }21};22let unLikePost = async (id) => {23 document24 .querySelector(`#unlikes_btn_${id}`)25 .setAttribute("disabled", "disabled");26 try {27 let req = await fetch(`${apiUrl}/unlike.php?id=${id}&type=post`);28 if (!req.ok) throw "Request not found";29 console.log(req);30 await req;31 let oldCount = +document.querySelector(`#likes_count_${id}`).innerHTML;32 if (oldCount <= 1) oldCount = 1;33 document.querySelector(`#likes_count_${id}`).innerHTML = oldCount - 1;34 document.querySelector(`#likes_btn_${id}`).style.display = "block";35 document.querySelector(`#unlikes_btn_${id}`).style.display = "none";36 } catch (ex) {37 console.log(ex);38 } finally {39 document.querySelector(`#unlikes_btn_${id}`).removeAttribute("disabled");40 }41};42let likeComment = async (id) => {43 document44 .querySelector(`#likes_comment_btn_${id}`)45 .setAttribute("disabled", "disabled");46 try {47 let req = await fetch(`${apiUrl}/like.php?id=${id}&type=comment`);48 if (!req.ok) throw "Request not found";49 console.log(req);50 await req;51 let oldCount = +document.querySelector(`#likes_comment_count_${id}`).innerHTML;52 document.querySelector(`#likes_comment_count_${id}`).innerHTML = oldCount + 1;53 document.querySelector(`#likes_comment_btn_${id}`).style.display = "none";54 document.querySelector(`#unlikes_comment_btn_${id}`).style.display = "block";55 } catch (ex) {56 console.log(ex);57 } finally {58 document.querySelector(`#likes_comment_btn_${id}`).removeAttribute("disabled");59 }60};61let unLikeComment = async (id) => {62 document63 .querySelector(`#unlikes_comment_btn_${id}`)64 .setAttribute("disabled", "disabled");65 try {66 let req = await fetch(`${apiUrl}/unlike.php?id=${id}&type=comment`);67 if (!req.ok) throw "Request not found";68 console.log(req);69 await req;70 let oldCount = +document.querySelector(`#likes_comment_count_${id}`).innerHTML;71 if (oldCount <= 1) oldCount = 1;72 document.querySelector(`#likes_comment_count_${id}`).innerHTML = oldCount - 1;73 document.querySelector(`#likes_comment_btn_${id}`).style.display = "block";74 document.querySelector(`#unlikes_comment_btn_${id}`).style.display = "none";75 } catch (ex) {76 console.log(ex);77 } finally {78 document.querySelector(`#unlikes_comment_btn_${id}`).removeAttribute("disabled");79 }80};81let follow = async (id) => {82 document83 .querySelector(`#follow_btn_${id}`)84 .setAttribute("disabled", "disabled");85 try {86 let req = await fetch(`${apiUrl}/follow.php?id=${id}&type=comment`);87 if (!req.ok) throw "Request not found";88 console.log(req);89 await req;90 let oldCount = +document.querySelector(`#Followers_count_${id}`).innerHTML;91 document.querySelector(`#Followers_count_${id}`).innerHTML = oldCount + 1;92 document.querySelector(`#unfollow_btn_${id}`).style.display = "block";93 document.querySelector(`#follow_btn_${id}`).style.display = "none";94 } catch (ex) {95 console.log(ex);96 } finally {97 document.querySelector(`#follow_btn_${id}`).removeAttribute("disabled");98 }99};100let unFollow = async (id) => {101 document102 .querySelector(`#unfollow_btn_${id}`)103 .setAttribute("disabled", "disabled");104 try {105 let req = await fetch(`${apiUrl}/unfollow.php?id=${id}&type=comment`);106 if (!req.ok) throw "Request not found";107 console.log(req);108 await req;109 let oldCount = +document.querySelector(`#Followers_count_${id}`).innerHTML;110 if (oldCount <= 1) oldCount = 1;111 document.querySelector(`#Followers_count_${id}`).innerHTML = oldCount - 1;112 document.querySelector(`#follow_btn_${id}`).style.display = "block";113 document.querySelector(`#unfollow_btn_${id}`).style.display = "none";114 } catch (ex) {115 console.log(ex);116 } finally {117 document.querySelector(`#unfollow_btn_${id}`).removeAttribute("disabled");118 }119};120let deleteComment = async (id) => {121 document122 .querySelector(`#delete_comment_btn_${id}`)123 .setAttribute("disabled", "disabled");124 try {125 let req = await fetch(`${apiUrl}/deleteComment.php?id=${id}`);126 if (!req.ok) throw "Request not found";127 console.log(req);128 await req;129 var element = document.querySelector(`#Comment_No_${id}`);130 element.parentNode.removeChild(element);131 let oldCount = +document.querySelector("#comments_cont_span").innerHTML ;132 if (oldCount <= 1) oldCount = 1;133 document.querySelector(`#comments_cont_span`).innerHTML = oldCount - 1;134 } catch (ex) {135 console.log(ex);136 } finally {137 }...

Full Screen

Full Screen

frequency-queries.js

Source:frequency-queries.js Github

copy

Full Screen

1// https://www.hackerrank.com/challenges/frequency-queries/problem2/**3 * 1 - x: Insert x in your data structure.4 * 2 - y: Delete one occurrence of y from your data structure, if present.5 * 3 - z: Check if any integer is present whose frequency is exactly z. If yes, print 1 else 0.6 *7 */8const fs = require('fs')9const filename = process.argv[2]10function freqQuery(queries) {11 let dataCount = new Map();12 let frequency = new Map();13 let outputs = [];14 for (let i = 0; i < queries.length; i++) {15 let operation = queries[i][0];16 let data = queries[i][1];17 let count18 let oldCount19 switch (operation) {20 case 1:21 count = dataCount.get(data);22 oldCount = count;23 count = count ? count + 1 : 1;24 // decrement the number of data's having the old frequency of the treated data25 // console.log(`oldCount: ${oldCount}, count: ${count}`);26 dataCount.set(data, count);27 if (oldCount) {28 // decrement oldCount frequency29 let freq = frequency.get(oldCount);30 freq = freq ? freq - 1 : 0;31 // if (oldCount > )32 frequency.set(oldCount, freq);33 }34 let freq = frequency.get(count);35 freq = freq ? freq + 1 : 1;36 frequency.set(count, freq);37 // increment count frequency38 break;39 case 2:40 count = dataCount.get(data);41 oldCount = count;42 count = count ? count - 1 : 0;43 // console.log(`[case 2] oldCount: ${oldCount}, count: ${count}`);44 if (count <= 0) {45 dataCount.set(data, 0);46 let freq = frequency.get(count);47 freq++;48 frequency.set(count, freq);49 if (oldCount) {50 freq = frequency.get(oldCount);51 freq--;52 frequency.set(oldCount, freq <= 0 ? 0 : freq);53 }54 } else {55 dataCount.set(data, count);56 }57 // if (count <= 0) {58 // dataCount.delete(data);59 // } else {60 // dataCount.set(data, count);61 // }62 break;63 case 3:64 let wasFound = frequency.get(data);65 // let values = Array.from(dataCount.values());66 // let wasFound = values.find((e) => e === data);67 outputs.push(wasFound ? 1 : 0);68 break;69 }70 }71 // console.log(frequency);72 return outputs;73}74function main() {75 let queries = [];76 fs.readFile('frequency-queries-input.txt', 'utf8', function (error, data) {77 if (error) throw error78 console.log(data);79 let tt = '';80 //data.replace(/\s+$/g, '').split(' ').map(queriesTemp => parseInt(queriesTemp, 10));81 // let res = maxDifference(a)82 // console.log('response: ', res)83 })84 // const ws = fs.createWriteStream(process.env.OUTPUT_PATH);85 //86 // const q = parseInt(readLine().trim(), 10);87 //88 // let queries = Array(q);89 //90 // for (let i = 0; i < q; i++) {91 // queries[i] = readLine().replace(/\s+$/g, '').split(' ').map(queriesTemp => parseInt(queriesTemp, 10));92 // }93 //94 // const ans = freqQuery(queries);95 //96 // ws.write(ans.join('\n') + '\n');97 //98 // ws.end();99}100// let queries = [101// [1, 5],102// [1, 6],103// [3, 2],104// [1, 10],105// [1, 10],106// [1, 6],107// [2, 5],108// [3, 2]109// ];110// let expected = [0, 1];111// let queries = [112// [1, 3],113// [2, 3],114// [3, 2],115// [1, 4],116// [1, 5],117// [1, 5],118// [1, 4],119// [3, 2],120// [2, 4],121// [3, 2]122// ];123//124// let expected = [0, 1, 1];125// let outs = freqQuery(queries);...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { oldCount } = require('fast-check-monorepo');2const result = oldCount(1, 2);3console.log(result);4const { newCount } = require('fast-check-monorepo');5const result = newCount(1, 2);6console.log(result);7import { newCount } from 'fast-check-monorepo';8CommonJS modules can always be imported via the default export, for example using:9import pkg from 'fast-check-monorepo';10const { newCount } = pkg;

Full Screen

Using AI Code Generation

copy

Full Screen

1const {oldCount} = require('fast-check');2const {count} = require('fast-check-monorepo');3const {count} = require('fast-check-monorepo');4const {oldCount} = require('fast-check');5const {count} = require('fast-check-monorepo');6const {oldCount} = require('fast-check');7const {oldCount} = require('fast-check-monorepo');8const {count} = require('fast-check-monorepo');9const {oldCount} = require('fast-check');10const {oldCount} = require('fast-check-monorepo');11const {count} = require('fast-check');12const {count} = require('fast-check-monorepo');13const {oldCount} = require('fast-check');14const {oldCount} = require('fast-check-monorepo');15const {count} = require('fast-check');16const {count} = require('fast-check-monorepo');17const {oldCount} = require('fast-check');18const {count} = require('fast-check-monorepo');19const {oldCount} = require('fast-check');20const {oldCount} = require('fast-check-monorepo');21const {count} = require('fast-check');22const {count} = require('fast-check-monorepo');23const {oldCount} = require('fast-check');24const {oldCount} = require('fast-check-monorepo');25const {count} = require('fast-check');26const {count} = require('fast-check-monorepo');27const {oldCount} = require('fast-check');28const {oldCount} = require('fast-check-monorepo');29const {count} = require('fast-check');30const {count} = require('fast-check-monorepo');31const {oldCount} = require('fast-check');32const {oldCount

Full Screen

Using AI Code Generation

copy

Full Screen

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

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2console.log(fc.oldCount(function() { return true; }, 1000));3const fc = require('fast-check');4console.log(fc.newCount(function() { return true; }, 1000));5const fc = require('fast-check');6console.log(fc.newCount(function(s) { return s === "hello"; }, 1000, {stringLength: 5}));

Full Screen

Using AI Code Generation

copy

Full Screen

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

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2const { oldCount } = require('fast-check-monorepo');3fc.assert(fc.property(fc.array(fc.integer()), (array) => array.length === oldCount(array)));4const fc = require('fast-check');5const { newCount } = require('fast-check-monorepo');6fc.assert(fc.property(fc.array(fc.integer()), (array) => array.length === newCount(array)));

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2const { oldCount } = require('fast-check-monorepo');3fc.assert(oldCount(fc.integer(), (x) => x > 0) > 100);4const fc = require('fast-check');5const { newCount } = require('fast-check-monorepo');6fc.assert(newCount(fc.integer(), (x) => x > 0) > 100);7module.exports.newCount = newCount;8const fc = require('fast-check');9const { newCount } = require('fast-check-monorepo');10fc.assert(newCount(fc.integer(), (x) => x > 0) > 100);

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