123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063 |
- 'use strict';
- var build = require('./dep-1be34a63.js');
- var compilerDom_cjs$2 = {};
- /**
- * Make a map and return a function for checking if a key
- * is in that map.
- * IMPORTANT: all calls of this function must be prefixed with
- * \/\*#\_\_PURE\_\_\*\/
- * So that rollup can tree-shake them if necessary.
- */
- function makeMap(str, expectsLowerCase) {
- const map = Object.create(null);
- const list = str.split(',');
- for (let i = 0; i < list.length; i++) {
- map[list[i]] = true;
- }
- return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];
- }
- /**
- * dev only flag -> name mapping
- */
- const PatchFlagNames = {
- [1 /* TEXT */]: `TEXT`,
- [2 /* CLASS */]: `CLASS`,
- [4 /* STYLE */]: `STYLE`,
- [8 /* PROPS */]: `PROPS`,
- [16 /* FULL_PROPS */]: `FULL_PROPS`,
- [32 /* HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,
- [64 /* STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,
- [128 /* KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,
- [256 /* UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,
- [512 /* NEED_PATCH */]: `NEED_PATCH`,
- [1024 /* DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,
- [2048 /* DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,
- [-1 /* HOISTED */]: `HOISTED`,
- [-2 /* BAIL */]: `BAIL`
- };
- /**
- * Dev only
- */
- const slotFlagsText = {
- [1 /* STABLE */]: 'STABLE',
- [2 /* DYNAMIC */]: 'DYNAMIC',
- [3 /* FORWARDED */]: 'FORWARDED'
- };
- const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
- 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
- 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
- const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);
- const range = 2;
- function generateCodeFrame(source, start = 0, end = source.length) {
- // Split the content into individual lines but capture the newline sequence
- // that separated each line. This is important because the actual sequence is
- // needed to properly take into account the full line length for offset
- // comparison
- let lines = source.split(/(\r?\n)/);
- // Separate the lines and newline sequences into separate arrays for easier referencing
- const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
- lines = lines.filter((_, idx) => idx % 2 === 0);
- let count = 0;
- const res = [];
- for (let i = 0; i < lines.length; i++) {
- count +=
- lines[i].length +
- ((newlineSequences[i] && newlineSequences[i].length) || 0);
- if (count >= start) {
- for (let j = i - range; j <= i + range || end > count; j++) {
- if (j < 0 || j >= lines.length)
- continue;
- const line = j + 1;
- res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);
- const lineLength = lines[j].length;
- const newLineSeqLength = (newlineSequences[j] && newlineSequences[j].length) || 0;
- if (j === i) {
- // push underline
- const pad = start - (count - (lineLength + newLineSeqLength));
- const length = Math.max(1, end > count ? lineLength - pad : end - start);
- res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
- }
- else if (j > i) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + '^'.repeat(length));
- }
- count += lineLength + newLineSeqLength;
- }
- }
- break;
- }
- }
- return res.join('\n');
- }
- /**
- * On the client we only need to offer special cases for boolean attributes that
- * have different names from their corresponding dom properties:
- * - itemscope -> N/A
- * - allowfullscreen -> allowFullscreen
- * - formnovalidate -> formNoValidate
- * - ismap -> isMap
- * - nomodule -> noModule
- * - novalidate -> noValidate
- * - readonly -> readOnly
- */
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
- /**
- * The full list is needed during SSR to produce the correct initial markup.
- */
- const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
- `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
- `loop,open,required,reversed,scoped,seamless,` +
- `checked,muted,multiple,selected`);
- /**
- * Boolean attributes should be included if the value is truthy or ''.
- * e.g. <select multiple> compiles to { multiple: '' }
- */
- function includeBooleanAttr(value) {
- return !!value || value === '';
- }
- const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
- const attrValidationCache = {};
- function isSSRSafeAttrName(name) {
- if (attrValidationCache.hasOwnProperty(name)) {
- return attrValidationCache[name];
- }
- const isUnsafe = unsafeAttrCharRE.test(name);
- if (isUnsafe) {
- console.error(`unsafe attribute name: ${name}`);
- }
- return (attrValidationCache[name] = !isUnsafe);
- }
- const propsToAttrMap = {
- acceptCharset: 'accept-charset',
- className: 'class',
- htmlFor: 'for',
- httpEquiv: 'http-equiv'
- };
- /**
- * CSS properties that accept plain numbers
- */
- const isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +
- `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +
- `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +
- `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +
- `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +
- `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +
- // SVG
- `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +
- `stroke-miterlimit,stroke-opacity,stroke-width`);
- /**
- * Known attributes, this is used for stringification of runtime static nodes
- * so that we don't stringify bindings that cannot be set from HTML.
- * Don't also forget to allow `data-*` and `aria-*`!
- * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
- */
- const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
- `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
- `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
- `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
- `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
- `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
- `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
- `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
- `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
- `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
- `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
- `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
- `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
- `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
- `value,width,wrap`);
- /**
- * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
- */
- const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
- `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
- `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
- `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
- `color-interpolation-filters,color-profile,color-rendering,` +
- `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
- `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
- `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
- `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
- `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
- `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
- `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
- `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
- `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
- `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
- `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
- `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
- `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
- `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
- `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
- `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
- `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
- `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
- `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
- `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
- `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
- `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
- `strikethrough-position,strikethrough-thickness,string,stroke,` +
- `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
- `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
- `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
- `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
- `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
- `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
- `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
- `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
- `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
- `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
- `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
- function normalizeStyle(value) {
- if (isArray(value)) {
- const res = {};
- for (let i = 0; i < value.length; i++) {
- const item = value[i];
- const normalized = isString(item)
- ? parseStringStyle(item)
- : normalizeStyle(item);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
- }
- }
- }
- return res;
- }
- else if (isString(value)) {
- return value;
- }
- else if (isObject(value)) {
- return value;
- }
- }
- const listDelimiterRE = /;(?![^(]*\))/g;
- const propertyDelimiterRE = /:(.+)/;
- function parseStringStyle(cssText) {
- const ret = {};
- cssText.split(listDelimiterRE).forEach(item => {
- if (item) {
- const tmp = item.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return ret;
- }
- function stringifyStyle(styles) {
- let ret = '';
- if (!styles || isString(styles)) {
- return ret;
- }
- for (const key in styles) {
- const value = styles[key];
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
- if (isString(value) ||
- (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {
- // only render valid values
- ret += `${normalizedKey}:${value};`;
- }
- }
- return ret;
- }
- function normalizeClass(value) {
- let res = '';
- if (isString(value)) {
- res = value;
- }
- else if (isArray(value)) {
- for (let i = 0; i < value.length; i++) {
- const normalized = normalizeClass(value[i]);
- if (normalized) {
- res += normalized + ' ';
- }
- }
- }
- else if (isObject(value)) {
- for (const name in value) {
- if (value[name]) {
- res += name + ' ';
- }
- }
- }
- return res.trim();
- }
- function normalizeProps(props) {
- if (!props)
- return null;
- let { class: klass, style } = props;
- if (klass && !isString(klass)) {
- props.class = normalizeClass(klass);
- }
- if (style) {
- props.style = normalizeStyle(style);
- }
- return props;
- }
- // These tag configs are shared between compiler-dom and runtime-dom, so they
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Element
- const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
- 'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
- 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
- 'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
- 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
- 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +
- 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +
- 'option,output,progress,select,textarea,details,dialog,menu,' +
- 'summary,template,blockquote,iframe,tfoot';
- // https://developer.mozilla.org/en-US/docs/Web/SVG/Element
- const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
- 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
- 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
- 'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
- 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
- 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
- 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
- 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +
- 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +
- 'text,textPath,title,tspan,unknown,use,view';
- const VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';
- const isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);
- const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
- const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
- const escapeRE = /["'&<>]/;
- function escapeHtml(string) {
- const str = '' + string;
- const match = escapeRE.exec(str);
- if (!match) {
- return str;
- }
- let html = '';
- let escaped;
- let index;
- let lastIndex = 0;
- for (index = match.index; index < str.length; index++) {
- switch (str.charCodeAt(index)) {
- case 34: // "
- escaped = '"';
- break;
- case 38: // &
- escaped = '&';
- break;
- case 39: // '
- escaped = ''';
- break;
- case 60: // <
- escaped = '<';
- break;
- case 62: // >
- escaped = '>';
- break;
- default:
- continue;
- }
- if (lastIndex !== index) {
- html += str.substring(lastIndex, index);
- }
- lastIndex = index + 1;
- html += escaped;
- }
- return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
- }
- // https://www.w3.org/TR/html52/syntax.html#comments
- const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
- function escapeHtmlComment(src) {
- return src.replace(commentStripRE, '');
- }
- function looseCompareArrays(a, b) {
- if (a.length !== b.length)
- return false;
- let equal = true;
- for (let i = 0; equal && i < a.length; i++) {
- equal = looseEqual(a[i], b[i]);
- }
- return equal;
- }
- function looseEqual(a, b) {
- if (a === b)
- return true;
- let aValidType = isDate(a);
- let bValidType = isDate(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
- }
- aValidType = isArray(a);
- bValidType = isArray(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
- }
- aValidType = isObject(a);
- bValidType = isObject(b);
- if (aValidType || bValidType) {
- /* istanbul ignore if: this if will probably never be called */
- if (!aValidType || !bValidType) {
- return false;
- }
- const aKeysCount = Object.keys(a).length;
- const bKeysCount = Object.keys(b).length;
- if (aKeysCount !== bKeysCount) {
- return false;
- }
- for (const key in a) {
- const aHasKey = a.hasOwnProperty(key);
- const bHasKey = b.hasOwnProperty(key);
- if ((aHasKey && !bHasKey) ||
- (!aHasKey && bHasKey) ||
- !looseEqual(a[key], b[key])) {
- return false;
- }
- }
- }
- return String(a) === String(b);
- }
- function looseIndexOf(arr, val) {
- return arr.findIndex(item => looseEqual(item, val));
- }
- /**
- * For converting {{ interpolation }} values to displayed strings.
- * @private
- */
- const toDisplayString = (val) => {
- return val == null
- ? ''
- : isArray(val) ||
- (isObject(val) &&
- (val.toString === objectToString$1 || !isFunction$1(val.toString)))
- ? JSON.stringify(val, replacer, 2)
- : String(val);
- };
- const replacer = (_key, val) => {
- // can't use isRef here since @vue/shared has no deps
- if (val && val.__v_isRef) {
- return replacer(_key, val.value);
- }
- else if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {
- entries[`${key} =>`] = val;
- return entries;
- }, {})
- };
- }
- else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()]
- };
- }
- else if (isObject(val) && !isArray(val) && !isPlainObject$1(val)) {
- return String(val);
- }
- return val;
- };
- /**
- * List of @babel/parser plugins that are used for template expression
- * transforms and SFC script transforms. By default we enable proposals slated
- * for ES2020. This will need to be updated as the spec moves forward.
- * Full list at https://babeljs.io/docs/en/next/babel-parser#plugins
- */
- const babelParserDefaultPlugins = [
- 'bigInt',
- 'optionalChaining',
- 'nullishCoalescingOperator'
- ];
- const EMPTY_OBJ = (process.env.NODE_ENV !== 'production')
- ? Object.freeze({})
- : {};
- const EMPTY_ARR = (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
- const NOOP = () => { };
- /**
- * Always return false.
- */
- const NO = () => false;
- const onRE = /^on[^a-z]/;
- const isOn = (key) => onRE.test(key);
- const isModelListener = (key) => key.startsWith('onUpdate:');
- const extend = Object.assign;
- const remove = (arr, el) => {
- const i = arr.indexOf(el);
- if (i > -1) {
- arr.splice(i, 1);
- }
- };
- const hasOwnProperty = Object.prototype.hasOwnProperty;
- const hasOwn = (val, key) => hasOwnProperty.call(val, key);
- const isArray = Array.isArray;
- const isMap = (val) => toTypeString(val) === '[object Map]';
- const isSet = (val) => toTypeString(val) === '[object Set]';
- const isDate = (val) => val instanceof Date;
- const isFunction$1 = (val) => typeof val === 'function';
- const isString = (val) => typeof val === 'string';
- const isSymbol = (val) => typeof val === 'symbol';
- const isObject = (val) => val !== null && typeof val === 'object';
- const isPromise = (val) => {
- return isObject(val) && isFunction$1(val.then) && isFunction$1(val.catch);
- };
- const objectToString$1 = Object.prototype.toString;
- const toTypeString = (value) => objectToString$1.call(value);
- const toRawType = (value) => {
- // extract "RawType" from strings like "[object RawType]"
- return toTypeString(value).slice(8, -1);
- };
- const isPlainObject$1 = (val) => toTypeString(val) === '[object Object]';
- const isIntegerKey = (key) => isString(key) &&
- key !== 'NaN' &&
- key[0] !== '-' &&
- '' + parseInt(key, 10) === key;
- const isReservedProp = /*#__PURE__*/ makeMap(
- // the leading comma is intentional so empty string "" is also included
- ',key,ref,' +
- 'onVnodeBeforeMount,onVnodeMounted,' +
- 'onVnodeBeforeUpdate,onVnodeUpdated,' +
- 'onVnodeBeforeUnmount,onVnodeUnmounted');
- const cacheStringFunction$1 = (fn) => {
- const cache = Object.create(null);
- return ((str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- });
- };
- const camelizeRE$1 = /-(\w)/g;
- /**
- * @private
- */
- const camelize$1 = cacheStringFunction$1((str) => {
- return str.replace(camelizeRE$1, (_, c) => (c ? c.toUpperCase() : ''));
- });
- const hyphenateRE = /\B([A-Z])/g;
- /**
- * @private
- */
- const hyphenate = cacheStringFunction$1((str) => str.replace(hyphenateRE, '-$1').toLowerCase());
- /**
- * @private
- */
- const capitalize = cacheStringFunction$1((str) => str.charAt(0).toUpperCase() + str.slice(1));
- /**
- * @private
- */
- const toHandlerKey = cacheStringFunction$1((str) => str ? `on${capitalize(str)}` : ``);
- // compare whether a value has changed, accounting for NaN.
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
- const invokeArrayFns = (fns, arg) => {
- for (let i = 0; i < fns.length; i++) {
- fns[i](arg);
- }
- };
- const def = (obj, key, value) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- value
- });
- };
- const toNumber = (val) => {
- const n = parseFloat(val);
- return isNaN(n) ? val : n;
- };
- let _globalThis;
- const getGlobalThis = () => {
- return (_globalThis ||
- (_globalThis =
- typeof globalThis !== 'undefined'
- ? globalThis
- : typeof self !== 'undefined'
- ? self
- : typeof window !== 'undefined'
- ? window
- : typeof global !== 'undefined'
- ? global
- : {}));
- };
- var shared_esmBundler = {
- __proto__: null,
- EMPTY_ARR: EMPTY_ARR,
- EMPTY_OBJ: EMPTY_OBJ,
- NO: NO,
- NOOP: NOOP,
- PatchFlagNames: PatchFlagNames,
- babelParserDefaultPlugins: babelParserDefaultPlugins,
- camelize: camelize$1,
- capitalize: capitalize,
- def: def,
- escapeHtml: escapeHtml,
- escapeHtmlComment: escapeHtmlComment,
- extend: extend,
- generateCodeFrame: generateCodeFrame,
- getGlobalThis: getGlobalThis,
- hasChanged: hasChanged,
- hasOwn: hasOwn,
- hyphenate: hyphenate,
- includeBooleanAttr: includeBooleanAttr,
- invokeArrayFns: invokeArrayFns,
- isArray: isArray,
- isBooleanAttr: isBooleanAttr,
- isDate: isDate,
- isFunction: isFunction$1,
- isGloballyWhitelisted: isGloballyWhitelisted,
- isHTMLTag: isHTMLTag,
- isIntegerKey: isIntegerKey,
- isKnownHtmlAttr: isKnownHtmlAttr,
- isKnownSvgAttr: isKnownSvgAttr,
- isMap: isMap,
- isModelListener: isModelListener,
- isNoUnitNumericStyleProp: isNoUnitNumericStyleProp,
- isObject: isObject,
- isOn: isOn,
- isPlainObject: isPlainObject$1,
- isPromise: isPromise,
- isReservedProp: isReservedProp,
- isSSRSafeAttrName: isSSRSafeAttrName,
- isSVGTag: isSVGTag,
- isSet: isSet,
- isSpecialBooleanAttr: isSpecialBooleanAttr,
- isString: isString,
- isSymbol: isSymbol,
- isVoidTag: isVoidTag,
- looseEqual: looseEqual,
- looseIndexOf: looseIndexOf,
- makeMap: makeMap,
- normalizeClass: normalizeClass,
- normalizeProps: normalizeProps,
- normalizeStyle: normalizeStyle,
- objectToString: objectToString$1,
- parseStringStyle: parseStringStyle,
- propsToAttrMap: propsToAttrMap,
- remove: remove,
- slotFlagsText: slotFlagsText,
- stringifyStyle: stringifyStyle,
- toDisplayString: toDisplayString,
- toHandlerKey: toHandlerKey,
- toNumber: toNumber,
- toRawType: toRawType,
- toTypeString: toTypeString
- };
- var lib$1 = {};
- var isReactComponent$1 = {};
- var buildMatchMemberExpression$1 = {};
- var matchesPattern$1 = {};
- var generated$4 = {};
- var shallowEqual$1 = {};
- Object.defineProperty(shallowEqual$1, "__esModule", {
- value: true
- });
- shallowEqual$1.default = shallowEqual;
- function shallowEqual(actual, expected) {
- const keys = Object.keys(expected);
- for (const key of keys) {
- if (actual[key] !== expected[key]) {
- return false;
- }
- }
- return true;
- }
- Object.defineProperty(generated$4, "__esModule", {
- value: true
- });
- generated$4.isArrayExpression = isArrayExpression;
- generated$4.isAssignmentExpression = isAssignmentExpression;
- generated$4.isBinaryExpression = isBinaryExpression;
- generated$4.isInterpreterDirective = isInterpreterDirective;
- generated$4.isDirective = isDirective;
- generated$4.isDirectiveLiteral = isDirectiveLiteral;
- generated$4.isBlockStatement = isBlockStatement;
- generated$4.isBreakStatement = isBreakStatement;
- generated$4.isCallExpression = isCallExpression;
- generated$4.isCatchClause = isCatchClause;
- generated$4.isConditionalExpression = isConditionalExpression;
- generated$4.isContinueStatement = isContinueStatement;
- generated$4.isDebuggerStatement = isDebuggerStatement;
- generated$4.isDoWhileStatement = isDoWhileStatement;
- generated$4.isEmptyStatement = isEmptyStatement;
- generated$4.isExpressionStatement = isExpressionStatement;
- generated$4.isFile = isFile;
- generated$4.isForInStatement = isForInStatement;
- generated$4.isForStatement = isForStatement;
- generated$4.isFunctionDeclaration = isFunctionDeclaration;
- generated$4.isFunctionExpression = isFunctionExpression;
- generated$4.isIdentifier = isIdentifier;
- generated$4.isIfStatement = isIfStatement;
- generated$4.isLabeledStatement = isLabeledStatement;
- generated$4.isStringLiteral = isStringLiteral;
- generated$4.isNumericLiteral = isNumericLiteral;
- generated$4.isNullLiteral = isNullLiteral;
- generated$4.isBooleanLiteral = isBooleanLiteral;
- generated$4.isRegExpLiteral = isRegExpLiteral;
- generated$4.isLogicalExpression = isLogicalExpression;
- generated$4.isMemberExpression = isMemberExpression$1;
- generated$4.isNewExpression = isNewExpression;
- generated$4.isProgram = isProgram;
- generated$4.isObjectExpression = isObjectExpression;
- generated$4.isObjectMethod = isObjectMethod;
- generated$4.isObjectProperty = isObjectProperty;
- generated$4.isRestElement = isRestElement;
- generated$4.isReturnStatement = isReturnStatement;
- generated$4.isSequenceExpression = isSequenceExpression;
- generated$4.isParenthesizedExpression = isParenthesizedExpression;
- generated$4.isSwitchCase = isSwitchCase;
- generated$4.isSwitchStatement = isSwitchStatement;
- generated$4.isThisExpression = isThisExpression;
- generated$4.isThrowStatement = isThrowStatement;
- generated$4.isTryStatement = isTryStatement;
- generated$4.isUnaryExpression = isUnaryExpression;
- generated$4.isUpdateExpression = isUpdateExpression;
- generated$4.isVariableDeclaration = isVariableDeclaration;
- generated$4.isVariableDeclarator = isVariableDeclarator;
- generated$4.isWhileStatement = isWhileStatement;
- generated$4.isWithStatement = isWithStatement;
- generated$4.isAssignmentPattern = isAssignmentPattern;
- generated$4.isArrayPattern = isArrayPattern;
- generated$4.isArrowFunctionExpression = isArrowFunctionExpression;
- generated$4.isClassBody = isClassBody;
- generated$4.isClassExpression = isClassExpression;
- generated$4.isClassDeclaration = isClassDeclaration;
- generated$4.isExportAllDeclaration = isExportAllDeclaration;
- generated$4.isExportDefaultDeclaration = isExportDefaultDeclaration;
- generated$4.isExportNamedDeclaration = isExportNamedDeclaration;
- generated$4.isExportSpecifier = isExportSpecifier;
- generated$4.isForOfStatement = isForOfStatement;
- generated$4.isImportDeclaration = isImportDeclaration;
- generated$4.isImportDefaultSpecifier = isImportDefaultSpecifier;
- generated$4.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
- generated$4.isImportSpecifier = isImportSpecifier;
- generated$4.isMetaProperty = isMetaProperty;
- generated$4.isClassMethod = isClassMethod;
- generated$4.isObjectPattern = isObjectPattern;
- generated$4.isSpreadElement = isSpreadElement;
- generated$4.isSuper = isSuper;
- generated$4.isTaggedTemplateExpression = isTaggedTemplateExpression;
- generated$4.isTemplateElement = isTemplateElement;
- generated$4.isTemplateLiteral = isTemplateLiteral;
- generated$4.isYieldExpression = isYieldExpression;
- generated$4.isAwaitExpression = isAwaitExpression;
- generated$4.isImport = isImport;
- generated$4.isBigIntLiteral = isBigIntLiteral;
- generated$4.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
- generated$4.isOptionalMemberExpression = isOptionalMemberExpression;
- generated$4.isOptionalCallExpression = isOptionalCallExpression;
- generated$4.isClassProperty = isClassProperty;
- generated$4.isClassPrivateProperty = isClassPrivateProperty;
- generated$4.isClassPrivateMethod = isClassPrivateMethod;
- generated$4.isPrivateName = isPrivateName;
- generated$4.isAnyTypeAnnotation = isAnyTypeAnnotation;
- generated$4.isArrayTypeAnnotation = isArrayTypeAnnotation;
- generated$4.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
- generated$4.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
- generated$4.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
- generated$4.isClassImplements = isClassImplements;
- generated$4.isDeclareClass = isDeclareClass;
- generated$4.isDeclareFunction = isDeclareFunction;
- generated$4.isDeclareInterface = isDeclareInterface;
- generated$4.isDeclareModule = isDeclareModule;
- generated$4.isDeclareModuleExports = isDeclareModuleExports;
- generated$4.isDeclareTypeAlias = isDeclareTypeAlias;
- generated$4.isDeclareOpaqueType = isDeclareOpaqueType;
- generated$4.isDeclareVariable = isDeclareVariable;
- generated$4.isDeclareExportDeclaration = isDeclareExportDeclaration;
- generated$4.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
- generated$4.isDeclaredPredicate = isDeclaredPredicate;
- generated$4.isExistsTypeAnnotation = isExistsTypeAnnotation;
- generated$4.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
- generated$4.isFunctionTypeParam = isFunctionTypeParam;
- generated$4.isGenericTypeAnnotation = isGenericTypeAnnotation;
- generated$4.isInferredPredicate = isInferredPredicate;
- generated$4.isInterfaceExtends = isInterfaceExtends;
- generated$4.isInterfaceDeclaration = isInterfaceDeclaration;
- generated$4.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
- generated$4.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;
- generated$4.isMixedTypeAnnotation = isMixedTypeAnnotation;
- generated$4.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
- generated$4.isNullableTypeAnnotation = isNullableTypeAnnotation;
- generated$4.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
- generated$4.isNumberTypeAnnotation = isNumberTypeAnnotation;
- generated$4.isObjectTypeAnnotation = isObjectTypeAnnotation;
- generated$4.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
- generated$4.isObjectTypeCallProperty = isObjectTypeCallProperty;
- generated$4.isObjectTypeIndexer = isObjectTypeIndexer;
- generated$4.isObjectTypeProperty = isObjectTypeProperty;
- generated$4.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
- generated$4.isOpaqueType = isOpaqueType;
- generated$4.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
- generated$4.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
- generated$4.isStringTypeAnnotation = isStringTypeAnnotation;
- generated$4.isSymbolTypeAnnotation = isSymbolTypeAnnotation;
- generated$4.isThisTypeAnnotation = isThisTypeAnnotation;
- generated$4.isTupleTypeAnnotation = isTupleTypeAnnotation;
- generated$4.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
- generated$4.isTypeAlias = isTypeAlias;
- generated$4.isTypeAnnotation = isTypeAnnotation;
- generated$4.isTypeCastExpression = isTypeCastExpression;
- generated$4.isTypeParameter = isTypeParameter;
- generated$4.isTypeParameterDeclaration = isTypeParameterDeclaration;
- generated$4.isTypeParameterInstantiation = isTypeParameterInstantiation;
- generated$4.isUnionTypeAnnotation = isUnionTypeAnnotation;
- generated$4.isVariance = isVariance;
- generated$4.isVoidTypeAnnotation = isVoidTypeAnnotation;
- generated$4.isEnumDeclaration = isEnumDeclaration;
- generated$4.isEnumBooleanBody = isEnumBooleanBody;
- generated$4.isEnumNumberBody = isEnumNumberBody;
- generated$4.isEnumStringBody = isEnumStringBody;
- generated$4.isEnumSymbolBody = isEnumSymbolBody;
- generated$4.isEnumBooleanMember = isEnumBooleanMember;
- generated$4.isEnumNumberMember = isEnumNumberMember;
- generated$4.isEnumStringMember = isEnumStringMember;
- generated$4.isEnumDefaultedMember = isEnumDefaultedMember;
- generated$4.isIndexedAccessType = isIndexedAccessType;
- generated$4.isOptionalIndexedAccessType = isOptionalIndexedAccessType;
- generated$4.isJSXAttribute = isJSXAttribute;
- generated$4.isJSXClosingElement = isJSXClosingElement;
- generated$4.isJSXElement = isJSXElement;
- generated$4.isJSXEmptyExpression = isJSXEmptyExpression;
- generated$4.isJSXExpressionContainer = isJSXExpressionContainer;
- generated$4.isJSXSpreadChild = isJSXSpreadChild;
- generated$4.isJSXIdentifier = isJSXIdentifier;
- generated$4.isJSXMemberExpression = isJSXMemberExpression;
- generated$4.isJSXNamespacedName = isJSXNamespacedName;
- generated$4.isJSXOpeningElement = isJSXOpeningElement;
- generated$4.isJSXSpreadAttribute = isJSXSpreadAttribute;
- generated$4.isJSXText = isJSXText;
- generated$4.isJSXFragment = isJSXFragment;
- generated$4.isJSXOpeningFragment = isJSXOpeningFragment;
- generated$4.isJSXClosingFragment = isJSXClosingFragment;
- generated$4.isNoop = isNoop;
- generated$4.isPlaceholder = isPlaceholder;
- generated$4.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier;
- generated$4.isArgumentPlaceholder = isArgumentPlaceholder;
- generated$4.isBindExpression = isBindExpression;
- generated$4.isImportAttribute = isImportAttribute;
- generated$4.isDecorator = isDecorator;
- generated$4.isDoExpression = isDoExpression;
- generated$4.isExportDefaultSpecifier = isExportDefaultSpecifier;
- generated$4.isRecordExpression = isRecordExpression;
- generated$4.isTupleExpression = isTupleExpression;
- generated$4.isDecimalLiteral = isDecimalLiteral;
- generated$4.isStaticBlock = isStaticBlock;
- generated$4.isModuleExpression = isModuleExpression;
- generated$4.isTopicReference = isTopicReference;
- generated$4.isPipelineTopicExpression = isPipelineTopicExpression;
- generated$4.isPipelineBareFunction = isPipelineBareFunction;
- generated$4.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference;
- generated$4.isTSParameterProperty = isTSParameterProperty;
- generated$4.isTSDeclareFunction = isTSDeclareFunction;
- generated$4.isTSDeclareMethod = isTSDeclareMethod;
- generated$4.isTSQualifiedName = isTSQualifiedName;
- generated$4.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
- generated$4.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
- generated$4.isTSPropertySignature = isTSPropertySignature;
- generated$4.isTSMethodSignature = isTSMethodSignature;
- generated$4.isTSIndexSignature = isTSIndexSignature;
- generated$4.isTSAnyKeyword = isTSAnyKeyword;
- generated$4.isTSBooleanKeyword = isTSBooleanKeyword;
- generated$4.isTSBigIntKeyword = isTSBigIntKeyword;
- generated$4.isTSIntrinsicKeyword = isTSIntrinsicKeyword;
- generated$4.isTSNeverKeyword = isTSNeverKeyword;
- generated$4.isTSNullKeyword = isTSNullKeyword;
- generated$4.isTSNumberKeyword = isTSNumberKeyword;
- generated$4.isTSObjectKeyword = isTSObjectKeyword;
- generated$4.isTSStringKeyword = isTSStringKeyword;
- generated$4.isTSSymbolKeyword = isTSSymbolKeyword;
- generated$4.isTSUndefinedKeyword = isTSUndefinedKeyword;
- generated$4.isTSUnknownKeyword = isTSUnknownKeyword;
- generated$4.isTSVoidKeyword = isTSVoidKeyword;
- generated$4.isTSThisType = isTSThisType;
- generated$4.isTSFunctionType = isTSFunctionType;
- generated$4.isTSConstructorType = isTSConstructorType;
- generated$4.isTSTypeReference = isTSTypeReference;
- generated$4.isTSTypePredicate = isTSTypePredicate;
- generated$4.isTSTypeQuery = isTSTypeQuery;
- generated$4.isTSTypeLiteral = isTSTypeLiteral;
- generated$4.isTSArrayType = isTSArrayType;
- generated$4.isTSTupleType = isTSTupleType;
- generated$4.isTSOptionalType = isTSOptionalType;
- generated$4.isTSRestType = isTSRestType;
- generated$4.isTSNamedTupleMember = isTSNamedTupleMember;
- generated$4.isTSUnionType = isTSUnionType;
- generated$4.isTSIntersectionType = isTSIntersectionType;
- generated$4.isTSConditionalType = isTSConditionalType;
- generated$4.isTSInferType = isTSInferType;
- generated$4.isTSParenthesizedType = isTSParenthesizedType;
- generated$4.isTSTypeOperator = isTSTypeOperator;
- generated$4.isTSIndexedAccessType = isTSIndexedAccessType;
- generated$4.isTSMappedType = isTSMappedType;
- generated$4.isTSLiteralType = isTSLiteralType;
- generated$4.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
- generated$4.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
- generated$4.isTSInterfaceBody = isTSInterfaceBody;
- generated$4.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
- generated$4.isTSAsExpression = isTSAsExpression;
- generated$4.isTSTypeAssertion = isTSTypeAssertion;
- generated$4.isTSEnumDeclaration = isTSEnumDeclaration;
- generated$4.isTSEnumMember = isTSEnumMember;
- generated$4.isTSModuleDeclaration = isTSModuleDeclaration;
- generated$4.isTSModuleBlock = isTSModuleBlock;
- generated$4.isTSImportType = isTSImportType;
- generated$4.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
- generated$4.isTSExternalModuleReference = isTSExternalModuleReference;
- generated$4.isTSNonNullExpression = isTSNonNullExpression;
- generated$4.isTSExportAssignment = isTSExportAssignment;
- generated$4.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
- generated$4.isTSTypeAnnotation = isTSTypeAnnotation;
- generated$4.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
- generated$4.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
- generated$4.isTSTypeParameter = isTSTypeParameter;
- generated$4.isExpression = isExpression;
- generated$4.isBinary = isBinary;
- generated$4.isScopable = isScopable;
- generated$4.isBlockParent = isBlockParent;
- generated$4.isBlock = isBlock;
- generated$4.isStatement = isStatement;
- generated$4.isTerminatorless = isTerminatorless;
- generated$4.isCompletionStatement = isCompletionStatement;
- generated$4.isConditional = isConditional;
- generated$4.isLoop = isLoop;
- generated$4.isWhile = isWhile;
- generated$4.isExpressionWrapper = isExpressionWrapper;
- generated$4.isFor = isFor;
- generated$4.isForXStatement = isForXStatement;
- generated$4.isFunction = isFunction;
- generated$4.isFunctionParent = isFunctionParent;
- generated$4.isPureish = isPureish;
- generated$4.isDeclaration = isDeclaration;
- generated$4.isPatternLike = isPatternLike;
- generated$4.isLVal = isLVal;
- generated$4.isTSEntityName = isTSEntityName;
- generated$4.isLiteral = isLiteral;
- generated$4.isImmutable = isImmutable$2;
- generated$4.isUserWhitespacable = isUserWhitespacable;
- generated$4.isMethod = isMethod;
- generated$4.isObjectMember = isObjectMember;
- generated$4.isProperty = isProperty;
- generated$4.isUnaryLike = isUnaryLike;
- generated$4.isPattern = isPattern;
- generated$4.isClass = isClass;
- generated$4.isModuleDeclaration = isModuleDeclaration;
- generated$4.isExportDeclaration = isExportDeclaration;
- generated$4.isModuleSpecifier = isModuleSpecifier;
- generated$4.isPrivate = isPrivate;
- generated$4.isFlow = isFlow;
- generated$4.isFlowType = isFlowType;
- generated$4.isFlowBaseAnnotation = isFlowBaseAnnotation;
- generated$4.isFlowDeclaration = isFlowDeclaration;
- generated$4.isFlowPredicate = isFlowPredicate;
- generated$4.isEnumBody = isEnumBody;
- generated$4.isEnumMember = isEnumMember;
- generated$4.isJSX = isJSX;
- generated$4.isTSTypeElement = isTSTypeElement;
- generated$4.isTSType = isTSType;
- generated$4.isTSBaseType = isTSBaseType;
- generated$4.isNumberLiteral = isNumberLiteral;
- generated$4.isRegexLiteral = isRegexLiteral;
- generated$4.isRestProperty = isRestProperty;
- generated$4.isSpreadProperty = isSpreadProperty;
- var _shallowEqual$1 = shallowEqual$1;
- function isArrayExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ArrayExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isAssignmentExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "AssignmentExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBinaryExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "BinaryExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isInterpreterDirective(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "InterpreterDirective") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDirective(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Directive") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDirectiveLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DirectiveLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBlockStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "BlockStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBreakStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "BreakStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isCallExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "CallExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isCatchClause(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "CatchClause") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isConditionalExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ConditionalExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isContinueStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ContinueStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDebuggerStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DebuggerStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDoWhileStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DoWhileStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEmptyStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EmptyStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExpressionStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ExpressionStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFile(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "File") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isForInStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ForInStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isForStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ForStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFunctionDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "FunctionDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFunctionExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "FunctionExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isIdentifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Identifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isIfStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "IfStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isLabeledStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "LabeledStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isStringLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "StringLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNumericLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "NumericLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNullLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "NullLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBooleanLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "BooleanLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isRegExpLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "RegExpLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isLogicalExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "LogicalExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isMemberExpression$1(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "MemberExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNewExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "NewExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isProgram(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Program") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectMethod(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectMethod") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isRestElement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "RestElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isReturnStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ReturnStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isSequenceExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "SequenceExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isParenthesizedExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ParenthesizedExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isSwitchCase(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "SwitchCase") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isSwitchStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "SwitchStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isThisExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ThisExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isThrowStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ThrowStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTryStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TryStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isUnaryExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "UnaryExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isUpdateExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "UpdateExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isVariableDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "VariableDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isVariableDeclarator(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "VariableDeclarator") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isWhileStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "WhileStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isWithStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "WithStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isAssignmentPattern(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "AssignmentPattern") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isArrayPattern(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ArrayPattern") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isArrowFunctionExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ArrowFunctionExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClassBody(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ClassBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClassExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ClassExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClassDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ClassDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExportAllDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ExportAllDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExportDefaultDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ExportDefaultDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExportNamedDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ExportNamedDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExportSpecifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ExportSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isForOfStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ForOfStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isImportDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ImportDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isImportDefaultSpecifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ImportDefaultSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isImportNamespaceSpecifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ImportNamespaceSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isImportSpecifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ImportSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isMetaProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "MetaProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClassMethod(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ClassMethod") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectPattern(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectPattern") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isSpreadElement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "SpreadElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isSuper(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Super") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTaggedTemplateExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TaggedTemplateExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTemplateElement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TemplateElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTemplateLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TemplateLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isYieldExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "YieldExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isAwaitExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "AwaitExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isImport(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Import") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBigIntLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "BigIntLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExportNamespaceSpecifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ExportNamespaceSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isOptionalMemberExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "OptionalMemberExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isOptionalCallExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "OptionalCallExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClassProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ClassProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClassPrivateProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ClassPrivateProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClassPrivateMethod(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ClassPrivateMethod") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPrivateName(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "PrivateName") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isAnyTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "AnyTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isArrayTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ArrayTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBooleanTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "BooleanTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBooleanLiteralTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "BooleanLiteralTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNullLiteralTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "NullLiteralTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClassImplements(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ClassImplements") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareClass(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareClass") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareFunction(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareFunction") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareInterface(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareInterface") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareModule(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareModule") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareModuleExports(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareModuleExports") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareTypeAlias(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareTypeAlias") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareOpaqueType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareOpaqueType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareVariable(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareVariable") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareExportDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareExportDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclareExportAllDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclareExportAllDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclaredPredicate(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DeclaredPredicate") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExistsTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ExistsTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFunctionTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "FunctionTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFunctionTypeParam(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "FunctionTypeParam") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isGenericTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "GenericTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isInferredPredicate(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "InferredPredicate") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isInterfaceExtends(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "InterfaceExtends") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isInterfaceDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "InterfaceDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isInterfaceTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "InterfaceTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isIntersectionTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "IntersectionTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isMixedTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "MixedTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEmptyTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EmptyTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNullableTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "NullableTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNumberLiteralTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "NumberLiteralTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNumberTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "NumberTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeInternalSlot(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectTypeInternalSlot") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeCallProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectTypeCallProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeIndexer(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectTypeIndexer") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectTypeProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeSpreadProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ObjectTypeSpreadProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isOpaqueType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "OpaqueType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isQualifiedTypeIdentifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "QualifiedTypeIdentifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isStringLiteralTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "StringLiteralTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isStringTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "StringTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isSymbolTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "SymbolTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isThisTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ThisTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTupleTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TupleTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTypeofTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TypeofTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTypeAlias(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TypeAlias") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTypeCastExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TypeCastExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTypeParameter(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TypeParameter") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTypeParameterDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TypeParameterDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTypeParameterInstantiation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TypeParameterInstantiation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isUnionTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "UnionTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isVariance(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Variance") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isVoidTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "VoidTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumBooleanBody(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumBooleanBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumNumberBody(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumNumberBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumStringBody(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumStringBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumSymbolBody(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumSymbolBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumBooleanMember(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumBooleanMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumNumberMember(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumNumberMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumStringMember(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumStringMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumDefaultedMember(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "EnumDefaultedMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isIndexedAccessType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "IndexedAccessType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isOptionalIndexedAccessType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "OptionalIndexedAccessType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXAttribute(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXAttribute") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXClosingElement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXClosingElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXElement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXEmptyExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXEmptyExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXExpressionContainer(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXExpressionContainer") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXSpreadChild(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXSpreadChild") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXIdentifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXIdentifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXMemberExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXMemberExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXNamespacedName(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXNamespacedName") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXOpeningElement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXOpeningElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXSpreadAttribute(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXSpreadAttribute") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXText(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXText") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXFragment(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXFragment") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXOpeningFragment(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXOpeningFragment") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSXClosingFragment(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "JSXClosingFragment") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNoop(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Noop") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPlaceholder(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Placeholder") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isV8IntrinsicIdentifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "V8IntrinsicIdentifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isArgumentPlaceholder(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ArgumentPlaceholder") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBindExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "BindExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isImportAttribute(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ImportAttribute") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDecorator(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "Decorator") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDoExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DoExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExportDefaultSpecifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ExportDefaultSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isRecordExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "RecordExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTupleExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TupleExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDecimalLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "DecimalLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isStaticBlock(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "StaticBlock") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isModuleExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "ModuleExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTopicReference(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TopicReference") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPipelineTopicExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "PipelineTopicExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPipelineBareFunction(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "PipelineBareFunction") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPipelinePrimaryTopicReference(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "PipelinePrimaryTopicReference") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSParameterProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSParameterProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSDeclareFunction(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSDeclareFunction") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSDeclareMethod(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSDeclareMethod") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSQualifiedName(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSQualifiedName") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSCallSignatureDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSCallSignatureDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSConstructSignatureDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSConstructSignatureDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSPropertySignature(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSPropertySignature") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSMethodSignature(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSMethodSignature") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSIndexSignature(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSIndexSignature") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSAnyKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSAnyKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSBooleanKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSBooleanKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSBigIntKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSBigIntKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSIntrinsicKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSIntrinsicKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSNeverKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSNeverKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSNullKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSNullKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSNumberKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSNumberKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSObjectKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSObjectKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSStringKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSStringKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSSymbolKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSSymbolKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSUndefinedKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSUndefinedKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSUnknownKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSUnknownKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSVoidKeyword(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSVoidKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSThisType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSThisType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSFunctionType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSFunctionType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSConstructorType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSConstructorType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeReference(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeReference") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypePredicate(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypePredicate") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeQuery(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeQuery") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSArrayType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSArrayType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTupleType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTupleType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSOptionalType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSOptionalType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSRestType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSRestType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSNamedTupleMember(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSNamedTupleMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSUnionType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSUnionType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSIntersectionType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSIntersectionType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSConditionalType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSConditionalType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSInferType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSInferType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSParenthesizedType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSParenthesizedType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeOperator(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeOperator") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSIndexedAccessType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSIndexedAccessType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSMappedType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSMappedType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSLiteralType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSLiteralType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSExpressionWithTypeArguments(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSExpressionWithTypeArguments") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSInterfaceDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSInterfaceDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSInterfaceBody(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSInterfaceBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeAliasDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeAliasDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSAsExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSAsExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeAssertion(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeAssertion") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSEnumDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSEnumDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSEnumMember(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSEnumMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSModuleDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSModuleDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSModuleBlock(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSModuleBlock") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSImportType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSImportType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSImportEqualsDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSImportEqualsDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSExternalModuleReference(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSExternalModuleReference") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSNonNullExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSNonNullExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSExportAssignment(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSExportAssignment") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSNamespaceExportDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSNamespaceExportDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeParameterInstantiation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeParameterInstantiation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeParameterDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeParameterDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeParameter(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "TSTypeParameter") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExpression(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType || "Import" === nodeType || "BigIntLiteral" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "BindExpression" === nodeType || "DoExpression" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType || "DecimalLiteral" === nodeType || "ModuleExpression" === nodeType || "TopicReference" === nodeType || "PipelineTopicExpression" === nodeType || "PipelineBareFunction" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBinary(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isScopable(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBlockParent(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "StaticBlock" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isBlock(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTerminatorless(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isCompletionStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isConditional(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isLoop(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isWhile(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExpressionWrapper(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFor(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isForXStatement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFunction(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFunctionParent(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPureish(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPatternLike(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isLVal(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSEntityName(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isLiteral(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isImmutable$2(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "BigIntLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "DecimalLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isUserWhitespacable(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isMethod(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isObjectMember(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isProperty(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isUnaryLike(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPattern(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isClass(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isModuleDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isExportDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isModuleSpecifier(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isPrivate(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFlow(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFlowType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType || "IndexedAccessType" === nodeType || "OptionalIndexedAccessType" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFlowBaseAnnotation(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "SymbolTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFlowDeclaration(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isFlowPredicate(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumBody(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isEnumMember(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isJSX(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSTypeElement(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isTSBaseType(node, opts) {
- if (!node) return false;
- const nodeType = node.type;
- if ("TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSIntrinsicKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSLiteralType" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isNumberLiteral(node, opts) {
- console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "NumberLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isRegexLiteral(node, opts) {
- console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "RegexLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isRestProperty(node, opts) {
- console.trace("The node type RestProperty has been renamed to RestElement");
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "RestProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- function isSpreadProperty(node, opts) {
- console.trace("The node type SpreadProperty has been renamed to SpreadElement");
- if (!node) return false;
- const nodeType = node.type;
- if (nodeType === "SpreadProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual$1.default)(node, opts);
- }
- }
- return false;
- }
- Object.defineProperty(matchesPattern$1, "__esModule", {
- value: true
- });
- matchesPattern$1.default = matchesPattern;
- var _generated$o = generated$4;
- function matchesPattern(member, match, allowPartial) {
- if (!(0, _generated$o.isMemberExpression)(member)) return false;
- const parts = Array.isArray(match) ? match : match.split(".");
- const nodes = [];
- let node;
- for (node = member; (0, _generated$o.isMemberExpression)(node); node = node.object) {
- nodes.push(node.property);
- }
- nodes.push(node);
- if (nodes.length < parts.length) return false;
- if (!allowPartial && nodes.length > parts.length) return false;
- for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
- const node = nodes[j];
- let value;
- if ((0, _generated$o.isIdentifier)(node)) {
- value = node.name;
- } else if ((0, _generated$o.isStringLiteral)(node)) {
- value = node.value;
- } else if ((0, _generated$o.isThisExpression)(node)) {
- value = "this";
- } else {
- return false;
- }
- if (parts[i] !== value) return false;
- }
- return true;
- }
- Object.defineProperty(buildMatchMemberExpression$1, "__esModule", {
- value: true
- });
- buildMatchMemberExpression$1.default = buildMatchMemberExpression;
- var _matchesPattern = matchesPattern$1;
- function buildMatchMemberExpression(match, allowPartial) {
- const parts = match.split(".");
- return member => (0, _matchesPattern.default)(member, parts, allowPartial);
- }
- Object.defineProperty(isReactComponent$1, "__esModule", {
- value: true
- });
- isReactComponent$1.default = void 0;
- var _buildMatchMemberExpression = buildMatchMemberExpression$1;
- const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component");
- var _default$4 = isReactComponent;
- isReactComponent$1.default = _default$4;
- var isCompatTag$1 = {};
- Object.defineProperty(isCompatTag$1, "__esModule", {
- value: true
- });
- isCompatTag$1.default = isCompatTag;
- function isCompatTag(tagName) {
- return !!tagName && /^[a-z]/.test(tagName);
- }
- var buildChildren$1 = {};
- var cleanJSXElementLiteralChild$1 = {};
- var generated$3 = {};
- var builder$1 = {};
- var definitions = {};
- var core = {};
- var is$1 = {};
- var isType$1 = {};
- Object.defineProperty(isType$1, "__esModule", {
- value: true
- });
- isType$1.default = isType;
- var _definitions$a = definitions;
- function isType(nodeType, targetType) {
- if (nodeType === targetType) return true;
- if (_definitions$a.ALIAS_KEYS[targetType]) return false;
- const aliases = _definitions$a.FLIPPED_ALIAS_KEYS[targetType];
- if (aliases) {
- if (aliases[0] === nodeType) return true;
- for (const alias of aliases) {
- if (nodeType === alias) return true;
- }
- }
- return false;
- }
- var isPlaceholderType$1 = {};
- Object.defineProperty(isPlaceholderType$1, "__esModule", {
- value: true
- });
- isPlaceholderType$1.default = isPlaceholderType;
- var _definitions$9 = definitions;
- function isPlaceholderType(placeholderType, targetType) {
- if (placeholderType === targetType) return true;
- const aliases = _definitions$9.PLACEHOLDERS_ALIAS[placeholderType];
- if (aliases) {
- for (const alias of aliases) {
- if (targetType === alias) return true;
- }
- }
- return false;
- }
- Object.defineProperty(is$1, "__esModule", {
- value: true
- });
- is$1.default = is;
- var _shallowEqual = shallowEqual$1;
- var _isType$1 = isType$1;
- var _isPlaceholderType = isPlaceholderType$1;
- var _definitions$8 = definitions;
- function is(type, node, opts) {
- if (!node) return false;
- const matches = (0, _isType$1.default)(node.type, type);
- if (!matches) {
- if (!opts && node.type === "Placeholder" && type in _definitions$8.FLIPPED_ALIAS_KEYS) {
- return (0, _isPlaceholderType.default)(node.expectedNode, type);
- }
- return false;
- }
- if (typeof opts === "undefined") {
- return true;
- } else {
- return (0, _shallowEqual.default)(node, opts);
- }
- }
- var isValidIdentifier$1 = {};
- var lib = {};
- var identifier$1 = {};
- Object.defineProperty(identifier$1, "__esModule", {
- value: true
- });
- identifier$1.isIdentifierStart = isIdentifierStart;
- identifier$1.isIdentifierChar = isIdentifierChar;
- identifier$1.isIdentifierName = isIdentifierName;
- let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
- let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
- const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
- const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
- nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
- const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 107, 20, 28, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8952, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42717, 35, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
- const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
- function isInAstralSet(code, set) {
- let pos = 0x10000;
- for (let i = 0, length = set.length; i < length; i += 2) {
- pos += set[i];
- if (pos > code) return false;
- pos += set[i + 1];
- if (pos >= code) return true;
- }
- return false;
- }
- function isIdentifierStart(code) {
- if (code < 65) return code === 36;
- if (code <= 90) return true;
- if (code < 97) return code === 95;
- if (code <= 122) return true;
- if (code <= 0xffff) {
- return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
- }
- return isInAstralSet(code, astralIdentifierStartCodes);
- }
- function isIdentifierChar(code) {
- if (code < 48) return code === 36;
- if (code < 58) return true;
- if (code < 65) return false;
- if (code <= 90) return true;
- if (code < 97) return code === 95;
- if (code <= 122) return true;
- if (code <= 0xffff) {
- return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
- }
- return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
- }
- function isIdentifierName(name) {
- let isFirst = true;
- for (let i = 0; i < name.length; i++) {
- let cp = name.charCodeAt(i);
- if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
- const trail = name.charCodeAt(++i);
- if ((trail & 0xfc00) === 0xdc00) {
- cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
- }
- }
- if (isFirst) {
- isFirst = false;
- if (!isIdentifierStart(cp)) {
- return false;
- }
- } else if (!isIdentifierChar(cp)) {
- return false;
- }
- }
- return !isFirst;
- }
- var keyword = {};
- Object.defineProperty(keyword, "__esModule", {
- value: true
- });
- keyword.isReservedWord = isReservedWord;
- keyword.isStrictReservedWord = isStrictReservedWord;
- keyword.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
- keyword.isStrictBindReservedWord = isStrictBindReservedWord;
- keyword.isKeyword = isKeyword;
- const reservedWords = {
- keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
- strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
- strictBind: ["eval", "arguments"]
- };
- const keywords = new Set(reservedWords.keyword);
- const reservedWordsStrictSet = new Set(reservedWords.strict);
- const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
- function isReservedWord(word, inModule) {
- return inModule && word === "await" || word === "enum";
- }
- function isStrictReservedWord(word, inModule) {
- return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
- }
- function isStrictBindOnlyReservedWord(word) {
- return reservedWordsStrictBindSet.has(word);
- }
- function isStrictBindReservedWord(word, inModule) {
- return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
- }
- function isKeyword(word) {
- return keywords.has(word);
- }
- (function (exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- Object.defineProperty(exports, "isIdentifierName", {
- enumerable: true,
- get: function () {
- return _identifier.isIdentifierName;
- }
- });
- Object.defineProperty(exports, "isIdentifierChar", {
- enumerable: true,
- get: function () {
- return _identifier.isIdentifierChar;
- }
- });
- Object.defineProperty(exports, "isIdentifierStart", {
- enumerable: true,
- get: function () {
- return _identifier.isIdentifierStart;
- }
- });
- Object.defineProperty(exports, "isReservedWord", {
- enumerable: true,
- get: function () {
- return _keyword.isReservedWord;
- }
- });
- Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
- enumerable: true,
- get: function () {
- return _keyword.isStrictBindOnlyReservedWord;
- }
- });
- Object.defineProperty(exports, "isStrictBindReservedWord", {
- enumerable: true,
- get: function () {
- return _keyword.isStrictBindReservedWord;
- }
- });
- Object.defineProperty(exports, "isStrictReservedWord", {
- enumerable: true,
- get: function () {
- return _keyword.isStrictReservedWord;
- }
- });
- Object.defineProperty(exports, "isKeyword", {
- enumerable: true,
- get: function () {
- return _keyword.isKeyword;
- }
- });
- var _identifier = identifier$1;
- var _keyword = keyword;
- }(lib));
- Object.defineProperty(isValidIdentifier$1, "__esModule", {
- value: true
- });
- isValidIdentifier$1.default = isValidIdentifier;
- var _helperValidatorIdentifier$2 = lib;
- function isValidIdentifier(name, reserved = true) {
- if (typeof name !== "string") return false;
- if (reserved) {
- if ((0, _helperValidatorIdentifier$2.isKeyword)(name) || (0, _helperValidatorIdentifier$2.isStrictReservedWord)(name, true)) {
- return false;
- }
- }
- return (0, _helperValidatorIdentifier$2.isIdentifierName)(name);
- }
- var constants = {};
- Object.defineProperty(constants, "__esModule", {
- value: true
- });
- constants.NOT_LOCAL_BINDING = constants.BLOCK_SCOPED_SYMBOL = constants.INHERIT_KEYS = constants.UNARY_OPERATORS = constants.STRING_UNARY_OPERATORS = constants.NUMBER_UNARY_OPERATORS = constants.BOOLEAN_UNARY_OPERATORS = constants.ASSIGNMENT_OPERATORS = constants.BINARY_OPERATORS = constants.NUMBER_BINARY_OPERATORS = constants.BOOLEAN_BINARY_OPERATORS = constants.COMPARISON_BINARY_OPERATORS = constants.EQUALITY_BINARY_OPERATORS = constants.BOOLEAN_NUMBER_BINARY_OPERATORS = constants.UPDATE_OPERATORS = constants.LOGICAL_OPERATORS = constants.COMMENT_KEYS = constants.FOR_INIT_KEYS = constants.FLATTENABLE_KEYS = constants.STATEMENT_OR_BLOCK_KEYS = void 0;
- const STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
- constants.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;
- const FLATTENABLE_KEYS = ["body", "expressions"];
- constants.FLATTENABLE_KEYS = FLATTENABLE_KEYS;
- const FOR_INIT_KEYS = ["left", "init"];
- constants.FOR_INIT_KEYS = FOR_INIT_KEYS;
- const COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
- constants.COMMENT_KEYS = COMMENT_KEYS;
- const LOGICAL_OPERATORS = ["||", "&&", "??"];
- constants.LOGICAL_OPERATORS = LOGICAL_OPERATORS;
- const UPDATE_OPERATORS = ["++", "--"];
- constants.UPDATE_OPERATORS = UPDATE_OPERATORS;
- const BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
- constants.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;
- const EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
- constants.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;
- const COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"];
- constants.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;
- const BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS];
- constants.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;
- const NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
- constants.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;
- const BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS];
- constants.BINARY_OPERATORS = BINARY_OPERATORS;
- const ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")];
- constants.ASSIGNMENT_OPERATORS = ASSIGNMENT_OPERATORS;
- const BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
- constants.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;
- const NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
- constants.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;
- const STRING_UNARY_OPERATORS = ["typeof"];
- constants.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;
- const UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS];
- constants.UNARY_OPERATORS = UNARY_OPERATORS;
- const INHERIT_KEYS = {
- optional: ["typeAnnotation", "typeParameters", "returnType"],
- force: ["start", "loc", "end"]
- };
- constants.INHERIT_KEYS = INHERIT_KEYS;
- const BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
- constants.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;
- const NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
- constants.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING;
- var utils = {};
- var validate$2 = {};
- Object.defineProperty(validate$2, "__esModule", {
- value: true
- });
- validate$2.default = validate$1;
- validate$2.validateField = validateField;
- validate$2.validateChild = validateChild;
- var _definitions$7 = definitions;
- function validate$1(node, key, val) {
- if (!node) return;
- const fields = _definitions$7.NODE_FIELDS[node.type];
- if (!fields) return;
- const field = fields[key];
- validateField(node, key, val, field);
- validateChild(node, key, val);
- }
- function validateField(node, key, val, field) {
- if (!(field != null && field.validate)) return;
- if (field.optional && val == null) return;
- field.validate(node, key, val);
- }
- function validateChild(node, key, val) {
- if (val == null) return;
- const validate = _definitions$7.NODE_PARENT_VALIDATIONS[val.type];
- if (!validate) return;
- validate(node, key, val);
- }
- Object.defineProperty(utils, "__esModule", {
- value: true
- });
- utils.validate = validate;
- utils.typeIs = typeIs;
- utils.validateType = validateType;
- utils.validateOptional = validateOptional;
- utils.validateOptionalType = validateOptionalType;
- utils.arrayOf = arrayOf;
- utils.arrayOfType = arrayOfType;
- utils.validateArrayOfType = validateArrayOfType;
- utils.assertEach = assertEach;
- utils.assertOneOf = assertOneOf;
- utils.assertNodeType = assertNodeType;
- utils.assertNodeOrValueType = assertNodeOrValueType;
- utils.assertValueType = assertValueType;
- utils.assertShape = assertShape;
- utils.assertOptionalChainStart = assertOptionalChainStart;
- utils.chain = chain;
- utils.default = defineType;
- utils.NODE_PARENT_VALIDATIONS = utils.DEPRECATED_KEYS = utils.BUILDER_KEYS = utils.NODE_FIELDS = utils.FLIPPED_ALIAS_KEYS = utils.ALIAS_KEYS = utils.VISITOR_KEYS = void 0;
- var _is$3 = is$1;
- var _validate$1 = validate$2;
- const VISITOR_KEYS = {};
- utils.VISITOR_KEYS = VISITOR_KEYS;
- const ALIAS_KEYS = {};
- utils.ALIAS_KEYS = ALIAS_KEYS;
- const FLIPPED_ALIAS_KEYS = {};
- utils.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
- const NODE_FIELDS = {};
- utils.NODE_FIELDS = NODE_FIELDS;
- const BUILDER_KEYS = {};
- utils.BUILDER_KEYS = BUILDER_KEYS;
- const DEPRECATED_KEYS = {};
- utils.DEPRECATED_KEYS = DEPRECATED_KEYS;
- const NODE_PARENT_VALIDATIONS = {};
- utils.NODE_PARENT_VALIDATIONS = NODE_PARENT_VALIDATIONS;
- function getType(val) {
- if (Array.isArray(val)) {
- return "array";
- } else if (val === null) {
- return "null";
- } else {
- return typeof val;
- }
- }
- function validate(validate) {
- return {
- validate
- };
- }
- function typeIs(typeName) {
- return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType(...typeName);
- }
- function validateType(typeName) {
- return validate(typeIs(typeName));
- }
- function validateOptional(validate) {
- return {
- validate,
- optional: true
- };
- }
- function validateOptionalType(typeName) {
- return {
- validate: typeIs(typeName),
- optional: true
- };
- }
- function arrayOf(elementType) {
- return chain(assertValueType("array"), assertEach(elementType));
- }
- function arrayOfType(typeName) {
- return arrayOf(typeIs(typeName));
- }
- function validateArrayOfType(typeName) {
- return validate(arrayOfType(typeName));
- }
- function assertEach(callback) {
- function validator(node, key, val) {
- if (!Array.isArray(val)) return;
- for (let i = 0; i < val.length; i++) {
- const subkey = `${key}[${i}]`;
- const v = val[i];
- callback(node, subkey, v);
- if (process.env.BABEL_TYPES_8_BREAKING) (0, _validate$1.validateChild)(node, subkey, v);
- }
- }
- validator.each = callback;
- return validator;
- }
- function assertOneOf(...values) {
- function validate(node, key, val) {
- if (values.indexOf(val) < 0) {
- throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`);
- }
- }
- validate.oneOf = values;
- return validate;
- }
- function assertNodeType(...types) {
- function validate(node, key, val) {
- for (const type of types) {
- if ((0, _is$3.default)(type, val)) {
- (0, _validate$1.validateChild)(node, key, val);
- return;
- }
- }
- throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
- }
- validate.oneOfNodeTypes = types;
- return validate;
- }
- function assertNodeOrValueType(...types) {
- function validate(node, key, val) {
- for (const type of types) {
- if (getType(val) === type || (0, _is$3.default)(type, val)) {
- (0, _validate$1.validateChild)(node, key, val);
- return;
- }
- }
- throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
- }
- validate.oneOfNodeOrValueTypes = types;
- return validate;
- }
- function assertValueType(type) {
- function validate(node, key, val) {
- const valid = getType(val) === type;
- if (!valid) {
- throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`);
- }
- }
- validate.type = type;
- return validate;
- }
- function assertShape(shape) {
- function validate(node, key, val) {
- const errors = [];
- for (const property of Object.keys(shape)) {
- try {
- (0, _validate$1.validateField)(node, property, val[property], shape[property]);
- } catch (error) {
- if (error instanceof TypeError) {
- errors.push(error.message);
- continue;
- }
- throw error;
- }
- }
- if (errors.length) {
- throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`);
- }
- }
- validate.shapeOf = shape;
- return validate;
- }
- function assertOptionalChainStart() {
- function validate(node) {
- var _current;
- let current = node;
- while (node) {
- const {
- type
- } = current;
- if (type === "OptionalCallExpression") {
- if (current.optional) return;
- current = current.callee;
- continue;
- }
- if (type === "OptionalMemberExpression") {
- if (current.optional) return;
- current = current.object;
- continue;
- }
- break;
- }
- throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`);
- }
- return validate;
- }
- function chain(...fns) {
- function validate(...args) {
- for (const fn of fns) {
- fn(...args);
- }
- }
- validate.chainOf = fns;
- if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) {
- throw new Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`);
- }
- return validate;
- }
- const validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"];
- const validFieldKeys = ["default", "optional", "validate"];
- function defineType(type, opts = {}) {
- const inherits = opts.inherits && store[opts.inherits] || {};
- let fields = opts.fields;
- if (!fields) {
- fields = {};
- if (inherits.fields) {
- const keys = Object.getOwnPropertyNames(inherits.fields);
- for (const key of keys) {
- const field = inherits.fields[key];
- const def = field.default;
- if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") {
- throw new Error("field defaults can only be primitives or empty arrays currently");
- }
- fields[key] = {
- default: Array.isArray(def) ? [] : def,
- optional: field.optional,
- validate: field.validate
- };
- }
- }
- }
- const visitor = opts.visitor || inherits.visitor || [];
- const aliases = opts.aliases || inherits.aliases || [];
- const builder = opts.builder || inherits.builder || opts.visitor || [];
- for (const k of Object.keys(opts)) {
- if (validTypeOpts.indexOf(k) === -1) {
- throw new Error(`Unknown type option "${k}" on ${type}`);
- }
- }
- if (opts.deprecatedAlias) {
- DEPRECATED_KEYS[opts.deprecatedAlias] = type;
- }
- for (const key of visitor.concat(builder)) {
- fields[key] = fields[key] || {};
- }
- for (const key of Object.keys(fields)) {
- const field = fields[key];
- if (field.default !== undefined && builder.indexOf(key) === -1) {
- field.optional = true;
- }
- if (field.default === undefined) {
- field.default = null;
- } else if (!field.validate && field.default != null) {
- field.validate = assertValueType(getType(field.default));
- }
- for (const k of Object.keys(field)) {
- if (validFieldKeys.indexOf(k) === -1) {
- throw new Error(`Unknown field key "${k}" on ${type}.${key}`);
- }
- }
- }
- VISITOR_KEYS[type] = opts.visitor = visitor;
- BUILDER_KEYS[type] = opts.builder = builder;
- NODE_FIELDS[type] = opts.fields = fields;
- ALIAS_KEYS[type] = opts.aliases = aliases;
- aliases.forEach(alias => {
- FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
- FLIPPED_ALIAS_KEYS[alias].push(type);
- });
- if (opts.validate) {
- NODE_PARENT_VALIDATIONS[type] = opts.validate;
- }
- store[type] = opts;
- }
- const store = {};
- Object.defineProperty(core, "__esModule", {
- value: true
- });
- core.classMethodOrDeclareMethodCommon = core.classMethodOrPropertyCommon = core.patternLikeCommon = core.functionDeclarationCommon = core.functionTypeAnnotationCommon = core.functionCommon = void 0;
- var _is$2 = is$1;
- var _isValidIdentifier$3 = isValidIdentifier$1;
- var _helperValidatorIdentifier$1 = lib;
- var _constants$5 = constants;
- var _utils$6 = utils;
- (0, _utils$6.default)("ArrayExpression", {
- fields: {
- elements: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
- default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined
- }
- },
- visitor: ["elements"],
- aliases: ["Expression"]
- });
- (0, _utils$6.default)("AssignmentExpression", {
- fields: {
- operator: {
- validate: function () {
- if (!process.env.BABEL_TYPES_8_BREAKING) {
- return (0, _utils$6.assertValueType)("string");
- }
- const identifier = (0, _utils$6.assertOneOf)(..._constants$5.ASSIGNMENT_OPERATORS);
- const pattern = (0, _utils$6.assertOneOf)("=");
- return function (node, key, val) {
- const validator = (0, _is$2.default)("Pattern", node.left) ? pattern : identifier;
- validator(node, key, val);
- };
- }()
- },
- left: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("LVal") : (0, _utils$6.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
- },
- right: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- },
- builder: ["operator", "left", "right"],
- visitor: ["left", "right"],
- aliases: ["Expression"]
- });
- (0, _utils$6.default)("BinaryExpression", {
- builder: ["operator", "left", "right"],
- fields: {
- operator: {
- validate: (0, _utils$6.assertOneOf)(..._constants$5.BINARY_OPERATORS)
- },
- left: {
- validate: function () {
- const expression = (0, _utils$6.assertNodeType)("Expression");
- const inOp = (0, _utils$6.assertNodeType)("Expression", "PrivateName");
- const validator = function (node, key, val) {
- const validator = node.operator === "in" ? inOp : expression;
- validator(node, key, val);
- };
- validator.oneOfNodeTypes = ["Expression", "PrivateName"];
- return validator;
- }()
- },
- right: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- },
- visitor: ["left", "right"],
- aliases: ["Binary", "Expression"]
- });
- (0, _utils$6.default)("InterpreterDirective", {
- builder: ["value"],
- fields: {
- value: {
- validate: (0, _utils$6.assertValueType)("string")
- }
- }
- });
- (0, _utils$6.default)("Directive", {
- visitor: ["value"],
- fields: {
- value: {
- validate: (0, _utils$6.assertNodeType)("DirectiveLiteral")
- }
- }
- });
- (0, _utils$6.default)("DirectiveLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: (0, _utils$6.assertValueType)("string")
- }
- }
- });
- (0, _utils$6.default)("BlockStatement", {
- builder: ["body", "directives"],
- visitor: ["directives", "body"],
- fields: {
- directives: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Directive"))),
- default: []
- },
- body: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
- }
- },
- aliases: ["Scopable", "BlockParent", "Block", "Statement"]
- });
- (0, _utils$6.default)("BreakStatement", {
- visitor: ["label"],
- fields: {
- label: {
- validate: (0, _utils$6.assertNodeType)("Identifier"),
- optional: true
- }
- },
- aliases: ["Statement", "Terminatorless", "CompletionStatement"]
- });
- (0, _utils$6.default)("CallExpression", {
- visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
- builder: ["callee", "arguments"],
- aliases: ["Expression"],
- fields: Object.assign({
- callee: {
- validate: (0, _utils$6.assertNodeType)("Expression", "V8IntrinsicIdentifier")
- },
- arguments: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
- }
- }, !process.env.BABEL_TYPES_8_BREAKING ? {
- optional: {
- validate: (0, _utils$6.assertOneOf)(true, false),
- optional: true
- }
- } : {}, {
- typeArguments: {
- validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation"),
- optional: true
- },
- typeParameters: {
- validate: (0, _utils$6.assertNodeType)("TSTypeParameterInstantiation"),
- optional: true
- }
- })
- });
- (0, _utils$6.default)("CatchClause", {
- visitor: ["param", "body"],
- fields: {
- param: {
- validate: (0, _utils$6.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"),
- optional: true
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("BlockStatement")
- }
- },
- aliases: ["Scopable", "BlockParent"]
- });
- (0, _utils$6.default)("ConditionalExpression", {
- visitor: ["test", "consequent", "alternate"],
- fields: {
- test: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- consequent: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- alternate: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- },
- aliases: ["Expression", "Conditional"]
- });
- (0, _utils$6.default)("ContinueStatement", {
- visitor: ["label"],
- fields: {
- label: {
- validate: (0, _utils$6.assertNodeType)("Identifier"),
- optional: true
- }
- },
- aliases: ["Statement", "Terminatorless", "CompletionStatement"]
- });
- (0, _utils$6.default)("DebuggerStatement", {
- aliases: ["Statement"]
- });
- (0, _utils$6.default)("DoWhileStatement", {
- visitor: ["test", "body"],
- fields: {
- test: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("Statement")
- }
- },
- aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
- });
- (0, _utils$6.default)("EmptyStatement", {
- aliases: ["Statement"]
- });
- (0, _utils$6.default)("ExpressionStatement", {
- visitor: ["expression"],
- fields: {
- expression: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- },
- aliases: ["Statement", "ExpressionWrapper"]
- });
- (0, _utils$6.default)("File", {
- builder: ["program", "comments", "tokens"],
- visitor: ["program"],
- fields: {
- program: {
- validate: (0, _utils$6.assertNodeType)("Program")
- },
- comments: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, {
- each: {
- oneOfNodeTypes: ["CommentBlock", "CommentLine"]
- }
- }) : (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("CommentBlock", "CommentLine")),
- optional: true
- },
- tokens: {
- validate: (0, _utils$6.assertEach)(Object.assign(() => {}, {
- type: "any"
- })),
- optional: true
- }
- }
- });
- (0, _utils$6.default)("ForInStatement", {
- visitor: ["left", "right", "body"],
- aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
- fields: {
- left: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils$6.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
- },
- right: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("Statement")
- }
- }
- });
- (0, _utils$6.default)("ForStatement", {
- visitor: ["init", "test", "update", "body"],
- aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
- fields: {
- init: {
- validate: (0, _utils$6.assertNodeType)("VariableDeclaration", "Expression"),
- optional: true
- },
- test: {
- validate: (0, _utils$6.assertNodeType)("Expression"),
- optional: true
- },
- update: {
- validate: (0, _utils$6.assertNodeType)("Expression"),
- optional: true
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("Statement")
- }
- }
- });
- const functionCommon = {
- params: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Identifier", "Pattern", "RestElement")))
- },
- generator: {
- default: false
- },
- async: {
- default: false
- }
- };
- core.functionCommon = functionCommon;
- const functionTypeAnnotationCommon = {
- returnType: {
- validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
- optional: true
- },
- typeParameters: {
- validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
- optional: true
- }
- };
- core.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
- const functionDeclarationCommon = Object.assign({}, functionCommon, {
- declare: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- id: {
- validate: (0, _utils$6.assertNodeType)("Identifier"),
- optional: true
- }
- });
- core.functionDeclarationCommon = functionDeclarationCommon;
- (0, _utils$6.default)("FunctionDeclaration", {
- builder: ["id", "params", "body", "generator", "async"],
- visitor: ["id", "params", "body", "returnType", "typeParameters"],
- fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {
- body: {
- validate: (0, _utils$6.assertNodeType)("BlockStatement")
- }
- }),
- aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"],
- validate: function () {
- if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};
- const identifier = (0, _utils$6.assertNodeType)("Identifier");
- return function (parent, key, node) {
- if (!(0, _is$2.default)("ExportDefaultDeclaration", parent)) {
- identifier(node, "id", node.id);
- }
- };
- }()
- });
- (0, _utils$6.default)("FunctionExpression", {
- inherits: "FunctionDeclaration",
- aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
- fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
- id: {
- validate: (0, _utils$6.assertNodeType)("Identifier"),
- optional: true
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("BlockStatement")
- }
- })
- });
- const patternLikeCommon = {
- typeAnnotation: {
- validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
- optional: true
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator")))
- }
- };
- core.patternLikeCommon = patternLikeCommon;
- (0, _utils$6.default)("Identifier", {
- builder: ["name"],
- visitor: ["typeAnnotation", "decorators"],
- aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
- fields: Object.assign({}, patternLikeCommon, {
- name: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), Object.assign(function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (!(0, _isValidIdentifier$3.default)(val, false)) {
- throw new TypeError(`"${val}" is not a valid identifier name`);
- }
- }, {
- type: "string"
- }))
- },
- optional: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- }
- }),
- validate(parent, key, node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- const match = /\.(\w+)$/.exec(key);
- if (!match) return;
- const [, parentKey] = match;
- const nonComp = {
- computed: false
- };
- if (parentKey === "property") {
- if ((0, _is$2.default)("MemberExpression", parent, nonComp)) return;
- if ((0, _is$2.default)("OptionalMemberExpression", parent, nonComp)) return;
- } else if (parentKey === "key") {
- if ((0, _is$2.default)("Property", parent, nonComp)) return;
- if ((0, _is$2.default)("Method", parent, nonComp)) return;
- } else if (parentKey === "exported") {
- if ((0, _is$2.default)("ExportSpecifier", parent)) return;
- } else if (parentKey === "imported") {
- if ((0, _is$2.default)("ImportSpecifier", parent, {
- imported: node
- })) return;
- } else if (parentKey === "meta") {
- if ((0, _is$2.default)("MetaProperty", parent, {
- meta: node
- })) return;
- }
- if (((0, _helperValidatorIdentifier$1.isKeyword)(node.name) || (0, _helperValidatorIdentifier$1.isReservedWord)(node.name, false)) && node.name !== "this") {
- throw new TypeError(`"${node.name}" is not a valid identifier`);
- }
- }
- });
- (0, _utils$6.default)("IfStatement", {
- visitor: ["test", "consequent", "alternate"],
- aliases: ["Statement", "Conditional"],
- fields: {
- test: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- consequent: {
- validate: (0, _utils$6.assertNodeType)("Statement")
- },
- alternate: {
- optional: true,
- validate: (0, _utils$6.assertNodeType)("Statement")
- }
- }
- });
- (0, _utils$6.default)("LabeledStatement", {
- visitor: ["label", "body"],
- aliases: ["Statement"],
- fields: {
- label: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("Statement")
- }
- }
- });
- (0, _utils$6.default)("StringLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: (0, _utils$6.assertValueType)("string")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- (0, _utils$6.default)("NumericLiteral", {
- builder: ["value"],
- deprecatedAlias: "NumberLiteral",
- fields: {
- value: {
- validate: (0, _utils$6.assertValueType)("number")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- (0, _utils$6.default)("NullLiteral", {
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- (0, _utils$6.default)("BooleanLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: (0, _utils$6.assertValueType)("boolean")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- (0, _utils$6.default)("RegExpLiteral", {
- builder: ["pattern", "flags"],
- deprecatedAlias: "RegexLiteral",
- aliases: ["Expression", "Pureish", "Literal"],
- fields: {
- pattern: {
- validate: (0, _utils$6.assertValueType)("string")
- },
- flags: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), Object.assign(function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- const invalid = /[^gimsuy]/.exec(val);
- if (invalid) {
- throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`);
- }
- }, {
- type: "string"
- })),
- default: ""
- }
- }
- });
- (0, _utils$6.default)("LogicalExpression", {
- builder: ["operator", "left", "right"],
- visitor: ["left", "right"],
- aliases: ["Binary", "Expression"],
- fields: {
- operator: {
- validate: (0, _utils$6.assertOneOf)(..._constants$5.LOGICAL_OPERATORS)
- },
- left: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- right: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$6.default)("MemberExpression", {
- builder: ["object", "property", "computed", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["optional"] : [])],
- visitor: ["object", "property"],
- aliases: ["Expression", "LVal"],
- fields: Object.assign({
- object: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- property: {
- validate: function () {
- const normal = (0, _utils$6.assertNodeType)("Identifier", "PrivateName");
- const computed = (0, _utils$6.assertNodeType)("Expression");
- const validator = function (node, key, val) {
- const validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"];
- return validator;
- }()
- },
- computed: {
- default: false
- }
- }, !process.env.BABEL_TYPES_8_BREAKING ? {
- optional: {
- validate: (0, _utils$6.assertOneOf)(true, false),
- optional: true
- }
- } : {})
- });
- (0, _utils$6.default)("NewExpression", {
- inherits: "CallExpression"
- });
- (0, _utils$6.default)("Program", {
- visitor: ["directives", "body"],
- builder: ["body", "directives", "sourceType", "interpreter"],
- fields: {
- sourceFile: {
- validate: (0, _utils$6.assertValueType)("string")
- },
- sourceType: {
- validate: (0, _utils$6.assertOneOf)("script", "module"),
- default: "script"
- },
- interpreter: {
- validate: (0, _utils$6.assertNodeType)("InterpreterDirective"),
- default: null,
- optional: true
- },
- directives: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Directive"))),
- default: []
- },
- body: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
- }
- },
- aliases: ["Scopable", "BlockParent", "Block"]
- });
- (0, _utils$6.default)("ObjectExpression", {
- visitor: ["properties"],
- aliases: ["Expression"],
- fields: {
- properties: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
- }
- }
- });
- (0, _utils$6.default)("ObjectMethod", {
- builder: ["kind", "key", "params", "body", "computed", "generator", "async"],
- fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
- kind: Object.assign({
- validate: (0, _utils$6.assertOneOf)("method", "get", "set")
- }, !process.env.BABEL_TYPES_8_BREAKING ? {
- default: "method"
- } : {}),
- computed: {
- default: false
- },
- key: {
- validate: function () {
- const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
- const computed = (0, _utils$6.assertNodeType)("Expression");
- const validator = function (node, key, val) {
- const validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
- return validator;
- }()
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("BlockStatement")
- }
- }),
- visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
- aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
- });
- (0, _utils$6.default)("ObjectProperty", {
- builder: ["key", "value", "computed", "shorthand", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])],
- fields: {
- computed: {
- default: false
- },
- key: {
- validate: function () {
- const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
- const computed = (0, _utils$6.assertNodeType)("Expression");
- const validator = function (node, key, val) {
- const validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral"];
- return validator;
- }()
- },
- value: {
- validate: (0, _utils$6.assertNodeType)("Expression", "PatternLike")
- },
- shorthand: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), Object.assign(function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && node.computed) {
- throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
- }
- }, {
- type: "boolean"
- }), function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && !(0, _is$2.default)("Identifier", node.key)) {
- throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
- }
- }),
- default: false
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- }
- },
- visitor: ["key", "value", "decorators"],
- aliases: ["UserWhitespacable", "Property", "ObjectMember"],
- validate: function () {
- const pattern = (0, _utils$6.assertNodeType)("Identifier", "Pattern");
- const expression = (0, _utils$6.assertNodeType)("Expression");
- return function (parent, key, node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- const validator = (0, _is$2.default)("ObjectPattern", parent) ? pattern : expression;
- validator(node, "value", node.value);
- };
- }()
- });
- (0, _utils$6.default)("RestElement", {
- visitor: ["argument", "typeAnnotation"],
- builder: ["argument"],
- aliases: ["LVal", "PatternLike"],
- deprecatedAlias: "RestProperty",
- fields: Object.assign({}, patternLikeCommon, {
- argument: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("LVal") : (0, _utils$6.assertNodeType)("Identifier", "Pattern", "MemberExpression")
- },
- optional: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- }
- }),
- validate(parent, key) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- const match = /(\w+)\[(\d+)\]/.exec(key);
- if (!match) throw new Error("Internal Babel error: malformed key.");
- const [, listKey, index] = match;
- if (parent[listKey].length > index + 1) {
- throw new TypeError(`RestElement must be last element of ${listKey}`);
- }
- }
- });
- (0, _utils$6.default)("ReturnStatement", {
- visitor: ["argument"],
- aliases: ["Statement", "Terminatorless", "CompletionStatement"],
- fields: {
- argument: {
- validate: (0, _utils$6.assertNodeType)("Expression"),
- optional: true
- }
- }
- });
- (0, _utils$6.default)("SequenceExpression", {
- visitor: ["expressions"],
- fields: {
- expressions: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression")))
- }
- },
- aliases: ["Expression"]
- });
- (0, _utils$6.default)("ParenthesizedExpression", {
- visitor: ["expression"],
- aliases: ["Expression", "ExpressionWrapper"],
- fields: {
- expression: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$6.default)("SwitchCase", {
- visitor: ["test", "consequent"],
- fields: {
- test: {
- validate: (0, _utils$6.assertNodeType)("Expression"),
- optional: true
- },
- consequent: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Statement")))
- }
- }
- });
- (0, _utils$6.default)("SwitchStatement", {
- visitor: ["discriminant", "cases"],
- aliases: ["Statement", "BlockParent", "Scopable"],
- fields: {
- discriminant: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- cases: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("SwitchCase")))
- }
- }
- });
- (0, _utils$6.default)("ThisExpression", {
- aliases: ["Expression"]
- });
- (0, _utils$6.default)("ThrowStatement", {
- visitor: ["argument"],
- aliases: ["Statement", "Terminatorless", "CompletionStatement"],
- fields: {
- argument: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$6.default)("TryStatement", {
- visitor: ["block", "handler", "finalizer"],
- aliases: ["Statement"],
- fields: {
- block: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("BlockStatement"), Object.assign(function (node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (!node.handler && !node.finalizer) {
- throw new TypeError("TryStatement expects either a handler or finalizer, or both");
- }
- }, {
- oneOfNodeTypes: ["BlockStatement"]
- }))
- },
- handler: {
- optional: true,
- validate: (0, _utils$6.assertNodeType)("CatchClause")
- },
- finalizer: {
- optional: true,
- validate: (0, _utils$6.assertNodeType)("BlockStatement")
- }
- }
- });
- (0, _utils$6.default)("UnaryExpression", {
- builder: ["operator", "argument", "prefix"],
- fields: {
- prefix: {
- default: true
- },
- argument: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- operator: {
- validate: (0, _utils$6.assertOneOf)(..._constants$5.UNARY_OPERATORS)
- }
- },
- visitor: ["argument"],
- aliases: ["UnaryLike", "Expression"]
- });
- (0, _utils$6.default)("UpdateExpression", {
- builder: ["operator", "argument", "prefix"],
- fields: {
- prefix: {
- default: false
- },
- argument: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertNodeType)("Expression") : (0, _utils$6.assertNodeType)("Identifier", "MemberExpression")
- },
- operator: {
- validate: (0, _utils$6.assertOneOf)(..._constants$5.UPDATE_OPERATORS)
- }
- },
- visitor: ["argument"],
- aliases: ["Expression"]
- });
- (0, _utils$6.default)("VariableDeclaration", {
- builder: ["kind", "declarations"],
- visitor: ["declarations"],
- aliases: ["Statement", "Declaration"],
- fields: {
- declare: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- kind: {
- validate: (0, _utils$6.assertOneOf)("var", "let", "const")
- },
- declarations: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("VariableDeclarator")))
- }
- },
- validate(parent, key, node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (!(0, _is$2.default)("ForXStatement", parent, {
- left: node
- })) return;
- if (node.declarations.length !== 1) {
- throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`);
- }
- }
- });
- (0, _utils$6.default)("VariableDeclarator", {
- visitor: ["id", "init"],
- fields: {
- id: {
- validate: function () {
- if (!process.env.BABEL_TYPES_8_BREAKING) {
- return (0, _utils$6.assertNodeType)("LVal");
- }
- const normal = (0, _utils$6.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern");
- const without = (0, _utils$6.assertNodeType)("Identifier");
- return function (node, key, val) {
- const validator = node.init ? normal : without;
- validator(node, key, val);
- };
- }()
- },
- definite: {
- optional: true,
- validate: (0, _utils$6.assertValueType)("boolean")
- },
- init: {
- optional: true,
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$6.default)("WhileStatement", {
- visitor: ["test", "body"],
- aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
- fields: {
- test: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("Statement")
- }
- }
- });
- (0, _utils$6.default)("WithStatement", {
- visitor: ["object", "body"],
- aliases: ["Statement"],
- fields: {
- object: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("Statement")
- }
- }
- });
- (0, _utils$6.default)("AssignmentPattern", {
- visitor: ["left", "right", "decorators"],
- builder: ["left", "right"],
- aliases: ["Pattern", "PatternLike", "LVal"],
- fields: Object.assign({}, patternLikeCommon, {
- left: {
- validate: (0, _utils$6.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
- },
- right: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- }
- })
- });
- (0, _utils$6.default)("ArrayPattern", {
- visitor: ["elements", "typeAnnotation"],
- builder: ["elements"],
- aliases: ["Pattern", "PatternLike", "LVal"],
- fields: Object.assign({}, patternLikeCommon, {
- elements: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeOrValueType)("null", "PatternLike")))
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- },
- optional: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- }
- })
- });
- (0, _utils$6.default)("ArrowFunctionExpression", {
- builder: ["params", "body", "async"],
- visitor: ["params", "body", "returnType", "typeParameters"],
- aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
- fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
- expression: {
- validate: (0, _utils$6.assertValueType)("boolean")
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("BlockStatement", "Expression")
- }
- })
- });
- (0, _utils$6.default)("ClassBody", {
- visitor: ["body"],
- fields: {
- body: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
- }
- }
- });
- (0, _utils$6.default)("ClassExpression", {
- builder: ["id", "superClass", "body", "decorators"],
- visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
- aliases: ["Scopable", "Class", "Expression"],
- fields: {
- id: {
- validate: (0, _utils$6.assertNodeType)("Identifier"),
- optional: true
- },
- typeParameters: {
- validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
- optional: true
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("ClassBody")
- },
- superClass: {
- optional: true,
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- superTypeParameters: {
- validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
- optional: true
- },
- implements: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
- optional: true
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- },
- mixins: {
- validate: (0, _utils$6.assertNodeType)("InterfaceExtends"),
- optional: true
- }
- }
- });
- (0, _utils$6.default)("ClassDeclaration", {
- inherits: "ClassExpression",
- aliases: ["Scopable", "Class", "Statement", "Declaration"],
- fields: {
- id: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- },
- typeParameters: {
- validate: (0, _utils$6.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
- optional: true
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("ClassBody")
- },
- superClass: {
- optional: true,
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- superTypeParameters: {
- validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
- optional: true
- },
- implements: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
- optional: true
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- },
- mixins: {
- validate: (0, _utils$6.assertNodeType)("InterfaceExtends"),
- optional: true
- },
- declare: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- abstract: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- }
- },
- validate: function () {
- const identifier = (0, _utils$6.assertNodeType)("Identifier");
- return function (parent, key, node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (!(0, _is$2.default)("ExportDefaultDeclaration", parent)) {
- identifier(node, "id", node.id);
- }
- };
- }()
- });
- (0, _utils$6.default)("ExportAllDeclaration", {
- visitor: ["source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- source: {
- validate: (0, _utils$6.assertNodeType)("StringLiteral")
- },
- exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("type", "value")),
- assertions: {
- optional: true,
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
- }
- }
- });
- (0, _utils$6.default)("ExportDefaultDeclaration", {
- visitor: ["declaration"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- declaration: {
- validate: (0, _utils$6.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
- },
- exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("value"))
- }
- });
- (0, _utils$6.default)("ExportNamedDeclaration", {
- visitor: ["declaration", "specifiers", "source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- declaration: {
- optional: true,
- validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("Declaration"), Object.assign(function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && node.specifiers.length) {
- throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
- }
- }, {
- oneOfNodeTypes: ["Declaration"]
- }), function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && node.source) {
- throw new TypeError("Cannot export a declaration from a source");
- }
- })
- },
- assertions: {
- optional: true,
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
- },
- specifiers: {
- default: [],
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)(function () {
- const sourced = (0, _utils$6.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
- const sourceless = (0, _utils$6.assertNodeType)("ExportSpecifier");
- if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;
- return function (node, key, val) {
- const validator = node.source ? sourced : sourceless;
- validator(node, key, val);
- };
- }()))
- },
- source: {
- validate: (0, _utils$6.assertNodeType)("StringLiteral"),
- optional: true
- },
- exportKind: (0, _utils$6.validateOptional)((0, _utils$6.assertOneOf)("type", "value"))
- }
- });
- (0, _utils$6.default)("ExportSpecifier", {
- visitor: ["local", "exported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- },
- exported: {
- validate: (0, _utils$6.assertNodeType)("Identifier", "StringLiteral")
- }
- }
- });
- (0, _utils$6.default)("ForOfStatement", {
- visitor: ["left", "right", "body"],
- builder: ["left", "right", "body", "await"],
- aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
- fields: {
- left: {
- validate: function () {
- if (!process.env.BABEL_TYPES_8_BREAKING) {
- return (0, _utils$6.assertNodeType)("VariableDeclaration", "LVal");
- }
- const declaration = (0, _utils$6.assertNodeType)("VariableDeclaration");
- const lval = (0, _utils$6.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
- return function (node, key, val) {
- if ((0, _is$2.default)("VariableDeclaration", val)) {
- declaration(node, key, val);
- } else {
- lval(node, key, val);
- }
- };
- }()
- },
- right: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("Statement")
- },
- await: {
- default: false
- }
- }
- });
- (0, _utils$6.default)("ImportDeclaration", {
- visitor: ["specifiers", "source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration"],
- fields: {
- assertions: {
- optional: true,
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportAttribute")))
- },
- specifiers: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
- },
- source: {
- validate: (0, _utils$6.assertNodeType)("StringLiteral")
- },
- importKind: {
- validate: (0, _utils$6.assertOneOf)("type", "typeof", "value"),
- optional: true
- }
- }
- });
- (0, _utils$6.default)("ImportDefaultSpecifier", {
- visitor: ["local"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- }
- }
- });
- (0, _utils$6.default)("ImportNamespaceSpecifier", {
- visitor: ["local"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- }
- }
- });
- (0, _utils$6.default)("ImportSpecifier", {
- visitor: ["local", "imported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- },
- imported: {
- validate: (0, _utils$6.assertNodeType)("Identifier", "StringLiteral")
- },
- importKind: {
- validate: (0, _utils$6.assertOneOf)("type", "typeof"),
- optional: true
- }
- }
- });
- (0, _utils$6.default)("MetaProperty", {
- visitor: ["meta", "property"],
- aliases: ["Expression"],
- fields: {
- meta: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertNodeType)("Identifier"), Object.assign(function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- let property;
- switch (val.name) {
- case "function":
- property = "sent";
- break;
- case "new":
- property = "target";
- break;
- case "import":
- property = "meta";
- break;
- }
- if (!(0, _is$2.default)("Identifier", node.property, {
- name: property
- })) {
- throw new TypeError("Unrecognised MetaProperty");
- }
- }, {
- oneOfNodeTypes: ["Identifier"]
- }))
- },
- property: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- }
- }
- });
- const classMethodOrPropertyCommon = {
- abstract: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- accessibility: {
- validate: (0, _utils$6.assertOneOf)("public", "private", "protected"),
- optional: true
- },
- static: {
- default: false
- },
- override: {
- default: false
- },
- computed: {
- default: false
- },
- optional: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- key: {
- validate: (0, _utils$6.chain)(function () {
- const normal = (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
- const computed = (0, _utils$6.assertNodeType)("Expression");
- return function (node, key, val) {
- const validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- }(), (0, _utils$6.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
- }
- };
- core.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
- const classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, classMethodOrPropertyCommon, {
- params: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
- },
- kind: {
- validate: (0, _utils$6.assertOneOf)("get", "set", "method", "constructor"),
- default: "method"
- },
- access: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("string"), (0, _utils$6.assertOneOf)("public", "private", "protected")),
- optional: true
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- }
- });
- core.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
- (0, _utils$6.default)("ClassMethod", {
- aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
- builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"],
- visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
- fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
- body: {
- validate: (0, _utils$6.assertNodeType)("BlockStatement")
- }
- })
- });
- (0, _utils$6.default)("ObjectPattern", {
- visitor: ["properties", "typeAnnotation", "decorators"],
- builder: ["properties"],
- aliases: ["Pattern", "PatternLike", "LVal"],
- fields: Object.assign({}, patternLikeCommon, {
- properties: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("RestElement", "ObjectProperty")))
- }
- })
- });
- (0, _utils$6.default)("SpreadElement", {
- visitor: ["argument"],
- aliases: ["UnaryLike"],
- deprecatedAlias: "SpreadProperty",
- fields: {
- argument: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$6.default)("Super", {
- aliases: ["Expression"]
- });
- (0, _utils$6.default)("TaggedTemplateExpression", {
- visitor: ["tag", "quasi", "typeParameters"],
- builder: ["tag", "quasi"],
- aliases: ["Expression"],
- fields: {
- tag: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- quasi: {
- validate: (0, _utils$6.assertNodeType)("TemplateLiteral")
- },
- typeParameters: {
- validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
- optional: true
- }
- }
- });
- (0, _utils$6.default)("TemplateElement", {
- builder: ["value", "tail"],
- fields: {
- value: {
- validate: (0, _utils$6.assertShape)({
- raw: {
- validate: (0, _utils$6.assertValueType)("string")
- },
- cooked: {
- validate: (0, _utils$6.assertValueType)("string"),
- optional: true
- }
- })
- },
- tail: {
- default: false
- }
- }
- });
- (0, _utils$6.default)("TemplateLiteral", {
- visitor: ["quasis", "expressions"],
- aliases: ["Expression", "Literal"],
- fields: {
- quasis: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("TemplateElement")))
- },
- expressions: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "TSType")), function (node, key, val) {
- if (node.quasis.length !== val.length + 1) {
- throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`);
- }
- })
- }
- }
- });
- (0, _utils$6.default)("YieldExpression", {
- builder: ["argument", "delegate"],
- visitor: ["argument"],
- aliases: ["Expression", "Terminatorless"],
- fields: {
- delegate: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), Object.assign(function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && !node.argument) {
- throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
- }
- }, {
- type: "boolean"
- })),
- default: false
- },
- argument: {
- optional: true,
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$6.default)("AwaitExpression", {
- builder: ["argument"],
- visitor: ["argument"],
- aliases: ["Expression", "Terminatorless"],
- fields: {
- argument: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$6.default)("Import", {
- aliases: ["Expression"]
- });
- (0, _utils$6.default)("BigIntLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: (0, _utils$6.assertValueType)("string")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- (0, _utils$6.default)("ExportNamespaceSpecifier", {
- visitor: ["exported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- exported: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- }
- }
- });
- (0, _utils$6.default)("OptionalMemberExpression", {
- builder: ["object", "property", "computed", "optional"],
- visitor: ["object", "property"],
- aliases: ["Expression"],
- fields: {
- object: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- property: {
- validate: function () {
- const normal = (0, _utils$6.assertNodeType)("Identifier");
- const computed = (0, _utils$6.assertNodeType)("Expression");
- const validator = function (node, key, val) {
- const validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- validator.oneOfNodeTypes = ["Expression", "Identifier"];
- return validator;
- }()
- },
- computed: {
- default: false
- },
- optional: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertValueType)("boolean") : (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), (0, _utils$6.assertOptionalChainStart)())
- }
- }
- });
- (0, _utils$6.default)("OptionalCallExpression", {
- visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
- builder: ["callee", "arguments", "optional"],
- aliases: ["Expression"],
- fields: {
- callee: {
- validate: (0, _utils$6.assertNodeType)("Expression")
- },
- arguments: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
- },
- optional: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils$6.assertValueType)("boolean") : (0, _utils$6.chain)((0, _utils$6.assertValueType)("boolean"), (0, _utils$6.assertOptionalChainStart)())
- },
- typeArguments: {
- validate: (0, _utils$6.assertNodeType)("TypeParameterInstantiation"),
- optional: true
- },
- typeParameters: {
- validate: (0, _utils$6.assertNodeType)("TSTypeParameterInstantiation"),
- optional: true
- }
- }
- });
- (0, _utils$6.default)("ClassProperty", {
- visitor: ["key", "value", "typeAnnotation", "decorators"],
- builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
- aliases: ["Property"],
- fields: Object.assign({}, classMethodOrPropertyCommon, {
- value: {
- validate: (0, _utils$6.assertNodeType)("Expression"),
- optional: true
- },
- definite: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- typeAnnotation: {
- validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
- optional: true
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- },
- readonly: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- declare: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- variance: {
- validate: (0, _utils$6.assertNodeType)("Variance"),
- optional: true
- }
- })
- });
- (0, _utils$6.default)("ClassPrivateProperty", {
- visitor: ["key", "value", "decorators", "typeAnnotation"],
- builder: ["key", "value", "decorators", "static"],
- aliases: ["Property", "Private"],
- fields: {
- key: {
- validate: (0, _utils$6.assertNodeType)("PrivateName")
- },
- value: {
- validate: (0, _utils$6.assertNodeType)("Expression"),
- optional: true
- },
- typeAnnotation: {
- validate: (0, _utils$6.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
- optional: true
- },
- decorators: {
- validate: (0, _utils$6.chain)((0, _utils$6.assertValueType)("array"), (0, _utils$6.assertEach)((0, _utils$6.assertNodeType)("Decorator"))),
- optional: true
- },
- readonly: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- definite: {
- validate: (0, _utils$6.assertValueType)("boolean"),
- optional: true
- },
- variance: {
- validate: (0, _utils$6.assertNodeType)("Variance"),
- optional: true
- }
- }
- });
- (0, _utils$6.default)("ClassPrivateMethod", {
- builder: ["kind", "key", "params", "body", "static"],
- visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
- aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
- fields: Object.assign({}, classMethodOrDeclareMethodCommon, functionTypeAnnotationCommon, {
- key: {
- validate: (0, _utils$6.assertNodeType)("PrivateName")
- },
- body: {
- validate: (0, _utils$6.assertNodeType)("BlockStatement")
- }
- })
- });
- (0, _utils$6.default)("PrivateName", {
- visitor: ["id"],
- aliases: ["Private"],
- fields: {
- id: {
- validate: (0, _utils$6.assertNodeType)("Identifier")
- }
- }
- });
- var _utils$5 = utils;
- const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => {
- (0, _utils$5.default)(name, {
- builder: ["id", "typeParameters", "extends", "body"],
- visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- typeParameters: (0, _utils$5.validateOptionalType)(typeParameterType),
- extends: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
- mixins: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
- implements: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ClassImplements")),
- body: (0, _utils$5.validateType)("ObjectTypeAnnotation")
- }
- });
- };
- (0, _utils$5.default)("AnyTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("ArrayTypeAnnotation", {
- visitor: ["elementType"],
- aliases: ["Flow", "FlowType"],
- fields: {
- elementType: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("BooleanTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("BooleanLiteralTypeAnnotation", {
- builder: ["value"],
- aliases: ["Flow", "FlowType"],
- fields: {
- value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("NullLiteralTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("ClassImplements", {
- visitor: ["id", "typeParameters"],
- aliases: ["Flow"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
- }
- });
- defineInterfaceishType("DeclareClass");
- (0, _utils$5.default)("DeclareFunction", {
- visitor: ["id"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- predicate: (0, _utils$5.validateOptionalType)("DeclaredPredicate")
- }
- });
- defineInterfaceishType("DeclareInterface");
- (0, _utils$5.default)("DeclareModule", {
- builder: ["id", "body", "kind"],
- visitor: ["id", "body"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: (0, _utils$5.validateType)(["Identifier", "StringLiteral"]),
- body: (0, _utils$5.validateType)("BlockStatement"),
- kind: (0, _utils$5.validateOptional)((0, _utils$5.assertOneOf)("CommonJS", "ES"))
- }
- });
- (0, _utils$5.default)("DeclareModuleExports", {
- visitor: ["typeAnnotation"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- typeAnnotation: (0, _utils$5.validateType)("TypeAnnotation")
- }
- });
- (0, _utils$5.default)("DeclareTypeAlias", {
- visitor: ["id", "typeParameters", "right"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
- right: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("DeclareOpaqueType", {
- visitor: ["id", "typeParameters", "supertype"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
- supertype: (0, _utils$5.validateOptionalType)("FlowType"),
- impltype: (0, _utils$5.validateOptionalType)("FlowType")
- }
- });
- (0, _utils$5.default)("DeclareVariable", {
- visitor: ["id"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier")
- }
- });
- (0, _utils$5.default)("DeclareExportDeclaration", {
- visitor: ["declaration", "specifiers", "source"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- declaration: (0, _utils$5.validateOptionalType)("Flow"),
- specifiers: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])),
- source: (0, _utils$5.validateOptionalType)("StringLiteral"),
- default: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("DeclareExportAllDeclaration", {
- visitor: ["source"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- source: (0, _utils$5.validateType)("StringLiteral"),
- exportKind: (0, _utils$5.validateOptional)((0, _utils$5.assertOneOf)("type", "value"))
- }
- });
- (0, _utils$5.default)("DeclaredPredicate", {
- visitor: ["value"],
- aliases: ["Flow", "FlowPredicate"],
- fields: {
- value: (0, _utils$5.validateType)("Flow")
- }
- });
- (0, _utils$5.default)("ExistsTypeAnnotation", {
- aliases: ["Flow", "FlowType"]
- });
- (0, _utils$5.default)("FunctionTypeAnnotation", {
- visitor: ["typeParameters", "params", "rest", "returnType"],
- aliases: ["Flow", "FlowType"],
- fields: {
- typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
- params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FunctionTypeParam")),
- rest: (0, _utils$5.validateOptionalType)("FunctionTypeParam"),
- this: (0, _utils$5.validateOptionalType)("FunctionTypeParam"),
- returnType: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("FunctionTypeParam", {
- visitor: ["name", "typeAnnotation"],
- aliases: ["Flow"],
- fields: {
- name: (0, _utils$5.validateOptionalType)("Identifier"),
- typeAnnotation: (0, _utils$5.validateType)("FlowType"),
- optional: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("GenericTypeAnnotation", {
- visitor: ["id", "typeParameters"],
- aliases: ["Flow", "FlowType"],
- fields: {
- id: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
- typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
- }
- });
- (0, _utils$5.default)("InferredPredicate", {
- aliases: ["Flow", "FlowPredicate"]
- });
- (0, _utils$5.default)("InterfaceExtends", {
- visitor: ["id", "typeParameters"],
- aliases: ["Flow"],
- fields: {
- id: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"]),
- typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterInstantiation")
- }
- });
- defineInterfaceishType("InterfaceDeclaration");
- (0, _utils$5.default)("InterfaceTypeAnnotation", {
- visitor: ["extends", "body"],
- aliases: ["Flow", "FlowType"],
- fields: {
- extends: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("InterfaceExtends")),
- body: (0, _utils$5.validateType)("ObjectTypeAnnotation")
- }
- });
- (0, _utils$5.default)("IntersectionTypeAnnotation", {
- visitor: ["types"],
- aliases: ["Flow", "FlowType"],
- fields: {
- types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
- }
- });
- (0, _utils$5.default)("MixedTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("EmptyTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("NullableTypeAnnotation", {
- visitor: ["typeAnnotation"],
- aliases: ["Flow", "FlowType"],
- fields: {
- typeAnnotation: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("NumberLiteralTypeAnnotation", {
- builder: ["value"],
- aliases: ["Flow", "FlowType"],
- fields: {
- value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("number"))
- }
- });
- (0, _utils$5.default)("NumberTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("ObjectTypeAnnotation", {
- visitor: ["properties", "indexers", "callProperties", "internalSlots"],
- aliases: ["Flow", "FlowType"],
- builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
- fields: {
- properties: (0, _utils$5.validate)((0, _utils$5.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])),
- indexers: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeIndexer")),
- callProperties: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeCallProperty")),
- internalSlots: (0, _utils$5.validateOptional)((0, _utils$5.arrayOfType)("ObjectTypeInternalSlot")),
- exact: {
- validate: (0, _utils$5.assertValueType)("boolean"),
- default: false
- },
- inexact: (0, _utils$5.validateOptional)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("ObjectTypeInternalSlot", {
- visitor: ["id", "value", "optional", "static", "method"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- value: (0, _utils$5.validateType)("FlowType"),
- optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- method: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("ObjectTypeCallProperty", {
- visitor: ["value"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- value: (0, _utils$5.validateType)("FlowType"),
- static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("ObjectTypeIndexer", {
- visitor: ["id", "key", "value", "variance"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- id: (0, _utils$5.validateOptionalType)("Identifier"),
- key: (0, _utils$5.validateType)("FlowType"),
- value: (0, _utils$5.validateType)("FlowType"),
- static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- variance: (0, _utils$5.validateOptionalType)("Variance")
- }
- });
- (0, _utils$5.default)("ObjectTypeProperty", {
- visitor: ["key", "value", "variance"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- key: (0, _utils$5.validateType)(["Identifier", "StringLiteral"]),
- value: (0, _utils$5.validateType)("FlowType"),
- kind: (0, _utils$5.validate)((0, _utils$5.assertOneOf)("init", "get", "set")),
- static: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- proto: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- variance: (0, _utils$5.validateOptionalType)("Variance"),
- method: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("ObjectTypeSpreadProperty", {
- visitor: ["argument"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- argument: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("OpaqueType", {
- visitor: ["id", "typeParameters", "supertype", "impltype"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
- supertype: (0, _utils$5.validateOptionalType)("FlowType"),
- impltype: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("QualifiedTypeIdentifier", {
- visitor: ["id", "qualification"],
- aliases: ["Flow"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- qualification: (0, _utils$5.validateType)(["Identifier", "QualifiedTypeIdentifier"])
- }
- });
- (0, _utils$5.default)("StringLiteralTypeAnnotation", {
- builder: ["value"],
- aliases: ["Flow", "FlowType"],
- fields: {
- value: (0, _utils$5.validate)((0, _utils$5.assertValueType)("string"))
- }
- });
- (0, _utils$5.default)("StringTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("SymbolTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("ThisTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("TupleTypeAnnotation", {
- visitor: ["types"],
- aliases: ["Flow", "FlowType"],
- fields: {
- types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
- }
- });
- (0, _utils$5.default)("TypeofTypeAnnotation", {
- visitor: ["argument"],
- aliases: ["Flow", "FlowType"],
- fields: {
- argument: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("TypeAlias", {
- visitor: ["id", "typeParameters", "right"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- typeParameters: (0, _utils$5.validateOptionalType)("TypeParameterDeclaration"),
- right: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("TypeAnnotation", {
- aliases: ["Flow"],
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("TypeCastExpression", {
- visitor: ["expression", "typeAnnotation"],
- aliases: ["Flow", "ExpressionWrapper", "Expression"],
- fields: {
- expression: (0, _utils$5.validateType)("Expression"),
- typeAnnotation: (0, _utils$5.validateType)("TypeAnnotation")
- }
- });
- (0, _utils$5.default)("TypeParameter", {
- aliases: ["Flow"],
- visitor: ["bound", "default", "variance"],
- fields: {
- name: (0, _utils$5.validate)((0, _utils$5.assertValueType)("string")),
- bound: (0, _utils$5.validateOptionalType)("TypeAnnotation"),
- default: (0, _utils$5.validateOptionalType)("FlowType"),
- variance: (0, _utils$5.validateOptionalType)("Variance")
- }
- });
- (0, _utils$5.default)("TypeParameterDeclaration", {
- aliases: ["Flow"],
- visitor: ["params"],
- fields: {
- params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("TypeParameter"))
- }
- });
- (0, _utils$5.default)("TypeParameterInstantiation", {
- aliases: ["Flow"],
- visitor: ["params"],
- fields: {
- params: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
- }
- });
- (0, _utils$5.default)("UnionTypeAnnotation", {
- visitor: ["types"],
- aliases: ["Flow", "FlowType"],
- fields: {
- types: (0, _utils$5.validate)((0, _utils$5.arrayOfType)("FlowType"))
- }
- });
- (0, _utils$5.default)("Variance", {
- aliases: ["Flow"],
- builder: ["kind"],
- fields: {
- kind: (0, _utils$5.validate)((0, _utils$5.assertOneOf)("minus", "plus"))
- }
- });
- (0, _utils$5.default)("VoidTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- (0, _utils$5.default)("EnumDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "body"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- body: (0, _utils$5.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"])
- }
- });
- (0, _utils$5.default)("EnumBooleanBody", {
- aliases: ["EnumBody"],
- visitor: ["members"],
- fields: {
- explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- members: (0, _utils$5.validateArrayOfType)("EnumBooleanMember"),
- hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("EnumNumberBody", {
- aliases: ["EnumBody"],
- visitor: ["members"],
- fields: {
- explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- members: (0, _utils$5.validateArrayOfType)("EnumNumberMember"),
- hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("EnumStringBody", {
- aliases: ["EnumBody"],
- visitor: ["members"],
- fields: {
- explicitType: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean")),
- members: (0, _utils$5.validateArrayOfType)(["EnumStringMember", "EnumDefaultedMember"]),
- hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("EnumSymbolBody", {
- aliases: ["EnumBody"],
- visitor: ["members"],
- fields: {
- members: (0, _utils$5.validateArrayOfType)("EnumDefaultedMember"),
- hasUnknownMembers: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- (0, _utils$5.default)("EnumBooleanMember", {
- aliases: ["EnumMember"],
- visitor: ["id"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- init: (0, _utils$5.validateType)("BooleanLiteral")
- }
- });
- (0, _utils$5.default)("EnumNumberMember", {
- aliases: ["EnumMember"],
- visitor: ["id", "init"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- init: (0, _utils$5.validateType)("NumericLiteral")
- }
- });
- (0, _utils$5.default)("EnumStringMember", {
- aliases: ["EnumMember"],
- visitor: ["id", "init"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier"),
- init: (0, _utils$5.validateType)("StringLiteral")
- }
- });
- (0, _utils$5.default)("EnumDefaultedMember", {
- aliases: ["EnumMember"],
- visitor: ["id"],
- fields: {
- id: (0, _utils$5.validateType)("Identifier")
- }
- });
- (0, _utils$5.default)("IndexedAccessType", {
- visitor: ["objectType", "indexType"],
- aliases: ["Flow", "FlowType"],
- fields: {
- objectType: (0, _utils$5.validateType)("FlowType"),
- indexType: (0, _utils$5.validateType)("FlowType")
- }
- });
- (0, _utils$5.default)("OptionalIndexedAccessType", {
- visitor: ["objectType", "indexType"],
- aliases: ["Flow", "FlowType"],
- fields: {
- objectType: (0, _utils$5.validateType)("FlowType"),
- indexType: (0, _utils$5.validateType)("FlowType"),
- optional: (0, _utils$5.validate)((0, _utils$5.assertValueType)("boolean"))
- }
- });
- var _utils$4 = utils;
- (0, _utils$4.default)("JSXAttribute", {
- visitor: ["name", "value"],
- aliases: ["JSX", "Immutable"],
- fields: {
- name: {
- validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
- },
- value: {
- optional: true,
- validate: (0, _utils$4.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
- }
- }
- });
- (0, _utils$4.default)("JSXClosingElement", {
- visitor: ["name"],
- aliases: ["JSX", "Immutable"],
- fields: {
- name: {
- validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
- }
- }
- });
- (0, _utils$4.default)("JSXElement", {
- builder: ["openingElement", "closingElement", "children", "selfClosing"],
- visitor: ["openingElement", "children", "closingElement"],
- aliases: ["JSX", "Immutable", "Expression"],
- fields: {
- openingElement: {
- validate: (0, _utils$4.assertNodeType)("JSXOpeningElement")
- },
- closingElement: {
- optional: true,
- validate: (0, _utils$4.assertNodeType)("JSXClosingElement")
- },
- children: {
- validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
- },
- selfClosing: {
- validate: (0, _utils$4.assertValueType)("boolean"),
- optional: true
- }
- }
- });
- (0, _utils$4.default)("JSXEmptyExpression", {
- aliases: ["JSX"]
- });
- (0, _utils$4.default)("JSXExpressionContainer", {
- visitor: ["expression"],
- aliases: ["JSX", "Immutable"],
- fields: {
- expression: {
- validate: (0, _utils$4.assertNodeType)("Expression", "JSXEmptyExpression")
- }
- }
- });
- (0, _utils$4.default)("JSXSpreadChild", {
- visitor: ["expression"],
- aliases: ["JSX", "Immutable"],
- fields: {
- expression: {
- validate: (0, _utils$4.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$4.default)("JSXIdentifier", {
- builder: ["name"],
- aliases: ["JSX"],
- fields: {
- name: {
- validate: (0, _utils$4.assertValueType)("string")
- }
- }
- });
- (0, _utils$4.default)("JSXMemberExpression", {
- visitor: ["object", "property"],
- aliases: ["JSX"],
- fields: {
- object: {
- validate: (0, _utils$4.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
- },
- property: {
- validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
- }
- }
- });
- (0, _utils$4.default)("JSXNamespacedName", {
- visitor: ["namespace", "name"],
- aliases: ["JSX"],
- fields: {
- namespace: {
- validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
- },
- name: {
- validate: (0, _utils$4.assertNodeType)("JSXIdentifier")
- }
- }
- });
- (0, _utils$4.default)("JSXOpeningElement", {
- builder: ["name", "attributes", "selfClosing"],
- visitor: ["name", "attributes"],
- aliases: ["JSX", "Immutable"],
- fields: {
- name: {
- validate: (0, _utils$4.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
- },
- selfClosing: {
- default: false
- },
- attributes: {
- validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
- },
- typeParameters: {
- validate: (0, _utils$4.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
- optional: true
- }
- }
- });
- (0, _utils$4.default)("JSXSpreadAttribute", {
- visitor: ["argument"],
- aliases: ["JSX"],
- fields: {
- argument: {
- validate: (0, _utils$4.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$4.default)("JSXText", {
- aliases: ["JSX", "Immutable"],
- builder: ["value"],
- fields: {
- value: {
- validate: (0, _utils$4.assertValueType)("string")
- }
- }
- });
- (0, _utils$4.default)("JSXFragment", {
- builder: ["openingFragment", "closingFragment", "children"],
- visitor: ["openingFragment", "children", "closingFragment"],
- aliases: ["JSX", "Immutable", "Expression"],
- fields: {
- openingFragment: {
- validate: (0, _utils$4.assertNodeType)("JSXOpeningFragment")
- },
- closingFragment: {
- validate: (0, _utils$4.assertNodeType)("JSXClosingFragment")
- },
- children: {
- validate: (0, _utils$4.chain)((0, _utils$4.assertValueType)("array"), (0, _utils$4.assertEach)((0, _utils$4.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
- }
- }
- });
- (0, _utils$4.default)("JSXOpeningFragment", {
- aliases: ["JSX", "Immutable"]
- });
- (0, _utils$4.default)("JSXClosingFragment", {
- aliases: ["JSX", "Immutable"]
- });
- var placeholders = {};
- Object.defineProperty(placeholders, "__esModule", {
- value: true
- });
- placeholders.PLACEHOLDERS_FLIPPED_ALIAS = placeholders.PLACEHOLDERS_ALIAS = placeholders.PLACEHOLDERS = void 0;
- var _utils$3 = utils;
- const PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
- placeholders.PLACEHOLDERS = PLACEHOLDERS;
- const PLACEHOLDERS_ALIAS = {
- Declaration: ["Statement"],
- Pattern: ["PatternLike", "LVal"]
- };
- placeholders.PLACEHOLDERS_ALIAS = PLACEHOLDERS_ALIAS;
- for (const type of PLACEHOLDERS) {
- const alias = _utils$3.ALIAS_KEYS[type];
- if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
- }
- const PLACEHOLDERS_FLIPPED_ALIAS = {};
- placeholders.PLACEHOLDERS_FLIPPED_ALIAS = PLACEHOLDERS_FLIPPED_ALIAS;
- Object.keys(PLACEHOLDERS_ALIAS).forEach(type => {
- PLACEHOLDERS_ALIAS[type].forEach(alias => {
- if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
- PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
- }
- PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
- });
- });
- var _utils$2 = utils;
- var _placeholders = placeholders;
- {
- (0, _utils$2.default)("Noop", {
- visitor: []
- });
- }
- (0, _utils$2.default)("Placeholder", {
- visitor: [],
- builder: ["expectedNode", "name"],
- fields: {
- name: {
- validate: (0, _utils$2.assertNodeType)("Identifier")
- },
- expectedNode: {
- validate: (0, _utils$2.assertOneOf)(..._placeholders.PLACEHOLDERS)
- }
- }
- });
- (0, _utils$2.default)("V8IntrinsicIdentifier", {
- builder: ["name"],
- fields: {
- name: {
- validate: (0, _utils$2.assertValueType)("string")
- }
- }
- });
- var _utils$1 = utils;
- (0, _utils$1.default)("ArgumentPlaceholder", {});
- (0, _utils$1.default)("BindExpression", {
- visitor: ["object", "callee"],
- aliases: ["Expression"],
- fields: !process.env.BABEL_TYPES_8_BREAKING ? {
- object: {
- validate: Object.assign(() => {}, {
- oneOfNodeTypes: ["Expression"]
- })
- },
- callee: {
- validate: Object.assign(() => {}, {
- oneOfNodeTypes: ["Expression"]
- })
- }
- } : {
- object: {
- validate: (0, _utils$1.assertNodeType)("Expression")
- },
- callee: {
- validate: (0, _utils$1.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$1.default)("ImportAttribute", {
- visitor: ["key", "value"],
- fields: {
- key: {
- validate: (0, _utils$1.assertNodeType)("Identifier", "StringLiteral")
- },
- value: {
- validate: (0, _utils$1.assertNodeType)("StringLiteral")
- }
- }
- });
- (0, _utils$1.default)("Decorator", {
- visitor: ["expression"],
- fields: {
- expression: {
- validate: (0, _utils$1.assertNodeType)("Expression")
- }
- }
- });
- (0, _utils$1.default)("DoExpression", {
- visitor: ["body"],
- builder: ["body", "async"],
- aliases: ["Expression"],
- fields: {
- body: {
- validate: (0, _utils$1.assertNodeType)("BlockStatement")
- },
- async: {
- validate: (0, _utils$1.assertValueType)("boolean"),
- default: false
- }
- }
- });
- (0, _utils$1.default)("ExportDefaultSpecifier", {
- visitor: ["exported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- exported: {
- validate: (0, _utils$1.assertNodeType)("Identifier")
- }
- }
- });
- (0, _utils$1.default)("RecordExpression", {
- visitor: ["properties"],
- aliases: ["Expression"],
- fields: {
- properties: {
- validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("ObjectProperty", "SpreadElement")))
- }
- }
- });
- (0, _utils$1.default)("TupleExpression", {
- fields: {
- elements: {
- validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("Expression", "SpreadElement"))),
- default: []
- }
- },
- visitor: ["elements"],
- aliases: ["Expression"]
- });
- (0, _utils$1.default)("DecimalLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: (0, _utils$1.assertValueType)("string")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- (0, _utils$1.default)("StaticBlock", {
- visitor: ["body"],
- fields: {
- body: {
- validate: (0, _utils$1.chain)((0, _utils$1.assertValueType)("array"), (0, _utils$1.assertEach)((0, _utils$1.assertNodeType)("Statement")))
- }
- },
- aliases: ["Scopable", "BlockParent"]
- });
- (0, _utils$1.default)("ModuleExpression", {
- visitor: ["body"],
- fields: {
- body: {
- validate: (0, _utils$1.assertNodeType)("Program")
- }
- },
- aliases: ["Expression"]
- });
- (0, _utils$1.default)("TopicReference", {
- aliases: ["Expression"]
- });
- (0, _utils$1.default)("PipelineTopicExpression", {
- builder: ["expression"],
- visitor: ["expression"],
- fields: {
- expression: {
- validate: (0, _utils$1.assertNodeType)("Expression")
- }
- },
- aliases: ["Expression"]
- });
- (0, _utils$1.default)("PipelineBareFunction", {
- builder: ["callee"],
- visitor: ["callee"],
- fields: {
- callee: {
- validate: (0, _utils$1.assertNodeType)("Expression")
- }
- },
- aliases: ["Expression"]
- });
- (0, _utils$1.default)("PipelinePrimaryTopicReference", {
- aliases: ["Expression"]
- });
- var _utils = utils;
- var _core = core;
- var _is$1 = is$1;
- const bool = (0, _utils.assertValueType)("boolean");
- const tSFunctionTypeAnnotationCommon = {
- returnType: {
- validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"),
- optional: true
- },
- typeParameters: {
- validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"),
- optional: true
- }
- };
- (0, _utils.default)("TSParameterProperty", {
- aliases: ["LVal"],
- visitor: ["parameter"],
- fields: {
- accessibility: {
- validate: (0, _utils.assertOneOf)("public", "private", "protected"),
- optional: true
- },
- readonly: {
- validate: (0, _utils.assertValueType)("boolean"),
- optional: true
- },
- parameter: {
- validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern")
- },
- override: {
- validate: (0, _utils.assertValueType)("boolean"),
- optional: true
- },
- decorators: {
- validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
- optional: true
- }
- }
- });
- (0, _utils.default)("TSDeclareFunction", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "typeParameters", "params", "returnType"],
- fields: Object.assign({}, _core.functionDeclarationCommon, tSFunctionTypeAnnotationCommon)
- });
- (0, _utils.default)("TSDeclareMethod", {
- visitor: ["decorators", "key", "typeParameters", "params", "returnType"],
- fields: Object.assign({}, _core.classMethodOrDeclareMethodCommon, tSFunctionTypeAnnotationCommon)
- });
- (0, _utils.default)("TSQualifiedName", {
- aliases: ["TSEntityName"],
- visitor: ["left", "right"],
- fields: {
- left: (0, _utils.validateType)("TSEntityName"),
- right: (0, _utils.validateType)("Identifier")
- }
- });
- const signatureDeclarationCommon = {
- typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
- parameters: (0, _utils.validateArrayOfType)(["Identifier", "RestElement"]),
- typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
- };
- const callConstructSignatureDeclaration = {
- aliases: ["TSTypeElement"],
- visitor: ["typeParameters", "parameters", "typeAnnotation"],
- fields: signatureDeclarationCommon
- };
- (0, _utils.default)("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
- (0, _utils.default)("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
- const namedTypeElementCommon = {
- key: (0, _utils.validateType)("Expression"),
- computed: (0, _utils.validate)(bool),
- optional: (0, _utils.validateOptional)(bool)
- };
- (0, _utils.default)("TSPropertySignature", {
- aliases: ["TSTypeElement"],
- visitor: ["key", "typeAnnotation", "initializer"],
- fields: Object.assign({}, namedTypeElementCommon, {
- readonly: (0, _utils.validateOptional)(bool),
- typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
- initializer: (0, _utils.validateOptionalType)("Expression"),
- kind: {
- validate: (0, _utils.assertOneOf)("get", "set")
- }
- })
- });
- (0, _utils.default)("TSMethodSignature", {
- aliases: ["TSTypeElement"],
- visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
- fields: Object.assign({}, signatureDeclarationCommon, namedTypeElementCommon, {
- kind: {
- validate: (0, _utils.assertOneOf)("method", "get", "set")
- }
- })
- });
- (0, _utils.default)("TSIndexSignature", {
- aliases: ["TSTypeElement"],
- visitor: ["parameters", "typeAnnotation"],
- fields: {
- readonly: (0, _utils.validateOptional)(bool),
- static: (0, _utils.validateOptional)(bool),
- parameters: (0, _utils.validateArrayOfType)("Identifier"),
- typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation")
- }
- });
- const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
- for (const type of tsKeywordTypes) {
- (0, _utils.default)(type, {
- aliases: ["TSType", "TSBaseType"],
- visitor: [],
- fields: {}
- });
- }
- (0, _utils.default)("TSThisType", {
- aliases: ["TSType", "TSBaseType"],
- visitor: [],
- fields: {}
- });
- const fnOrCtrBase = {
- aliases: ["TSType"],
- visitor: ["typeParameters", "parameters", "typeAnnotation"]
- };
- (0, _utils.default)("TSFunctionType", Object.assign({}, fnOrCtrBase, {
- fields: signatureDeclarationCommon
- }));
- (0, _utils.default)("TSConstructorType", Object.assign({}, fnOrCtrBase, {
- fields: Object.assign({}, signatureDeclarationCommon, {
- abstract: (0, _utils.validateOptional)(bool)
- })
- }));
- (0, _utils.default)("TSTypeReference", {
- aliases: ["TSType"],
- visitor: ["typeName", "typeParameters"],
- fields: {
- typeName: (0, _utils.validateType)("TSEntityName"),
- typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
- }
- });
- (0, _utils.default)("TSTypePredicate", {
- aliases: ["TSType"],
- visitor: ["parameterName", "typeAnnotation"],
- builder: ["parameterName", "typeAnnotation", "asserts"],
- fields: {
- parameterName: (0, _utils.validateType)(["Identifier", "TSThisType"]),
- typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"),
- asserts: (0, _utils.validateOptional)(bool)
- }
- });
- (0, _utils.default)("TSTypeQuery", {
- aliases: ["TSType"],
- visitor: ["exprName"],
- fields: {
- exprName: (0, _utils.validateType)(["TSEntityName", "TSImportType"])
- }
- });
- (0, _utils.default)("TSTypeLiteral", {
- aliases: ["TSType"],
- visitor: ["members"],
- fields: {
- members: (0, _utils.validateArrayOfType)("TSTypeElement")
- }
- });
- (0, _utils.default)("TSArrayType", {
- aliases: ["TSType"],
- visitor: ["elementType"],
- fields: {
- elementType: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSTupleType", {
- aliases: ["TSType"],
- visitor: ["elementTypes"],
- fields: {
- elementTypes: (0, _utils.validateArrayOfType)(["TSType", "TSNamedTupleMember"])
- }
- });
- (0, _utils.default)("TSOptionalType", {
- aliases: ["TSType"],
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSRestType", {
- aliases: ["TSType"],
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSNamedTupleMember", {
- visitor: ["label", "elementType"],
- builder: ["label", "elementType", "optional"],
- fields: {
- label: (0, _utils.validateType)("Identifier"),
- optional: {
- validate: bool,
- default: false
- },
- elementType: (0, _utils.validateType)("TSType")
- }
- });
- const unionOrIntersection = {
- aliases: ["TSType"],
- visitor: ["types"],
- fields: {
- types: (0, _utils.validateArrayOfType)("TSType")
- }
- };
- (0, _utils.default)("TSUnionType", unionOrIntersection);
- (0, _utils.default)("TSIntersectionType", unionOrIntersection);
- (0, _utils.default)("TSConditionalType", {
- aliases: ["TSType"],
- visitor: ["checkType", "extendsType", "trueType", "falseType"],
- fields: {
- checkType: (0, _utils.validateType)("TSType"),
- extendsType: (0, _utils.validateType)("TSType"),
- trueType: (0, _utils.validateType)("TSType"),
- falseType: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSInferType", {
- aliases: ["TSType"],
- visitor: ["typeParameter"],
- fields: {
- typeParameter: (0, _utils.validateType)("TSTypeParameter")
- }
- });
- (0, _utils.default)("TSParenthesizedType", {
- aliases: ["TSType"],
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSTypeOperator", {
- aliases: ["TSType"],
- visitor: ["typeAnnotation"],
- fields: {
- operator: (0, _utils.validate)((0, _utils.assertValueType)("string")),
- typeAnnotation: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSIndexedAccessType", {
- aliases: ["TSType"],
- visitor: ["objectType", "indexType"],
- fields: {
- objectType: (0, _utils.validateType)("TSType"),
- indexType: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSMappedType", {
- aliases: ["TSType"],
- visitor: ["typeParameter", "typeAnnotation", "nameType"],
- fields: {
- readonly: (0, _utils.validateOptional)(bool),
- typeParameter: (0, _utils.validateType)("TSTypeParameter"),
- optional: (0, _utils.validateOptional)(bool),
- typeAnnotation: (0, _utils.validateOptionalType)("TSType"),
- nameType: (0, _utils.validateOptionalType)("TSType")
- }
- });
- (0, _utils.default)("TSLiteralType", {
- aliases: ["TSType", "TSBaseType"],
- visitor: ["literal"],
- fields: {
- literal: {
- validate: function () {
- const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral");
- const unaryOperator = (0, _utils.assertOneOf)("-");
- const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral");
- function validator(parent, key, node) {
- if ((0, _is$1.default)("UnaryExpression", node)) {
- unaryOperator(node, "operator", node.operator);
- unaryExpression(node, "argument", node.argument);
- } else {
- literal(parent, key, node);
- }
- }
- validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "UnaryExpression"];
- return validator;
- }()
- }
- }
- });
- (0, _utils.default)("TSExpressionWithTypeArguments", {
- aliases: ["TSType"],
- visitor: ["expression", "typeParameters"],
- fields: {
- expression: (0, _utils.validateType)("TSEntityName"),
- typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
- }
- });
- (0, _utils.default)("TSInterfaceDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "typeParameters", "extends", "body"],
- fields: {
- declare: (0, _utils.validateOptional)(bool),
- id: (0, _utils.validateType)("Identifier"),
- typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
- extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")),
- body: (0, _utils.validateType)("TSInterfaceBody")
- }
- });
- (0, _utils.default)("TSInterfaceBody", {
- visitor: ["body"],
- fields: {
- body: (0, _utils.validateArrayOfType)("TSTypeElement")
- }
- });
- (0, _utils.default)("TSTypeAliasDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "typeParameters", "typeAnnotation"],
- fields: {
- declare: (0, _utils.validateOptional)(bool),
- id: (0, _utils.validateType)("Identifier"),
- typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"),
- typeAnnotation: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSAsExpression", {
- aliases: ["Expression"],
- visitor: ["expression", "typeAnnotation"],
- fields: {
- expression: (0, _utils.validateType)("Expression"),
- typeAnnotation: (0, _utils.validateType)("TSType")
- }
- });
- (0, _utils.default)("TSTypeAssertion", {
- aliases: ["Expression"],
- visitor: ["typeAnnotation", "expression"],
- fields: {
- typeAnnotation: (0, _utils.validateType)("TSType"),
- expression: (0, _utils.validateType)("Expression")
- }
- });
- (0, _utils.default)("TSEnumDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "members"],
- fields: {
- declare: (0, _utils.validateOptional)(bool),
- const: (0, _utils.validateOptional)(bool),
- id: (0, _utils.validateType)("Identifier"),
- members: (0, _utils.validateArrayOfType)("TSEnumMember"),
- initializer: (0, _utils.validateOptionalType)("Expression")
- }
- });
- (0, _utils.default)("TSEnumMember", {
- visitor: ["id", "initializer"],
- fields: {
- id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
- initializer: (0, _utils.validateOptionalType)("Expression")
- }
- });
- (0, _utils.default)("TSModuleDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "body"],
- fields: {
- declare: (0, _utils.validateOptional)(bool),
- global: (0, _utils.validateOptional)(bool),
- id: (0, _utils.validateType)(["Identifier", "StringLiteral"]),
- body: (0, _utils.validateType)(["TSModuleBlock", "TSModuleDeclaration"])
- }
- });
- (0, _utils.default)("TSModuleBlock", {
- aliases: ["Scopable", "Block", "BlockParent"],
- visitor: ["body"],
- fields: {
- body: (0, _utils.validateArrayOfType)("Statement")
- }
- });
- (0, _utils.default)("TSImportType", {
- aliases: ["TSType"],
- visitor: ["argument", "qualifier", "typeParameters"],
- fields: {
- argument: (0, _utils.validateType)("StringLiteral"),
- qualifier: (0, _utils.validateOptionalType)("TSEntityName"),
- typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation")
- }
- });
- (0, _utils.default)("TSImportEqualsDeclaration", {
- aliases: ["Statement"],
- visitor: ["id", "moduleReference"],
- fields: {
- isExport: (0, _utils.validate)(bool),
- id: (0, _utils.validateType)("Identifier"),
- moduleReference: (0, _utils.validateType)(["TSEntityName", "TSExternalModuleReference"]),
- importKind: {
- validate: (0, _utils.assertOneOf)("type", "value"),
- optional: true
- }
- }
- });
- (0, _utils.default)("TSExternalModuleReference", {
- visitor: ["expression"],
- fields: {
- expression: (0, _utils.validateType)("StringLiteral")
- }
- });
- (0, _utils.default)("TSNonNullExpression", {
- aliases: ["Expression"],
- visitor: ["expression"],
- fields: {
- expression: (0, _utils.validateType)("Expression")
- }
- });
- (0, _utils.default)("TSExportAssignment", {
- aliases: ["Statement"],
- visitor: ["expression"],
- fields: {
- expression: (0, _utils.validateType)("Expression")
- }
- });
- (0, _utils.default)("TSNamespaceExportDeclaration", {
- aliases: ["Statement"],
- visitor: ["id"],
- fields: {
- id: (0, _utils.validateType)("Identifier")
- }
- });
- (0, _utils.default)("TSTypeAnnotation", {
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: {
- validate: (0, _utils.assertNodeType)("TSType")
- }
- }
- });
- (0, _utils.default)("TSTypeParameterInstantiation", {
- visitor: ["params"],
- fields: {
- params: {
- validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")))
- }
- }
- });
- (0, _utils.default)("TSTypeParameterDeclaration", {
- visitor: ["params"],
- fields: {
- params: {
- validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSTypeParameter")))
- }
- }
- });
- (0, _utils.default)("TSTypeParameter", {
- builder: ["constraint", "default", "name"],
- visitor: ["constraint", "default"],
- fields: {
- name: {
- validate: (0, _utils.assertValueType)("string")
- },
- constraint: {
- validate: (0, _utils.assertNodeType)("TSType"),
- optional: true
- },
- default: {
- validate: (0, _utils.assertNodeType)("TSType"),
- optional: true
- }
- }
- });
- (function (exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- Object.defineProperty(exports, "VISITOR_KEYS", {
- enumerable: true,
- get: function () {
- return _utils.VISITOR_KEYS;
- }
- });
- Object.defineProperty(exports, "ALIAS_KEYS", {
- enumerable: true,
- get: function () {
- return _utils.ALIAS_KEYS;
- }
- });
- Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
- enumerable: true,
- get: function () {
- return _utils.FLIPPED_ALIAS_KEYS;
- }
- });
- Object.defineProperty(exports, "NODE_FIELDS", {
- enumerable: true,
- get: function () {
- return _utils.NODE_FIELDS;
- }
- });
- Object.defineProperty(exports, "BUILDER_KEYS", {
- enumerable: true,
- get: function () {
- return _utils.BUILDER_KEYS;
- }
- });
- Object.defineProperty(exports, "DEPRECATED_KEYS", {
- enumerable: true,
- get: function () {
- return _utils.DEPRECATED_KEYS;
- }
- });
- Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", {
- enumerable: true,
- get: function () {
- return _utils.NODE_PARENT_VALIDATIONS;
- }
- });
- Object.defineProperty(exports, "PLACEHOLDERS", {
- enumerable: true,
- get: function () {
- return _placeholders.PLACEHOLDERS;
- }
- });
- Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", {
- enumerable: true,
- get: function () {
- return _placeholders.PLACEHOLDERS_ALIAS;
- }
- });
- Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", {
- enumerable: true,
- get: function () {
- return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS;
- }
- });
- exports.TYPES = void 0;
- var _utils = utils;
- var _placeholders = placeholders;
- const TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
- exports.TYPES = TYPES;
- }(definitions));
- Object.defineProperty(builder$1, "__esModule", {
- value: true
- });
- builder$1.default = builder;
- var _definitions$6 = definitions;
- var _validate = validate$2;
- function builder(type, ...args) {
- const keys = _definitions$6.BUILDER_KEYS[type];
- const countArgs = args.length;
- if (countArgs > keys.length) {
- throw new Error(`${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`);
- }
- const node = {
- type
- };
- let i = 0;
- keys.forEach(key => {
- const field = _definitions$6.NODE_FIELDS[type][key];
- let arg;
- if (i < countArgs) arg = args[i];
- if (arg === undefined) {
- arg = Array.isArray(field.default) ? [] : field.default;
- }
- node[key] = arg;
- i++;
- });
- for (const key of Object.keys(node)) {
- (0, _validate.default)(node, key, node[key]);
- }
- return node;
- }
- Object.defineProperty(generated$3, "__esModule", {
- value: true
- });
- generated$3.arrayExpression = arrayExpression;
- generated$3.assignmentExpression = assignmentExpression;
- generated$3.binaryExpression = binaryExpression;
- generated$3.interpreterDirective = interpreterDirective;
- generated$3.directive = directive;
- generated$3.directiveLiteral = directiveLiteral;
- generated$3.blockStatement = blockStatement;
- generated$3.breakStatement = breakStatement;
- generated$3.callExpression = callExpression;
- generated$3.catchClause = catchClause;
- generated$3.conditionalExpression = conditionalExpression;
- generated$3.continueStatement = continueStatement;
- generated$3.debuggerStatement = debuggerStatement;
- generated$3.doWhileStatement = doWhileStatement;
- generated$3.emptyStatement = emptyStatement;
- generated$3.expressionStatement = expressionStatement;
- generated$3.file = file;
- generated$3.forInStatement = forInStatement;
- generated$3.forStatement = forStatement;
- generated$3.functionDeclaration = functionDeclaration;
- generated$3.functionExpression = functionExpression;
- generated$3.identifier = identifier;
- generated$3.ifStatement = ifStatement;
- generated$3.labeledStatement = labeledStatement;
- generated$3.stringLiteral = stringLiteral;
- generated$3.numericLiteral = numericLiteral;
- generated$3.nullLiteral = nullLiteral;
- generated$3.booleanLiteral = booleanLiteral;
- generated$3.regExpLiteral = regExpLiteral;
- generated$3.logicalExpression = logicalExpression;
- generated$3.memberExpression = memberExpression;
- generated$3.newExpression = newExpression;
- generated$3.program = program;
- generated$3.objectExpression = objectExpression;
- generated$3.objectMethod = objectMethod;
- generated$3.objectProperty = objectProperty;
- generated$3.restElement = restElement;
- generated$3.returnStatement = returnStatement;
- generated$3.sequenceExpression = sequenceExpression;
- generated$3.parenthesizedExpression = parenthesizedExpression;
- generated$3.switchCase = switchCase;
- generated$3.switchStatement = switchStatement;
- generated$3.thisExpression = thisExpression;
- generated$3.throwStatement = throwStatement;
- generated$3.tryStatement = tryStatement;
- generated$3.unaryExpression = unaryExpression;
- generated$3.updateExpression = updateExpression;
- generated$3.variableDeclaration = variableDeclaration;
- generated$3.variableDeclarator = variableDeclarator;
- generated$3.whileStatement = whileStatement;
- generated$3.withStatement = withStatement;
- generated$3.assignmentPattern = assignmentPattern;
- generated$3.arrayPattern = arrayPattern;
- generated$3.arrowFunctionExpression = arrowFunctionExpression;
- generated$3.classBody = classBody;
- generated$3.classExpression = classExpression;
- generated$3.classDeclaration = classDeclaration;
- generated$3.exportAllDeclaration = exportAllDeclaration;
- generated$3.exportDefaultDeclaration = exportDefaultDeclaration;
- generated$3.exportNamedDeclaration = exportNamedDeclaration;
- generated$3.exportSpecifier = exportSpecifier;
- generated$3.forOfStatement = forOfStatement;
- generated$3.importDeclaration = importDeclaration;
- generated$3.importDefaultSpecifier = importDefaultSpecifier;
- generated$3.importNamespaceSpecifier = importNamespaceSpecifier;
- generated$3.importSpecifier = importSpecifier;
- generated$3.metaProperty = metaProperty;
- generated$3.classMethod = classMethod;
- generated$3.objectPattern = objectPattern;
- generated$3.spreadElement = spreadElement;
- generated$3.super = _super;
- generated$3.taggedTemplateExpression = taggedTemplateExpression;
- generated$3.templateElement = templateElement;
- generated$3.templateLiteral = templateLiteral;
- generated$3.yieldExpression = yieldExpression;
- generated$3.awaitExpression = awaitExpression;
- generated$3.import = _import;
- generated$3.bigIntLiteral = bigIntLiteral;
- generated$3.exportNamespaceSpecifier = exportNamespaceSpecifier;
- generated$3.optionalMemberExpression = optionalMemberExpression;
- generated$3.optionalCallExpression = optionalCallExpression;
- generated$3.classProperty = classProperty;
- generated$3.classPrivateProperty = classPrivateProperty;
- generated$3.classPrivateMethod = classPrivateMethod;
- generated$3.privateName = privateName;
- generated$3.anyTypeAnnotation = anyTypeAnnotation;
- generated$3.arrayTypeAnnotation = arrayTypeAnnotation;
- generated$3.booleanTypeAnnotation = booleanTypeAnnotation;
- generated$3.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation;
- generated$3.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation;
- generated$3.classImplements = classImplements;
- generated$3.declareClass = declareClass;
- generated$3.declareFunction = declareFunction;
- generated$3.declareInterface = declareInterface;
- generated$3.declareModule = declareModule;
- generated$3.declareModuleExports = declareModuleExports;
- generated$3.declareTypeAlias = declareTypeAlias;
- generated$3.declareOpaqueType = declareOpaqueType;
- generated$3.declareVariable = declareVariable;
- generated$3.declareExportDeclaration = declareExportDeclaration;
- generated$3.declareExportAllDeclaration = declareExportAllDeclaration;
- generated$3.declaredPredicate = declaredPredicate;
- generated$3.existsTypeAnnotation = existsTypeAnnotation;
- generated$3.functionTypeAnnotation = functionTypeAnnotation;
- generated$3.functionTypeParam = functionTypeParam;
- generated$3.genericTypeAnnotation = genericTypeAnnotation;
- generated$3.inferredPredicate = inferredPredicate;
- generated$3.interfaceExtends = interfaceExtends;
- generated$3.interfaceDeclaration = interfaceDeclaration;
- generated$3.interfaceTypeAnnotation = interfaceTypeAnnotation;
- generated$3.intersectionTypeAnnotation = intersectionTypeAnnotation;
- generated$3.mixedTypeAnnotation = mixedTypeAnnotation;
- generated$3.emptyTypeAnnotation = emptyTypeAnnotation;
- generated$3.nullableTypeAnnotation = nullableTypeAnnotation;
- generated$3.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation;
- generated$3.numberTypeAnnotation = numberTypeAnnotation;
- generated$3.objectTypeAnnotation = objectTypeAnnotation;
- generated$3.objectTypeInternalSlot = objectTypeInternalSlot;
- generated$3.objectTypeCallProperty = objectTypeCallProperty;
- generated$3.objectTypeIndexer = objectTypeIndexer;
- generated$3.objectTypeProperty = objectTypeProperty;
- generated$3.objectTypeSpreadProperty = objectTypeSpreadProperty;
- generated$3.opaqueType = opaqueType;
- generated$3.qualifiedTypeIdentifier = qualifiedTypeIdentifier;
- generated$3.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation;
- generated$3.stringTypeAnnotation = stringTypeAnnotation;
- generated$3.symbolTypeAnnotation = symbolTypeAnnotation;
- generated$3.thisTypeAnnotation = thisTypeAnnotation;
- generated$3.tupleTypeAnnotation = tupleTypeAnnotation;
- generated$3.typeofTypeAnnotation = typeofTypeAnnotation;
- generated$3.typeAlias = typeAlias;
- generated$3.typeAnnotation = typeAnnotation;
- generated$3.typeCastExpression = typeCastExpression;
- generated$3.typeParameter = typeParameter;
- generated$3.typeParameterDeclaration = typeParameterDeclaration;
- generated$3.typeParameterInstantiation = typeParameterInstantiation;
- generated$3.unionTypeAnnotation = unionTypeAnnotation;
- generated$3.variance = variance;
- generated$3.voidTypeAnnotation = voidTypeAnnotation;
- generated$3.enumDeclaration = enumDeclaration;
- generated$3.enumBooleanBody = enumBooleanBody;
- generated$3.enumNumberBody = enumNumberBody;
- generated$3.enumStringBody = enumStringBody;
- generated$3.enumSymbolBody = enumSymbolBody;
- generated$3.enumBooleanMember = enumBooleanMember;
- generated$3.enumNumberMember = enumNumberMember;
- generated$3.enumStringMember = enumStringMember;
- generated$3.enumDefaultedMember = enumDefaultedMember;
- generated$3.indexedAccessType = indexedAccessType;
- generated$3.optionalIndexedAccessType = optionalIndexedAccessType;
- generated$3.jSXAttribute = generated$3.jsxAttribute = jsxAttribute;
- generated$3.jSXClosingElement = generated$3.jsxClosingElement = jsxClosingElement;
- generated$3.jSXElement = generated$3.jsxElement = jsxElement;
- generated$3.jSXEmptyExpression = generated$3.jsxEmptyExpression = jsxEmptyExpression;
- generated$3.jSXExpressionContainer = generated$3.jsxExpressionContainer = jsxExpressionContainer;
- generated$3.jSXSpreadChild = generated$3.jsxSpreadChild = jsxSpreadChild;
- generated$3.jSXIdentifier = generated$3.jsxIdentifier = jsxIdentifier;
- generated$3.jSXMemberExpression = generated$3.jsxMemberExpression = jsxMemberExpression;
- generated$3.jSXNamespacedName = generated$3.jsxNamespacedName = jsxNamespacedName;
- generated$3.jSXOpeningElement = generated$3.jsxOpeningElement = jsxOpeningElement;
- generated$3.jSXSpreadAttribute = generated$3.jsxSpreadAttribute = jsxSpreadAttribute;
- generated$3.jSXText = generated$3.jsxText = jsxText;
- generated$3.jSXFragment = generated$3.jsxFragment = jsxFragment;
- generated$3.jSXOpeningFragment = generated$3.jsxOpeningFragment = jsxOpeningFragment;
- generated$3.jSXClosingFragment = generated$3.jsxClosingFragment = jsxClosingFragment;
- generated$3.noop = noop;
- generated$3.placeholder = placeholder;
- generated$3.v8IntrinsicIdentifier = v8IntrinsicIdentifier;
- generated$3.argumentPlaceholder = argumentPlaceholder;
- generated$3.bindExpression = bindExpression;
- generated$3.importAttribute = importAttribute;
- generated$3.decorator = decorator;
- generated$3.doExpression = doExpression;
- generated$3.exportDefaultSpecifier = exportDefaultSpecifier;
- generated$3.recordExpression = recordExpression;
- generated$3.tupleExpression = tupleExpression;
- generated$3.decimalLiteral = decimalLiteral;
- generated$3.staticBlock = staticBlock;
- generated$3.moduleExpression = moduleExpression;
- generated$3.topicReference = topicReference;
- generated$3.pipelineTopicExpression = pipelineTopicExpression;
- generated$3.pipelineBareFunction = pipelineBareFunction;
- generated$3.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference;
- generated$3.tSParameterProperty = generated$3.tsParameterProperty = tsParameterProperty;
- generated$3.tSDeclareFunction = generated$3.tsDeclareFunction = tsDeclareFunction;
- generated$3.tSDeclareMethod = generated$3.tsDeclareMethod = tsDeclareMethod;
- generated$3.tSQualifiedName = generated$3.tsQualifiedName = tsQualifiedName;
- generated$3.tSCallSignatureDeclaration = generated$3.tsCallSignatureDeclaration = tsCallSignatureDeclaration;
- generated$3.tSConstructSignatureDeclaration = generated$3.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration;
- generated$3.tSPropertySignature = generated$3.tsPropertySignature = tsPropertySignature;
- generated$3.tSMethodSignature = generated$3.tsMethodSignature = tsMethodSignature;
- generated$3.tSIndexSignature = generated$3.tsIndexSignature = tsIndexSignature;
- generated$3.tSAnyKeyword = generated$3.tsAnyKeyword = tsAnyKeyword;
- generated$3.tSBooleanKeyword = generated$3.tsBooleanKeyword = tsBooleanKeyword;
- generated$3.tSBigIntKeyword = generated$3.tsBigIntKeyword = tsBigIntKeyword;
- generated$3.tSIntrinsicKeyword = generated$3.tsIntrinsicKeyword = tsIntrinsicKeyword;
- generated$3.tSNeverKeyword = generated$3.tsNeverKeyword = tsNeverKeyword;
- generated$3.tSNullKeyword = generated$3.tsNullKeyword = tsNullKeyword;
- generated$3.tSNumberKeyword = generated$3.tsNumberKeyword = tsNumberKeyword;
- generated$3.tSObjectKeyword = generated$3.tsObjectKeyword = tsObjectKeyword;
- generated$3.tSStringKeyword = generated$3.tsStringKeyword = tsStringKeyword;
- generated$3.tSSymbolKeyword = generated$3.tsSymbolKeyword = tsSymbolKeyword;
- generated$3.tSUndefinedKeyword = generated$3.tsUndefinedKeyword = tsUndefinedKeyword;
- generated$3.tSUnknownKeyword = generated$3.tsUnknownKeyword = tsUnknownKeyword;
- generated$3.tSVoidKeyword = generated$3.tsVoidKeyword = tsVoidKeyword;
- generated$3.tSThisType = generated$3.tsThisType = tsThisType;
- generated$3.tSFunctionType = generated$3.tsFunctionType = tsFunctionType;
- generated$3.tSConstructorType = generated$3.tsConstructorType = tsConstructorType;
- generated$3.tSTypeReference = generated$3.tsTypeReference = tsTypeReference;
- generated$3.tSTypePredicate = generated$3.tsTypePredicate = tsTypePredicate;
- generated$3.tSTypeQuery = generated$3.tsTypeQuery = tsTypeQuery;
- generated$3.tSTypeLiteral = generated$3.tsTypeLiteral = tsTypeLiteral;
- generated$3.tSArrayType = generated$3.tsArrayType = tsArrayType;
- generated$3.tSTupleType = generated$3.tsTupleType = tsTupleType;
- generated$3.tSOptionalType = generated$3.tsOptionalType = tsOptionalType;
- generated$3.tSRestType = generated$3.tsRestType = tsRestType;
- generated$3.tSNamedTupleMember = generated$3.tsNamedTupleMember = tsNamedTupleMember;
- generated$3.tSUnionType = generated$3.tsUnionType = tsUnionType;
- generated$3.tSIntersectionType = generated$3.tsIntersectionType = tsIntersectionType;
- generated$3.tSConditionalType = generated$3.tsConditionalType = tsConditionalType;
- generated$3.tSInferType = generated$3.tsInferType = tsInferType;
- generated$3.tSParenthesizedType = generated$3.tsParenthesizedType = tsParenthesizedType;
- generated$3.tSTypeOperator = generated$3.tsTypeOperator = tsTypeOperator;
- generated$3.tSIndexedAccessType = generated$3.tsIndexedAccessType = tsIndexedAccessType;
- generated$3.tSMappedType = generated$3.tsMappedType = tsMappedType;
- generated$3.tSLiteralType = generated$3.tsLiteralType = tsLiteralType;
- generated$3.tSExpressionWithTypeArguments = generated$3.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments;
- generated$3.tSInterfaceDeclaration = generated$3.tsInterfaceDeclaration = tsInterfaceDeclaration;
- generated$3.tSInterfaceBody = generated$3.tsInterfaceBody = tsInterfaceBody;
- generated$3.tSTypeAliasDeclaration = generated$3.tsTypeAliasDeclaration = tsTypeAliasDeclaration;
- generated$3.tSAsExpression = generated$3.tsAsExpression = tsAsExpression;
- generated$3.tSTypeAssertion = generated$3.tsTypeAssertion = tsTypeAssertion;
- generated$3.tSEnumDeclaration = generated$3.tsEnumDeclaration = tsEnumDeclaration;
- generated$3.tSEnumMember = generated$3.tsEnumMember = tsEnumMember;
- generated$3.tSModuleDeclaration = generated$3.tsModuleDeclaration = tsModuleDeclaration;
- generated$3.tSModuleBlock = generated$3.tsModuleBlock = tsModuleBlock;
- generated$3.tSImportType = generated$3.tsImportType = tsImportType;
- generated$3.tSImportEqualsDeclaration = generated$3.tsImportEqualsDeclaration = tsImportEqualsDeclaration;
- generated$3.tSExternalModuleReference = generated$3.tsExternalModuleReference = tsExternalModuleReference;
- generated$3.tSNonNullExpression = generated$3.tsNonNullExpression = tsNonNullExpression;
- generated$3.tSExportAssignment = generated$3.tsExportAssignment = tsExportAssignment;
- generated$3.tSNamespaceExportDeclaration = generated$3.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration;
- generated$3.tSTypeAnnotation = generated$3.tsTypeAnnotation = tsTypeAnnotation;
- generated$3.tSTypeParameterInstantiation = generated$3.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
- generated$3.tSTypeParameterDeclaration = generated$3.tsTypeParameterDeclaration = tsTypeParameterDeclaration;
- generated$3.tSTypeParameter = generated$3.tsTypeParameter = tsTypeParameter;
- generated$3.numberLiteral = NumberLiteral;
- generated$3.regexLiteral = RegexLiteral;
- generated$3.restProperty = RestProperty;
- generated$3.spreadProperty = SpreadProperty;
- var _builder = builder$1;
- function arrayExpression(elements) {
- return (0, _builder.default)("ArrayExpression", ...arguments);
- }
- function assignmentExpression(operator, left, right) {
- return (0, _builder.default)("AssignmentExpression", ...arguments);
- }
- function binaryExpression(operator, left, right) {
- return (0, _builder.default)("BinaryExpression", ...arguments);
- }
- function interpreterDirective(value) {
- return (0, _builder.default)("InterpreterDirective", ...arguments);
- }
- function directive(value) {
- return (0, _builder.default)("Directive", ...arguments);
- }
- function directiveLiteral(value) {
- return (0, _builder.default)("DirectiveLiteral", ...arguments);
- }
- function blockStatement(body, directives) {
- return (0, _builder.default)("BlockStatement", ...arguments);
- }
- function breakStatement(label) {
- return (0, _builder.default)("BreakStatement", ...arguments);
- }
- function callExpression(callee, _arguments) {
- return (0, _builder.default)("CallExpression", ...arguments);
- }
- function catchClause(param, body) {
- return (0, _builder.default)("CatchClause", ...arguments);
- }
- function conditionalExpression(test, consequent, alternate) {
- return (0, _builder.default)("ConditionalExpression", ...arguments);
- }
- function continueStatement(label) {
- return (0, _builder.default)("ContinueStatement", ...arguments);
- }
- function debuggerStatement() {
- return (0, _builder.default)("DebuggerStatement", ...arguments);
- }
- function doWhileStatement(test, body) {
- return (0, _builder.default)("DoWhileStatement", ...arguments);
- }
- function emptyStatement() {
- return (0, _builder.default)("EmptyStatement", ...arguments);
- }
- function expressionStatement(expression) {
- return (0, _builder.default)("ExpressionStatement", ...arguments);
- }
- function file(program, comments, tokens) {
- return (0, _builder.default)("File", ...arguments);
- }
- function forInStatement(left, right, body) {
- return (0, _builder.default)("ForInStatement", ...arguments);
- }
- function forStatement(init, test, update, body) {
- return (0, _builder.default)("ForStatement", ...arguments);
- }
- function functionDeclaration(id, params, body, generator, async) {
- return (0, _builder.default)("FunctionDeclaration", ...arguments);
- }
- function functionExpression(id, params, body, generator, async) {
- return (0, _builder.default)("FunctionExpression", ...arguments);
- }
- function identifier(name) {
- return (0, _builder.default)("Identifier", ...arguments);
- }
- function ifStatement(test, consequent, alternate) {
- return (0, _builder.default)("IfStatement", ...arguments);
- }
- function labeledStatement(label, body) {
- return (0, _builder.default)("LabeledStatement", ...arguments);
- }
- function stringLiteral(value) {
- return (0, _builder.default)("StringLiteral", ...arguments);
- }
- function numericLiteral(value) {
- return (0, _builder.default)("NumericLiteral", ...arguments);
- }
- function nullLiteral() {
- return (0, _builder.default)("NullLiteral", ...arguments);
- }
- function booleanLiteral(value) {
- return (0, _builder.default)("BooleanLiteral", ...arguments);
- }
- function regExpLiteral(pattern, flags) {
- return (0, _builder.default)("RegExpLiteral", ...arguments);
- }
- function logicalExpression(operator, left, right) {
- return (0, _builder.default)("LogicalExpression", ...arguments);
- }
- function memberExpression(object, property, computed, optional) {
- return (0, _builder.default)("MemberExpression", ...arguments);
- }
- function newExpression(callee, _arguments) {
- return (0, _builder.default)("NewExpression", ...arguments);
- }
- function program(body, directives, sourceType, interpreter) {
- return (0, _builder.default)("Program", ...arguments);
- }
- function objectExpression(properties) {
- return (0, _builder.default)("ObjectExpression", ...arguments);
- }
- function objectMethod(kind, key, params, body, computed, generator, async) {
- return (0, _builder.default)("ObjectMethod", ...arguments);
- }
- function objectProperty(key, value, computed, shorthand, decorators) {
- return (0, _builder.default)("ObjectProperty", ...arguments);
- }
- function restElement(argument) {
- return (0, _builder.default)("RestElement", ...arguments);
- }
- function returnStatement(argument) {
- return (0, _builder.default)("ReturnStatement", ...arguments);
- }
- function sequenceExpression(expressions) {
- return (0, _builder.default)("SequenceExpression", ...arguments);
- }
- function parenthesizedExpression(expression) {
- return (0, _builder.default)("ParenthesizedExpression", ...arguments);
- }
- function switchCase(test, consequent) {
- return (0, _builder.default)("SwitchCase", ...arguments);
- }
- function switchStatement(discriminant, cases) {
- return (0, _builder.default)("SwitchStatement", ...arguments);
- }
- function thisExpression() {
- return (0, _builder.default)("ThisExpression", ...arguments);
- }
- function throwStatement(argument) {
- return (0, _builder.default)("ThrowStatement", ...arguments);
- }
- function tryStatement(block, handler, finalizer) {
- return (0, _builder.default)("TryStatement", ...arguments);
- }
- function unaryExpression(operator, argument, prefix) {
- return (0, _builder.default)("UnaryExpression", ...arguments);
- }
- function updateExpression(operator, argument, prefix) {
- return (0, _builder.default)("UpdateExpression", ...arguments);
- }
- function variableDeclaration(kind, declarations) {
- return (0, _builder.default)("VariableDeclaration", ...arguments);
- }
- function variableDeclarator(id, init) {
- return (0, _builder.default)("VariableDeclarator", ...arguments);
- }
- function whileStatement(test, body) {
- return (0, _builder.default)("WhileStatement", ...arguments);
- }
- function withStatement(object, body) {
- return (0, _builder.default)("WithStatement", ...arguments);
- }
- function assignmentPattern(left, right) {
- return (0, _builder.default)("AssignmentPattern", ...arguments);
- }
- function arrayPattern(elements) {
- return (0, _builder.default)("ArrayPattern", ...arguments);
- }
- function arrowFunctionExpression(params, body, async) {
- return (0, _builder.default)("ArrowFunctionExpression", ...arguments);
- }
- function classBody(body) {
- return (0, _builder.default)("ClassBody", ...arguments);
- }
- function classExpression(id, superClass, body, decorators) {
- return (0, _builder.default)("ClassExpression", ...arguments);
- }
- function classDeclaration(id, superClass, body, decorators) {
- return (0, _builder.default)("ClassDeclaration", ...arguments);
- }
- function exportAllDeclaration(source) {
- return (0, _builder.default)("ExportAllDeclaration", ...arguments);
- }
- function exportDefaultDeclaration(declaration) {
- return (0, _builder.default)("ExportDefaultDeclaration", ...arguments);
- }
- function exportNamedDeclaration(declaration, specifiers, source) {
- return (0, _builder.default)("ExportNamedDeclaration", ...arguments);
- }
- function exportSpecifier(local, exported) {
- return (0, _builder.default)("ExportSpecifier", ...arguments);
- }
- function forOfStatement(left, right, body, _await) {
- return (0, _builder.default)("ForOfStatement", ...arguments);
- }
- function importDeclaration(specifiers, source) {
- return (0, _builder.default)("ImportDeclaration", ...arguments);
- }
- function importDefaultSpecifier(local) {
- return (0, _builder.default)("ImportDefaultSpecifier", ...arguments);
- }
- function importNamespaceSpecifier(local) {
- return (0, _builder.default)("ImportNamespaceSpecifier", ...arguments);
- }
- function importSpecifier(local, imported) {
- return (0, _builder.default)("ImportSpecifier", ...arguments);
- }
- function metaProperty(meta, property) {
- return (0, _builder.default)("MetaProperty", ...arguments);
- }
- function classMethod(kind, key, params, body, computed, _static, generator, async) {
- return (0, _builder.default)("ClassMethod", ...arguments);
- }
- function objectPattern(properties) {
- return (0, _builder.default)("ObjectPattern", ...arguments);
- }
- function spreadElement(argument) {
- return (0, _builder.default)("SpreadElement", ...arguments);
- }
- function _super() {
- return (0, _builder.default)("Super", ...arguments);
- }
- function taggedTemplateExpression(tag, quasi) {
- return (0, _builder.default)("TaggedTemplateExpression", ...arguments);
- }
- function templateElement(value, tail) {
- return (0, _builder.default)("TemplateElement", ...arguments);
- }
- function templateLiteral(quasis, expressions) {
- return (0, _builder.default)("TemplateLiteral", ...arguments);
- }
- function yieldExpression(argument, delegate) {
- return (0, _builder.default)("YieldExpression", ...arguments);
- }
- function awaitExpression(argument) {
- return (0, _builder.default)("AwaitExpression", ...arguments);
- }
- function _import() {
- return (0, _builder.default)("Import", ...arguments);
- }
- function bigIntLiteral(value) {
- return (0, _builder.default)("BigIntLiteral", ...arguments);
- }
- function exportNamespaceSpecifier(exported) {
- return (0, _builder.default)("ExportNamespaceSpecifier", ...arguments);
- }
- function optionalMemberExpression(object, property, computed, optional) {
- return (0, _builder.default)("OptionalMemberExpression", ...arguments);
- }
- function optionalCallExpression(callee, _arguments, optional) {
- return (0, _builder.default)("OptionalCallExpression", ...arguments);
- }
- function classProperty(key, value, typeAnnotation, decorators, computed, _static) {
- return (0, _builder.default)("ClassProperty", ...arguments);
- }
- function classPrivateProperty(key, value, decorators, _static) {
- return (0, _builder.default)("ClassPrivateProperty", ...arguments);
- }
- function classPrivateMethod(kind, key, params, body, _static) {
- return (0, _builder.default)("ClassPrivateMethod", ...arguments);
- }
- function privateName(id) {
- return (0, _builder.default)("PrivateName", ...arguments);
- }
- function anyTypeAnnotation() {
- return (0, _builder.default)("AnyTypeAnnotation", ...arguments);
- }
- function arrayTypeAnnotation(elementType) {
- return (0, _builder.default)("ArrayTypeAnnotation", ...arguments);
- }
- function booleanTypeAnnotation() {
- return (0, _builder.default)("BooleanTypeAnnotation", ...arguments);
- }
- function booleanLiteralTypeAnnotation(value) {
- return (0, _builder.default)("BooleanLiteralTypeAnnotation", ...arguments);
- }
- function nullLiteralTypeAnnotation() {
- return (0, _builder.default)("NullLiteralTypeAnnotation", ...arguments);
- }
- function classImplements(id, typeParameters) {
- return (0, _builder.default)("ClassImplements", ...arguments);
- }
- function declareClass(id, typeParameters, _extends, body) {
- return (0, _builder.default)("DeclareClass", ...arguments);
- }
- function declareFunction(id) {
- return (0, _builder.default)("DeclareFunction", ...arguments);
- }
- function declareInterface(id, typeParameters, _extends, body) {
- return (0, _builder.default)("DeclareInterface", ...arguments);
- }
- function declareModule(id, body, kind) {
- return (0, _builder.default)("DeclareModule", ...arguments);
- }
- function declareModuleExports(typeAnnotation) {
- return (0, _builder.default)("DeclareModuleExports", ...arguments);
- }
- function declareTypeAlias(id, typeParameters, right) {
- return (0, _builder.default)("DeclareTypeAlias", ...arguments);
- }
- function declareOpaqueType(id, typeParameters, supertype) {
- return (0, _builder.default)("DeclareOpaqueType", ...arguments);
- }
- function declareVariable(id) {
- return (0, _builder.default)("DeclareVariable", ...arguments);
- }
- function declareExportDeclaration(declaration, specifiers, source) {
- return (0, _builder.default)("DeclareExportDeclaration", ...arguments);
- }
- function declareExportAllDeclaration(source) {
- return (0, _builder.default)("DeclareExportAllDeclaration", ...arguments);
- }
- function declaredPredicate(value) {
- return (0, _builder.default)("DeclaredPredicate", ...arguments);
- }
- function existsTypeAnnotation() {
- return (0, _builder.default)("ExistsTypeAnnotation", ...arguments);
- }
- function functionTypeAnnotation(typeParameters, params, rest, returnType) {
- return (0, _builder.default)("FunctionTypeAnnotation", ...arguments);
- }
- function functionTypeParam(name, typeAnnotation) {
- return (0, _builder.default)("FunctionTypeParam", ...arguments);
- }
- function genericTypeAnnotation(id, typeParameters) {
- return (0, _builder.default)("GenericTypeAnnotation", ...arguments);
- }
- function inferredPredicate() {
- return (0, _builder.default)("InferredPredicate", ...arguments);
- }
- function interfaceExtends(id, typeParameters) {
- return (0, _builder.default)("InterfaceExtends", ...arguments);
- }
- function interfaceDeclaration(id, typeParameters, _extends, body) {
- return (0, _builder.default)("InterfaceDeclaration", ...arguments);
- }
- function interfaceTypeAnnotation(_extends, body) {
- return (0, _builder.default)("InterfaceTypeAnnotation", ...arguments);
- }
- function intersectionTypeAnnotation(types) {
- return (0, _builder.default)("IntersectionTypeAnnotation", ...arguments);
- }
- function mixedTypeAnnotation() {
- return (0, _builder.default)("MixedTypeAnnotation", ...arguments);
- }
- function emptyTypeAnnotation() {
- return (0, _builder.default)("EmptyTypeAnnotation", ...arguments);
- }
- function nullableTypeAnnotation(typeAnnotation) {
- return (0, _builder.default)("NullableTypeAnnotation", ...arguments);
- }
- function numberLiteralTypeAnnotation(value) {
- return (0, _builder.default)("NumberLiteralTypeAnnotation", ...arguments);
- }
- function numberTypeAnnotation() {
- return (0, _builder.default)("NumberTypeAnnotation", ...arguments);
- }
- function objectTypeAnnotation(properties, indexers, callProperties, internalSlots, exact) {
- return (0, _builder.default)("ObjectTypeAnnotation", ...arguments);
- }
- function objectTypeInternalSlot(id, value, optional, _static, method) {
- return (0, _builder.default)("ObjectTypeInternalSlot", ...arguments);
- }
- function objectTypeCallProperty(value) {
- return (0, _builder.default)("ObjectTypeCallProperty", ...arguments);
- }
- function objectTypeIndexer(id, key, value, variance) {
- return (0, _builder.default)("ObjectTypeIndexer", ...arguments);
- }
- function objectTypeProperty(key, value, variance) {
- return (0, _builder.default)("ObjectTypeProperty", ...arguments);
- }
- function objectTypeSpreadProperty(argument) {
- return (0, _builder.default)("ObjectTypeSpreadProperty", ...arguments);
- }
- function opaqueType(id, typeParameters, supertype, impltype) {
- return (0, _builder.default)("OpaqueType", ...arguments);
- }
- function qualifiedTypeIdentifier(id, qualification) {
- return (0, _builder.default)("QualifiedTypeIdentifier", ...arguments);
- }
- function stringLiteralTypeAnnotation(value) {
- return (0, _builder.default)("StringLiteralTypeAnnotation", ...arguments);
- }
- function stringTypeAnnotation() {
- return (0, _builder.default)("StringTypeAnnotation", ...arguments);
- }
- function symbolTypeAnnotation() {
- return (0, _builder.default)("SymbolTypeAnnotation", ...arguments);
- }
- function thisTypeAnnotation() {
- return (0, _builder.default)("ThisTypeAnnotation", ...arguments);
- }
- function tupleTypeAnnotation(types) {
- return (0, _builder.default)("TupleTypeAnnotation", ...arguments);
- }
- function typeofTypeAnnotation(argument) {
- return (0, _builder.default)("TypeofTypeAnnotation", ...arguments);
- }
- function typeAlias(id, typeParameters, right) {
- return (0, _builder.default)("TypeAlias", ...arguments);
- }
- function typeAnnotation(typeAnnotation) {
- return (0, _builder.default)("TypeAnnotation", ...arguments);
- }
- function typeCastExpression(expression, typeAnnotation) {
- return (0, _builder.default)("TypeCastExpression", ...arguments);
- }
- function typeParameter(bound, _default, variance) {
- return (0, _builder.default)("TypeParameter", ...arguments);
- }
- function typeParameterDeclaration(params) {
- return (0, _builder.default)("TypeParameterDeclaration", ...arguments);
- }
- function typeParameterInstantiation(params) {
- return (0, _builder.default)("TypeParameterInstantiation", ...arguments);
- }
- function unionTypeAnnotation(types) {
- return (0, _builder.default)("UnionTypeAnnotation", ...arguments);
- }
- function variance(kind) {
- return (0, _builder.default)("Variance", ...arguments);
- }
- function voidTypeAnnotation() {
- return (0, _builder.default)("VoidTypeAnnotation", ...arguments);
- }
- function enumDeclaration(id, body) {
- return (0, _builder.default)("EnumDeclaration", ...arguments);
- }
- function enumBooleanBody(members) {
- return (0, _builder.default)("EnumBooleanBody", ...arguments);
- }
- function enumNumberBody(members) {
- return (0, _builder.default)("EnumNumberBody", ...arguments);
- }
- function enumStringBody(members) {
- return (0, _builder.default)("EnumStringBody", ...arguments);
- }
- function enumSymbolBody(members) {
- return (0, _builder.default)("EnumSymbolBody", ...arguments);
- }
- function enumBooleanMember(id) {
- return (0, _builder.default)("EnumBooleanMember", ...arguments);
- }
- function enumNumberMember(id, init) {
- return (0, _builder.default)("EnumNumberMember", ...arguments);
- }
- function enumStringMember(id, init) {
- return (0, _builder.default)("EnumStringMember", ...arguments);
- }
- function enumDefaultedMember(id) {
- return (0, _builder.default)("EnumDefaultedMember", ...arguments);
- }
- function indexedAccessType(objectType, indexType) {
- return (0, _builder.default)("IndexedAccessType", ...arguments);
- }
- function optionalIndexedAccessType(objectType, indexType) {
- return (0, _builder.default)("OptionalIndexedAccessType", ...arguments);
- }
- function jsxAttribute(name, value) {
- return (0, _builder.default)("JSXAttribute", ...arguments);
- }
- function jsxClosingElement(name) {
- return (0, _builder.default)("JSXClosingElement", ...arguments);
- }
- function jsxElement(openingElement, closingElement, children, selfClosing) {
- return (0, _builder.default)("JSXElement", ...arguments);
- }
- function jsxEmptyExpression() {
- return (0, _builder.default)("JSXEmptyExpression", ...arguments);
- }
- function jsxExpressionContainer(expression) {
- return (0, _builder.default)("JSXExpressionContainer", ...arguments);
- }
- function jsxSpreadChild(expression) {
- return (0, _builder.default)("JSXSpreadChild", ...arguments);
- }
- function jsxIdentifier(name) {
- return (0, _builder.default)("JSXIdentifier", ...arguments);
- }
- function jsxMemberExpression(object, property) {
- return (0, _builder.default)("JSXMemberExpression", ...arguments);
- }
- function jsxNamespacedName(namespace, name) {
- return (0, _builder.default)("JSXNamespacedName", ...arguments);
- }
- function jsxOpeningElement(name, attributes, selfClosing) {
- return (0, _builder.default)("JSXOpeningElement", ...arguments);
- }
- function jsxSpreadAttribute(argument) {
- return (0, _builder.default)("JSXSpreadAttribute", ...arguments);
- }
- function jsxText(value) {
- return (0, _builder.default)("JSXText", ...arguments);
- }
- function jsxFragment(openingFragment, closingFragment, children) {
- return (0, _builder.default)("JSXFragment", ...arguments);
- }
- function jsxOpeningFragment() {
- return (0, _builder.default)("JSXOpeningFragment", ...arguments);
- }
- function jsxClosingFragment() {
- return (0, _builder.default)("JSXClosingFragment", ...arguments);
- }
- function noop() {
- return (0, _builder.default)("Noop", ...arguments);
- }
- function placeholder(expectedNode, name) {
- return (0, _builder.default)("Placeholder", ...arguments);
- }
- function v8IntrinsicIdentifier(name) {
- return (0, _builder.default)("V8IntrinsicIdentifier", ...arguments);
- }
- function argumentPlaceholder() {
- return (0, _builder.default)("ArgumentPlaceholder", ...arguments);
- }
- function bindExpression(object, callee) {
- return (0, _builder.default)("BindExpression", ...arguments);
- }
- function importAttribute(key, value) {
- return (0, _builder.default)("ImportAttribute", ...arguments);
- }
- function decorator(expression) {
- return (0, _builder.default)("Decorator", ...arguments);
- }
- function doExpression(body, async) {
- return (0, _builder.default)("DoExpression", ...arguments);
- }
- function exportDefaultSpecifier(exported) {
- return (0, _builder.default)("ExportDefaultSpecifier", ...arguments);
- }
- function recordExpression(properties) {
- return (0, _builder.default)("RecordExpression", ...arguments);
- }
- function tupleExpression(elements) {
- return (0, _builder.default)("TupleExpression", ...arguments);
- }
- function decimalLiteral(value) {
- return (0, _builder.default)("DecimalLiteral", ...arguments);
- }
- function staticBlock(body) {
- return (0, _builder.default)("StaticBlock", ...arguments);
- }
- function moduleExpression(body) {
- return (0, _builder.default)("ModuleExpression", ...arguments);
- }
- function topicReference() {
- return (0, _builder.default)("TopicReference", ...arguments);
- }
- function pipelineTopicExpression(expression) {
- return (0, _builder.default)("PipelineTopicExpression", ...arguments);
- }
- function pipelineBareFunction(callee) {
- return (0, _builder.default)("PipelineBareFunction", ...arguments);
- }
- function pipelinePrimaryTopicReference() {
- return (0, _builder.default)("PipelinePrimaryTopicReference", ...arguments);
- }
- function tsParameterProperty(parameter) {
- return (0, _builder.default)("TSParameterProperty", ...arguments);
- }
- function tsDeclareFunction(id, typeParameters, params, returnType) {
- return (0, _builder.default)("TSDeclareFunction", ...arguments);
- }
- function tsDeclareMethod(decorators, key, typeParameters, params, returnType) {
- return (0, _builder.default)("TSDeclareMethod", ...arguments);
- }
- function tsQualifiedName(left, right) {
- return (0, _builder.default)("TSQualifiedName", ...arguments);
- }
- function tsCallSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
- return (0, _builder.default)("TSCallSignatureDeclaration", ...arguments);
- }
- function tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) {
- return (0, _builder.default)("TSConstructSignatureDeclaration", ...arguments);
- }
- function tsPropertySignature(key, typeAnnotation, initializer) {
- return (0, _builder.default)("TSPropertySignature", ...arguments);
- }
- function tsMethodSignature(key, typeParameters, parameters, typeAnnotation) {
- return (0, _builder.default)("TSMethodSignature", ...arguments);
- }
- function tsIndexSignature(parameters, typeAnnotation) {
- return (0, _builder.default)("TSIndexSignature", ...arguments);
- }
- function tsAnyKeyword() {
- return (0, _builder.default)("TSAnyKeyword", ...arguments);
- }
- function tsBooleanKeyword() {
- return (0, _builder.default)("TSBooleanKeyword", ...arguments);
- }
- function tsBigIntKeyword() {
- return (0, _builder.default)("TSBigIntKeyword", ...arguments);
- }
- function tsIntrinsicKeyword() {
- return (0, _builder.default)("TSIntrinsicKeyword", ...arguments);
- }
- function tsNeverKeyword() {
- return (0, _builder.default)("TSNeverKeyword", ...arguments);
- }
- function tsNullKeyword() {
- return (0, _builder.default)("TSNullKeyword", ...arguments);
- }
- function tsNumberKeyword() {
- return (0, _builder.default)("TSNumberKeyword", ...arguments);
- }
- function tsObjectKeyword() {
- return (0, _builder.default)("TSObjectKeyword", ...arguments);
- }
- function tsStringKeyword() {
- return (0, _builder.default)("TSStringKeyword", ...arguments);
- }
- function tsSymbolKeyword() {
- return (0, _builder.default)("TSSymbolKeyword", ...arguments);
- }
- function tsUndefinedKeyword() {
- return (0, _builder.default)("TSUndefinedKeyword", ...arguments);
- }
- function tsUnknownKeyword() {
- return (0, _builder.default)("TSUnknownKeyword", ...arguments);
- }
- function tsVoidKeyword() {
- return (0, _builder.default)("TSVoidKeyword", ...arguments);
- }
- function tsThisType() {
- return (0, _builder.default)("TSThisType", ...arguments);
- }
- function tsFunctionType(typeParameters, parameters, typeAnnotation) {
- return (0, _builder.default)("TSFunctionType", ...arguments);
- }
- function tsConstructorType(typeParameters, parameters, typeAnnotation) {
- return (0, _builder.default)("TSConstructorType", ...arguments);
- }
- function tsTypeReference(typeName, typeParameters) {
- return (0, _builder.default)("TSTypeReference", ...arguments);
- }
- function tsTypePredicate(parameterName, typeAnnotation, asserts) {
- return (0, _builder.default)("TSTypePredicate", ...arguments);
- }
- function tsTypeQuery(exprName) {
- return (0, _builder.default)("TSTypeQuery", ...arguments);
- }
- function tsTypeLiteral(members) {
- return (0, _builder.default)("TSTypeLiteral", ...arguments);
- }
- function tsArrayType(elementType) {
- return (0, _builder.default)("TSArrayType", ...arguments);
- }
- function tsTupleType(elementTypes) {
- return (0, _builder.default)("TSTupleType", ...arguments);
- }
- function tsOptionalType(typeAnnotation) {
- return (0, _builder.default)("TSOptionalType", ...arguments);
- }
- function tsRestType(typeAnnotation) {
- return (0, _builder.default)("TSRestType", ...arguments);
- }
- function tsNamedTupleMember(label, elementType, optional) {
- return (0, _builder.default)("TSNamedTupleMember", ...arguments);
- }
- function tsUnionType(types) {
- return (0, _builder.default)("TSUnionType", ...arguments);
- }
- function tsIntersectionType(types) {
- return (0, _builder.default)("TSIntersectionType", ...arguments);
- }
- function tsConditionalType(checkType, extendsType, trueType, falseType) {
- return (0, _builder.default)("TSConditionalType", ...arguments);
- }
- function tsInferType(typeParameter) {
- return (0, _builder.default)("TSInferType", ...arguments);
- }
- function tsParenthesizedType(typeAnnotation) {
- return (0, _builder.default)("TSParenthesizedType", ...arguments);
- }
- function tsTypeOperator(typeAnnotation) {
- return (0, _builder.default)("TSTypeOperator", ...arguments);
- }
- function tsIndexedAccessType(objectType, indexType) {
- return (0, _builder.default)("TSIndexedAccessType", ...arguments);
- }
- function tsMappedType(typeParameter, typeAnnotation, nameType) {
- return (0, _builder.default)("TSMappedType", ...arguments);
- }
- function tsLiteralType(literal) {
- return (0, _builder.default)("TSLiteralType", ...arguments);
- }
- function tsExpressionWithTypeArguments(expression, typeParameters) {
- return (0, _builder.default)("TSExpressionWithTypeArguments", ...arguments);
- }
- function tsInterfaceDeclaration(id, typeParameters, _extends, body) {
- return (0, _builder.default)("TSInterfaceDeclaration", ...arguments);
- }
- function tsInterfaceBody(body) {
- return (0, _builder.default)("TSInterfaceBody", ...arguments);
- }
- function tsTypeAliasDeclaration(id, typeParameters, typeAnnotation) {
- return (0, _builder.default)("TSTypeAliasDeclaration", ...arguments);
- }
- function tsAsExpression(expression, typeAnnotation) {
- return (0, _builder.default)("TSAsExpression", ...arguments);
- }
- function tsTypeAssertion(typeAnnotation, expression) {
- return (0, _builder.default)("TSTypeAssertion", ...arguments);
- }
- function tsEnumDeclaration(id, members) {
- return (0, _builder.default)("TSEnumDeclaration", ...arguments);
- }
- function tsEnumMember(id, initializer) {
- return (0, _builder.default)("TSEnumMember", ...arguments);
- }
- function tsModuleDeclaration(id, body) {
- return (0, _builder.default)("TSModuleDeclaration", ...arguments);
- }
- function tsModuleBlock(body) {
- return (0, _builder.default)("TSModuleBlock", ...arguments);
- }
- function tsImportType(argument, qualifier, typeParameters) {
- return (0, _builder.default)("TSImportType", ...arguments);
- }
- function tsImportEqualsDeclaration(id, moduleReference) {
- return (0, _builder.default)("TSImportEqualsDeclaration", ...arguments);
- }
- function tsExternalModuleReference(expression) {
- return (0, _builder.default)("TSExternalModuleReference", ...arguments);
- }
- function tsNonNullExpression(expression) {
- return (0, _builder.default)("TSNonNullExpression", ...arguments);
- }
- function tsExportAssignment(expression) {
- return (0, _builder.default)("TSExportAssignment", ...arguments);
- }
- function tsNamespaceExportDeclaration(id) {
- return (0, _builder.default)("TSNamespaceExportDeclaration", ...arguments);
- }
- function tsTypeAnnotation(typeAnnotation) {
- return (0, _builder.default)("TSTypeAnnotation", ...arguments);
- }
- function tsTypeParameterInstantiation(params) {
- return (0, _builder.default)("TSTypeParameterInstantiation", ...arguments);
- }
- function tsTypeParameterDeclaration(params) {
- return (0, _builder.default)("TSTypeParameterDeclaration", ...arguments);
- }
- function tsTypeParameter(constraint, _default, name) {
- return (0, _builder.default)("TSTypeParameter", ...arguments);
- }
- function NumberLiteral(...args) {
- console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
- return (0, _builder.default)("NumberLiteral", ...args);
- }
- function RegexLiteral(...args) {
- console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
- return (0, _builder.default)("RegexLiteral", ...args);
- }
- function RestProperty(...args) {
- console.trace("The node type RestProperty has been renamed to RestElement");
- return (0, _builder.default)("RestProperty", ...args);
- }
- function SpreadProperty(...args) {
- console.trace("The node type SpreadProperty has been renamed to SpreadElement");
- return (0, _builder.default)("SpreadProperty", ...args);
- }
- Object.defineProperty(cleanJSXElementLiteralChild$1, "__esModule", {
- value: true
- });
- cleanJSXElementLiteralChild$1.default = cleanJSXElementLiteralChild;
- var _generated$n = generated$3;
- function cleanJSXElementLiteralChild(child, args) {
- const lines = child.value.split(/\r\n|\n|\r/);
- let lastNonEmptyLine = 0;
- for (let i = 0; i < lines.length; i++) {
- if (lines[i].match(/[^ \t]/)) {
- lastNonEmptyLine = i;
- }
- }
- let str = "";
- for (let i = 0; i < lines.length; i++) {
- const line = lines[i];
- const isFirstLine = i === 0;
- const isLastLine = i === lines.length - 1;
- const isLastNonEmptyLine = i === lastNonEmptyLine;
- let trimmedLine = line.replace(/\t/g, " ");
- if (!isFirstLine) {
- trimmedLine = trimmedLine.replace(/^[ ]+/, "");
- }
- if (!isLastLine) {
- trimmedLine = trimmedLine.replace(/[ ]+$/, "");
- }
- if (trimmedLine) {
- if (!isLastNonEmptyLine) {
- trimmedLine += " ";
- }
- str += trimmedLine;
- }
- }
- if (str) args.push((0, _generated$n.stringLiteral)(str));
- }
- Object.defineProperty(buildChildren$1, "__esModule", {
- value: true
- });
- buildChildren$1.default = buildChildren;
- var _generated$m = generated$4;
- var _cleanJSXElementLiteralChild = cleanJSXElementLiteralChild$1;
- function buildChildren(node) {
- const elements = [];
- for (let i = 0; i < node.children.length; i++) {
- let child = node.children[i];
- if ((0, _generated$m.isJSXText)(child)) {
- (0, _cleanJSXElementLiteralChild.default)(child, elements);
- continue;
- }
- if ((0, _generated$m.isJSXExpressionContainer)(child)) child = child.expression;
- if ((0, _generated$m.isJSXEmptyExpression)(child)) continue;
- elements.push(child);
- }
- return elements;
- }
- var assertNode$1 = {};
- var isNode$1 = {};
- Object.defineProperty(isNode$1, "__esModule", {
- value: true
- });
- isNode$1.default = isNode;
- var _definitions$5 = definitions;
- function isNode(node) {
- return !!(node && _definitions$5.VISITOR_KEYS[node.type]);
- }
- Object.defineProperty(assertNode$1, "__esModule", {
- value: true
- });
- assertNode$1.default = assertNode;
- var _isNode = isNode$1;
- function assertNode(node) {
- if (!(0, _isNode.default)(node)) {
- var _node$type;
- const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node);
- throw new TypeError(`Not a valid node of type "${type}"`);
- }
- }
- var generated$2 = {};
- Object.defineProperty(generated$2, "__esModule", {
- value: true
- });
- generated$2.assertArrayExpression = assertArrayExpression;
- generated$2.assertAssignmentExpression = assertAssignmentExpression;
- generated$2.assertBinaryExpression = assertBinaryExpression;
- generated$2.assertInterpreterDirective = assertInterpreterDirective;
- generated$2.assertDirective = assertDirective;
- generated$2.assertDirectiveLiteral = assertDirectiveLiteral;
- generated$2.assertBlockStatement = assertBlockStatement;
- generated$2.assertBreakStatement = assertBreakStatement;
- generated$2.assertCallExpression = assertCallExpression;
- generated$2.assertCatchClause = assertCatchClause;
- generated$2.assertConditionalExpression = assertConditionalExpression;
- generated$2.assertContinueStatement = assertContinueStatement;
- generated$2.assertDebuggerStatement = assertDebuggerStatement;
- generated$2.assertDoWhileStatement = assertDoWhileStatement;
- generated$2.assertEmptyStatement = assertEmptyStatement;
- generated$2.assertExpressionStatement = assertExpressionStatement;
- generated$2.assertFile = assertFile;
- generated$2.assertForInStatement = assertForInStatement;
- generated$2.assertForStatement = assertForStatement;
- generated$2.assertFunctionDeclaration = assertFunctionDeclaration;
- generated$2.assertFunctionExpression = assertFunctionExpression;
- generated$2.assertIdentifier = assertIdentifier;
- generated$2.assertIfStatement = assertIfStatement;
- generated$2.assertLabeledStatement = assertLabeledStatement;
- generated$2.assertStringLiteral = assertStringLiteral;
- generated$2.assertNumericLiteral = assertNumericLiteral;
- generated$2.assertNullLiteral = assertNullLiteral;
- generated$2.assertBooleanLiteral = assertBooleanLiteral;
- generated$2.assertRegExpLiteral = assertRegExpLiteral;
- generated$2.assertLogicalExpression = assertLogicalExpression;
- generated$2.assertMemberExpression = assertMemberExpression;
- generated$2.assertNewExpression = assertNewExpression;
- generated$2.assertProgram = assertProgram;
- generated$2.assertObjectExpression = assertObjectExpression;
- generated$2.assertObjectMethod = assertObjectMethod;
- generated$2.assertObjectProperty = assertObjectProperty;
- generated$2.assertRestElement = assertRestElement;
- generated$2.assertReturnStatement = assertReturnStatement;
- generated$2.assertSequenceExpression = assertSequenceExpression;
- generated$2.assertParenthesizedExpression = assertParenthesizedExpression;
- generated$2.assertSwitchCase = assertSwitchCase;
- generated$2.assertSwitchStatement = assertSwitchStatement;
- generated$2.assertThisExpression = assertThisExpression;
- generated$2.assertThrowStatement = assertThrowStatement;
- generated$2.assertTryStatement = assertTryStatement;
- generated$2.assertUnaryExpression = assertUnaryExpression;
- generated$2.assertUpdateExpression = assertUpdateExpression;
- generated$2.assertVariableDeclaration = assertVariableDeclaration;
- generated$2.assertVariableDeclarator = assertVariableDeclarator;
- generated$2.assertWhileStatement = assertWhileStatement;
- generated$2.assertWithStatement = assertWithStatement;
- generated$2.assertAssignmentPattern = assertAssignmentPattern;
- generated$2.assertArrayPattern = assertArrayPattern;
- generated$2.assertArrowFunctionExpression = assertArrowFunctionExpression;
- generated$2.assertClassBody = assertClassBody;
- generated$2.assertClassExpression = assertClassExpression;
- generated$2.assertClassDeclaration = assertClassDeclaration;
- generated$2.assertExportAllDeclaration = assertExportAllDeclaration;
- generated$2.assertExportDefaultDeclaration = assertExportDefaultDeclaration;
- generated$2.assertExportNamedDeclaration = assertExportNamedDeclaration;
- generated$2.assertExportSpecifier = assertExportSpecifier;
- generated$2.assertForOfStatement = assertForOfStatement;
- generated$2.assertImportDeclaration = assertImportDeclaration;
- generated$2.assertImportDefaultSpecifier = assertImportDefaultSpecifier;
- generated$2.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier;
- generated$2.assertImportSpecifier = assertImportSpecifier;
- generated$2.assertMetaProperty = assertMetaProperty;
- generated$2.assertClassMethod = assertClassMethod;
- generated$2.assertObjectPattern = assertObjectPattern;
- generated$2.assertSpreadElement = assertSpreadElement;
- generated$2.assertSuper = assertSuper;
- generated$2.assertTaggedTemplateExpression = assertTaggedTemplateExpression;
- generated$2.assertTemplateElement = assertTemplateElement;
- generated$2.assertTemplateLiteral = assertTemplateLiteral;
- generated$2.assertYieldExpression = assertYieldExpression;
- generated$2.assertAwaitExpression = assertAwaitExpression;
- generated$2.assertImport = assertImport;
- generated$2.assertBigIntLiteral = assertBigIntLiteral;
- generated$2.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier;
- generated$2.assertOptionalMemberExpression = assertOptionalMemberExpression;
- generated$2.assertOptionalCallExpression = assertOptionalCallExpression;
- generated$2.assertClassProperty = assertClassProperty;
- generated$2.assertClassPrivateProperty = assertClassPrivateProperty;
- generated$2.assertClassPrivateMethod = assertClassPrivateMethod;
- generated$2.assertPrivateName = assertPrivateName;
- generated$2.assertAnyTypeAnnotation = assertAnyTypeAnnotation;
- generated$2.assertArrayTypeAnnotation = assertArrayTypeAnnotation;
- generated$2.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation;
- generated$2.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation;
- generated$2.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation;
- generated$2.assertClassImplements = assertClassImplements;
- generated$2.assertDeclareClass = assertDeclareClass;
- generated$2.assertDeclareFunction = assertDeclareFunction;
- generated$2.assertDeclareInterface = assertDeclareInterface;
- generated$2.assertDeclareModule = assertDeclareModule;
- generated$2.assertDeclareModuleExports = assertDeclareModuleExports;
- generated$2.assertDeclareTypeAlias = assertDeclareTypeAlias;
- generated$2.assertDeclareOpaqueType = assertDeclareOpaqueType;
- generated$2.assertDeclareVariable = assertDeclareVariable;
- generated$2.assertDeclareExportDeclaration = assertDeclareExportDeclaration;
- generated$2.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration;
- generated$2.assertDeclaredPredicate = assertDeclaredPredicate;
- generated$2.assertExistsTypeAnnotation = assertExistsTypeAnnotation;
- generated$2.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation;
- generated$2.assertFunctionTypeParam = assertFunctionTypeParam;
- generated$2.assertGenericTypeAnnotation = assertGenericTypeAnnotation;
- generated$2.assertInferredPredicate = assertInferredPredicate;
- generated$2.assertInterfaceExtends = assertInterfaceExtends;
- generated$2.assertInterfaceDeclaration = assertInterfaceDeclaration;
- generated$2.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation;
- generated$2.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation;
- generated$2.assertMixedTypeAnnotation = assertMixedTypeAnnotation;
- generated$2.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation;
- generated$2.assertNullableTypeAnnotation = assertNullableTypeAnnotation;
- generated$2.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation;
- generated$2.assertNumberTypeAnnotation = assertNumberTypeAnnotation;
- generated$2.assertObjectTypeAnnotation = assertObjectTypeAnnotation;
- generated$2.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot;
- generated$2.assertObjectTypeCallProperty = assertObjectTypeCallProperty;
- generated$2.assertObjectTypeIndexer = assertObjectTypeIndexer;
- generated$2.assertObjectTypeProperty = assertObjectTypeProperty;
- generated$2.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty;
- generated$2.assertOpaqueType = assertOpaqueType;
- generated$2.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier;
- generated$2.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation;
- generated$2.assertStringTypeAnnotation = assertStringTypeAnnotation;
- generated$2.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation;
- generated$2.assertThisTypeAnnotation = assertThisTypeAnnotation;
- generated$2.assertTupleTypeAnnotation = assertTupleTypeAnnotation;
- generated$2.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation;
- generated$2.assertTypeAlias = assertTypeAlias;
- generated$2.assertTypeAnnotation = assertTypeAnnotation;
- generated$2.assertTypeCastExpression = assertTypeCastExpression;
- generated$2.assertTypeParameter = assertTypeParameter;
- generated$2.assertTypeParameterDeclaration = assertTypeParameterDeclaration;
- generated$2.assertTypeParameterInstantiation = assertTypeParameterInstantiation;
- generated$2.assertUnionTypeAnnotation = assertUnionTypeAnnotation;
- generated$2.assertVariance = assertVariance;
- generated$2.assertVoidTypeAnnotation = assertVoidTypeAnnotation;
- generated$2.assertEnumDeclaration = assertEnumDeclaration;
- generated$2.assertEnumBooleanBody = assertEnumBooleanBody;
- generated$2.assertEnumNumberBody = assertEnumNumberBody;
- generated$2.assertEnumStringBody = assertEnumStringBody;
- generated$2.assertEnumSymbolBody = assertEnumSymbolBody;
- generated$2.assertEnumBooleanMember = assertEnumBooleanMember;
- generated$2.assertEnumNumberMember = assertEnumNumberMember;
- generated$2.assertEnumStringMember = assertEnumStringMember;
- generated$2.assertEnumDefaultedMember = assertEnumDefaultedMember;
- generated$2.assertIndexedAccessType = assertIndexedAccessType;
- generated$2.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType;
- generated$2.assertJSXAttribute = assertJSXAttribute;
- generated$2.assertJSXClosingElement = assertJSXClosingElement;
- generated$2.assertJSXElement = assertJSXElement;
- generated$2.assertJSXEmptyExpression = assertJSXEmptyExpression;
- generated$2.assertJSXExpressionContainer = assertJSXExpressionContainer;
- generated$2.assertJSXSpreadChild = assertJSXSpreadChild;
- generated$2.assertJSXIdentifier = assertJSXIdentifier;
- generated$2.assertJSXMemberExpression = assertJSXMemberExpression;
- generated$2.assertJSXNamespacedName = assertJSXNamespacedName;
- generated$2.assertJSXOpeningElement = assertJSXOpeningElement;
- generated$2.assertJSXSpreadAttribute = assertJSXSpreadAttribute;
- generated$2.assertJSXText = assertJSXText;
- generated$2.assertJSXFragment = assertJSXFragment;
- generated$2.assertJSXOpeningFragment = assertJSXOpeningFragment;
- generated$2.assertJSXClosingFragment = assertJSXClosingFragment;
- generated$2.assertNoop = assertNoop;
- generated$2.assertPlaceholder = assertPlaceholder;
- generated$2.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier;
- generated$2.assertArgumentPlaceholder = assertArgumentPlaceholder;
- generated$2.assertBindExpression = assertBindExpression;
- generated$2.assertImportAttribute = assertImportAttribute;
- generated$2.assertDecorator = assertDecorator;
- generated$2.assertDoExpression = assertDoExpression;
- generated$2.assertExportDefaultSpecifier = assertExportDefaultSpecifier;
- generated$2.assertRecordExpression = assertRecordExpression;
- generated$2.assertTupleExpression = assertTupleExpression;
- generated$2.assertDecimalLiteral = assertDecimalLiteral;
- generated$2.assertStaticBlock = assertStaticBlock;
- generated$2.assertModuleExpression = assertModuleExpression;
- generated$2.assertTopicReference = assertTopicReference;
- generated$2.assertPipelineTopicExpression = assertPipelineTopicExpression;
- generated$2.assertPipelineBareFunction = assertPipelineBareFunction;
- generated$2.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference;
- generated$2.assertTSParameterProperty = assertTSParameterProperty;
- generated$2.assertTSDeclareFunction = assertTSDeclareFunction;
- generated$2.assertTSDeclareMethod = assertTSDeclareMethod;
- generated$2.assertTSQualifiedName = assertTSQualifiedName;
- generated$2.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration;
- generated$2.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration;
- generated$2.assertTSPropertySignature = assertTSPropertySignature;
- generated$2.assertTSMethodSignature = assertTSMethodSignature;
- generated$2.assertTSIndexSignature = assertTSIndexSignature;
- generated$2.assertTSAnyKeyword = assertTSAnyKeyword;
- generated$2.assertTSBooleanKeyword = assertTSBooleanKeyword;
- generated$2.assertTSBigIntKeyword = assertTSBigIntKeyword;
- generated$2.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword;
- generated$2.assertTSNeverKeyword = assertTSNeverKeyword;
- generated$2.assertTSNullKeyword = assertTSNullKeyword;
- generated$2.assertTSNumberKeyword = assertTSNumberKeyword;
- generated$2.assertTSObjectKeyword = assertTSObjectKeyword;
- generated$2.assertTSStringKeyword = assertTSStringKeyword;
- generated$2.assertTSSymbolKeyword = assertTSSymbolKeyword;
- generated$2.assertTSUndefinedKeyword = assertTSUndefinedKeyword;
- generated$2.assertTSUnknownKeyword = assertTSUnknownKeyword;
- generated$2.assertTSVoidKeyword = assertTSVoidKeyword;
- generated$2.assertTSThisType = assertTSThisType;
- generated$2.assertTSFunctionType = assertTSFunctionType;
- generated$2.assertTSConstructorType = assertTSConstructorType;
- generated$2.assertTSTypeReference = assertTSTypeReference;
- generated$2.assertTSTypePredicate = assertTSTypePredicate;
- generated$2.assertTSTypeQuery = assertTSTypeQuery;
- generated$2.assertTSTypeLiteral = assertTSTypeLiteral;
- generated$2.assertTSArrayType = assertTSArrayType;
- generated$2.assertTSTupleType = assertTSTupleType;
- generated$2.assertTSOptionalType = assertTSOptionalType;
- generated$2.assertTSRestType = assertTSRestType;
- generated$2.assertTSNamedTupleMember = assertTSNamedTupleMember;
- generated$2.assertTSUnionType = assertTSUnionType;
- generated$2.assertTSIntersectionType = assertTSIntersectionType;
- generated$2.assertTSConditionalType = assertTSConditionalType;
- generated$2.assertTSInferType = assertTSInferType;
- generated$2.assertTSParenthesizedType = assertTSParenthesizedType;
- generated$2.assertTSTypeOperator = assertTSTypeOperator;
- generated$2.assertTSIndexedAccessType = assertTSIndexedAccessType;
- generated$2.assertTSMappedType = assertTSMappedType;
- generated$2.assertTSLiteralType = assertTSLiteralType;
- generated$2.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments;
- generated$2.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration;
- generated$2.assertTSInterfaceBody = assertTSInterfaceBody;
- generated$2.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration;
- generated$2.assertTSAsExpression = assertTSAsExpression;
- generated$2.assertTSTypeAssertion = assertTSTypeAssertion;
- generated$2.assertTSEnumDeclaration = assertTSEnumDeclaration;
- generated$2.assertTSEnumMember = assertTSEnumMember;
- generated$2.assertTSModuleDeclaration = assertTSModuleDeclaration;
- generated$2.assertTSModuleBlock = assertTSModuleBlock;
- generated$2.assertTSImportType = assertTSImportType;
- generated$2.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration;
- generated$2.assertTSExternalModuleReference = assertTSExternalModuleReference;
- generated$2.assertTSNonNullExpression = assertTSNonNullExpression;
- generated$2.assertTSExportAssignment = assertTSExportAssignment;
- generated$2.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration;
- generated$2.assertTSTypeAnnotation = assertTSTypeAnnotation;
- generated$2.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation;
- generated$2.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration;
- generated$2.assertTSTypeParameter = assertTSTypeParameter;
- generated$2.assertExpression = assertExpression;
- generated$2.assertBinary = assertBinary;
- generated$2.assertScopable = assertScopable;
- generated$2.assertBlockParent = assertBlockParent;
- generated$2.assertBlock = assertBlock;
- generated$2.assertStatement = assertStatement;
- generated$2.assertTerminatorless = assertTerminatorless;
- generated$2.assertCompletionStatement = assertCompletionStatement;
- generated$2.assertConditional = assertConditional;
- generated$2.assertLoop = assertLoop;
- generated$2.assertWhile = assertWhile;
- generated$2.assertExpressionWrapper = assertExpressionWrapper;
- generated$2.assertFor = assertFor;
- generated$2.assertForXStatement = assertForXStatement;
- generated$2.assertFunction = assertFunction;
- generated$2.assertFunctionParent = assertFunctionParent;
- generated$2.assertPureish = assertPureish;
- generated$2.assertDeclaration = assertDeclaration;
- generated$2.assertPatternLike = assertPatternLike;
- generated$2.assertLVal = assertLVal;
- generated$2.assertTSEntityName = assertTSEntityName;
- generated$2.assertLiteral = assertLiteral;
- generated$2.assertImmutable = assertImmutable;
- generated$2.assertUserWhitespacable = assertUserWhitespacable;
- generated$2.assertMethod = assertMethod;
- generated$2.assertObjectMember = assertObjectMember;
- generated$2.assertProperty = assertProperty;
- generated$2.assertUnaryLike = assertUnaryLike;
- generated$2.assertPattern = assertPattern;
- generated$2.assertClass = assertClass;
- generated$2.assertModuleDeclaration = assertModuleDeclaration;
- generated$2.assertExportDeclaration = assertExportDeclaration;
- generated$2.assertModuleSpecifier = assertModuleSpecifier;
- generated$2.assertPrivate = assertPrivate;
- generated$2.assertFlow = assertFlow;
- generated$2.assertFlowType = assertFlowType;
- generated$2.assertFlowBaseAnnotation = assertFlowBaseAnnotation;
- generated$2.assertFlowDeclaration = assertFlowDeclaration;
- generated$2.assertFlowPredicate = assertFlowPredicate;
- generated$2.assertEnumBody = assertEnumBody;
- generated$2.assertEnumMember = assertEnumMember;
- generated$2.assertJSX = assertJSX;
- generated$2.assertTSTypeElement = assertTSTypeElement;
- generated$2.assertTSType = assertTSType;
- generated$2.assertTSBaseType = assertTSBaseType;
- generated$2.assertNumberLiteral = assertNumberLiteral;
- generated$2.assertRegexLiteral = assertRegexLiteral;
- generated$2.assertRestProperty = assertRestProperty;
- generated$2.assertSpreadProperty = assertSpreadProperty;
- var _is = is$1;
- function assert$1(type, node, opts) {
- if (!(0, _is.default)(type, node, opts)) {
- throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`);
- }
- }
- function assertArrayExpression(node, opts) {
- assert$1("ArrayExpression", node, opts);
- }
- function assertAssignmentExpression(node, opts) {
- assert$1("AssignmentExpression", node, opts);
- }
- function assertBinaryExpression(node, opts) {
- assert$1("BinaryExpression", node, opts);
- }
- function assertInterpreterDirective(node, opts) {
- assert$1("InterpreterDirective", node, opts);
- }
- function assertDirective(node, opts) {
- assert$1("Directive", node, opts);
- }
- function assertDirectiveLiteral(node, opts) {
- assert$1("DirectiveLiteral", node, opts);
- }
- function assertBlockStatement(node, opts) {
- assert$1("BlockStatement", node, opts);
- }
- function assertBreakStatement(node, opts) {
- assert$1("BreakStatement", node, opts);
- }
- function assertCallExpression(node, opts) {
- assert$1("CallExpression", node, opts);
- }
- function assertCatchClause(node, opts) {
- assert$1("CatchClause", node, opts);
- }
- function assertConditionalExpression(node, opts) {
- assert$1("ConditionalExpression", node, opts);
- }
- function assertContinueStatement(node, opts) {
- assert$1("ContinueStatement", node, opts);
- }
- function assertDebuggerStatement(node, opts) {
- assert$1("DebuggerStatement", node, opts);
- }
- function assertDoWhileStatement(node, opts) {
- assert$1("DoWhileStatement", node, opts);
- }
- function assertEmptyStatement(node, opts) {
- assert$1("EmptyStatement", node, opts);
- }
- function assertExpressionStatement(node, opts) {
- assert$1("ExpressionStatement", node, opts);
- }
- function assertFile(node, opts) {
- assert$1("File", node, opts);
- }
- function assertForInStatement(node, opts) {
- assert$1("ForInStatement", node, opts);
- }
- function assertForStatement(node, opts) {
- assert$1("ForStatement", node, opts);
- }
- function assertFunctionDeclaration(node, opts) {
- assert$1("FunctionDeclaration", node, opts);
- }
- function assertFunctionExpression(node, opts) {
- assert$1("FunctionExpression", node, opts);
- }
- function assertIdentifier(node, opts) {
- assert$1("Identifier", node, opts);
- }
- function assertIfStatement(node, opts) {
- assert$1("IfStatement", node, opts);
- }
- function assertLabeledStatement(node, opts) {
- assert$1("LabeledStatement", node, opts);
- }
- function assertStringLiteral(node, opts) {
- assert$1("StringLiteral", node, opts);
- }
- function assertNumericLiteral(node, opts) {
- assert$1("NumericLiteral", node, opts);
- }
- function assertNullLiteral(node, opts) {
- assert$1("NullLiteral", node, opts);
- }
- function assertBooleanLiteral(node, opts) {
- assert$1("BooleanLiteral", node, opts);
- }
- function assertRegExpLiteral(node, opts) {
- assert$1("RegExpLiteral", node, opts);
- }
- function assertLogicalExpression(node, opts) {
- assert$1("LogicalExpression", node, opts);
- }
- function assertMemberExpression(node, opts) {
- assert$1("MemberExpression", node, opts);
- }
- function assertNewExpression(node, opts) {
- assert$1("NewExpression", node, opts);
- }
- function assertProgram(node, opts) {
- assert$1("Program", node, opts);
- }
- function assertObjectExpression(node, opts) {
- assert$1("ObjectExpression", node, opts);
- }
- function assertObjectMethod(node, opts) {
- assert$1("ObjectMethod", node, opts);
- }
- function assertObjectProperty(node, opts) {
- assert$1("ObjectProperty", node, opts);
- }
- function assertRestElement(node, opts) {
- assert$1("RestElement", node, opts);
- }
- function assertReturnStatement(node, opts) {
- assert$1("ReturnStatement", node, opts);
- }
- function assertSequenceExpression(node, opts) {
- assert$1("SequenceExpression", node, opts);
- }
- function assertParenthesizedExpression(node, opts) {
- assert$1("ParenthesizedExpression", node, opts);
- }
- function assertSwitchCase(node, opts) {
- assert$1("SwitchCase", node, opts);
- }
- function assertSwitchStatement(node, opts) {
- assert$1("SwitchStatement", node, opts);
- }
- function assertThisExpression(node, opts) {
- assert$1("ThisExpression", node, opts);
- }
- function assertThrowStatement(node, opts) {
- assert$1("ThrowStatement", node, opts);
- }
- function assertTryStatement(node, opts) {
- assert$1("TryStatement", node, opts);
- }
- function assertUnaryExpression(node, opts) {
- assert$1("UnaryExpression", node, opts);
- }
- function assertUpdateExpression(node, opts) {
- assert$1("UpdateExpression", node, opts);
- }
- function assertVariableDeclaration(node, opts) {
- assert$1("VariableDeclaration", node, opts);
- }
- function assertVariableDeclarator(node, opts) {
- assert$1("VariableDeclarator", node, opts);
- }
- function assertWhileStatement(node, opts) {
- assert$1("WhileStatement", node, opts);
- }
- function assertWithStatement(node, opts) {
- assert$1("WithStatement", node, opts);
- }
- function assertAssignmentPattern(node, opts) {
- assert$1("AssignmentPattern", node, opts);
- }
- function assertArrayPattern(node, opts) {
- assert$1("ArrayPattern", node, opts);
- }
- function assertArrowFunctionExpression(node, opts) {
- assert$1("ArrowFunctionExpression", node, opts);
- }
- function assertClassBody(node, opts) {
- assert$1("ClassBody", node, opts);
- }
- function assertClassExpression(node, opts) {
- assert$1("ClassExpression", node, opts);
- }
- function assertClassDeclaration(node, opts) {
- assert$1("ClassDeclaration", node, opts);
- }
- function assertExportAllDeclaration(node, opts) {
- assert$1("ExportAllDeclaration", node, opts);
- }
- function assertExportDefaultDeclaration(node, opts) {
- assert$1("ExportDefaultDeclaration", node, opts);
- }
- function assertExportNamedDeclaration(node, opts) {
- assert$1("ExportNamedDeclaration", node, opts);
- }
- function assertExportSpecifier(node, opts) {
- assert$1("ExportSpecifier", node, opts);
- }
- function assertForOfStatement(node, opts) {
- assert$1("ForOfStatement", node, opts);
- }
- function assertImportDeclaration(node, opts) {
- assert$1("ImportDeclaration", node, opts);
- }
- function assertImportDefaultSpecifier(node, opts) {
- assert$1("ImportDefaultSpecifier", node, opts);
- }
- function assertImportNamespaceSpecifier(node, opts) {
- assert$1("ImportNamespaceSpecifier", node, opts);
- }
- function assertImportSpecifier(node, opts) {
- assert$1("ImportSpecifier", node, opts);
- }
- function assertMetaProperty(node, opts) {
- assert$1("MetaProperty", node, opts);
- }
- function assertClassMethod(node, opts) {
- assert$1("ClassMethod", node, opts);
- }
- function assertObjectPattern(node, opts) {
- assert$1("ObjectPattern", node, opts);
- }
- function assertSpreadElement(node, opts) {
- assert$1("SpreadElement", node, opts);
- }
- function assertSuper(node, opts) {
- assert$1("Super", node, opts);
- }
- function assertTaggedTemplateExpression(node, opts) {
- assert$1("TaggedTemplateExpression", node, opts);
- }
- function assertTemplateElement(node, opts) {
- assert$1("TemplateElement", node, opts);
- }
- function assertTemplateLiteral(node, opts) {
- assert$1("TemplateLiteral", node, opts);
- }
- function assertYieldExpression(node, opts) {
- assert$1("YieldExpression", node, opts);
- }
- function assertAwaitExpression(node, opts) {
- assert$1("AwaitExpression", node, opts);
- }
- function assertImport(node, opts) {
- assert$1("Import", node, opts);
- }
- function assertBigIntLiteral(node, opts) {
- assert$1("BigIntLiteral", node, opts);
- }
- function assertExportNamespaceSpecifier(node, opts) {
- assert$1("ExportNamespaceSpecifier", node, opts);
- }
- function assertOptionalMemberExpression(node, opts) {
- assert$1("OptionalMemberExpression", node, opts);
- }
- function assertOptionalCallExpression(node, opts) {
- assert$1("OptionalCallExpression", node, opts);
- }
- function assertClassProperty(node, opts) {
- assert$1("ClassProperty", node, opts);
- }
- function assertClassPrivateProperty(node, opts) {
- assert$1("ClassPrivateProperty", node, opts);
- }
- function assertClassPrivateMethod(node, opts) {
- assert$1("ClassPrivateMethod", node, opts);
- }
- function assertPrivateName(node, opts) {
- assert$1("PrivateName", node, opts);
- }
- function assertAnyTypeAnnotation(node, opts) {
- assert$1("AnyTypeAnnotation", node, opts);
- }
- function assertArrayTypeAnnotation(node, opts) {
- assert$1("ArrayTypeAnnotation", node, opts);
- }
- function assertBooleanTypeAnnotation(node, opts) {
- assert$1("BooleanTypeAnnotation", node, opts);
- }
- function assertBooleanLiteralTypeAnnotation(node, opts) {
- assert$1("BooleanLiteralTypeAnnotation", node, opts);
- }
- function assertNullLiteralTypeAnnotation(node, opts) {
- assert$1("NullLiteralTypeAnnotation", node, opts);
- }
- function assertClassImplements(node, opts) {
- assert$1("ClassImplements", node, opts);
- }
- function assertDeclareClass(node, opts) {
- assert$1("DeclareClass", node, opts);
- }
- function assertDeclareFunction(node, opts) {
- assert$1("DeclareFunction", node, opts);
- }
- function assertDeclareInterface(node, opts) {
- assert$1("DeclareInterface", node, opts);
- }
- function assertDeclareModule(node, opts) {
- assert$1("DeclareModule", node, opts);
- }
- function assertDeclareModuleExports(node, opts) {
- assert$1("DeclareModuleExports", node, opts);
- }
- function assertDeclareTypeAlias(node, opts) {
- assert$1("DeclareTypeAlias", node, opts);
- }
- function assertDeclareOpaqueType(node, opts) {
- assert$1("DeclareOpaqueType", node, opts);
- }
- function assertDeclareVariable(node, opts) {
- assert$1("DeclareVariable", node, opts);
- }
- function assertDeclareExportDeclaration(node, opts) {
- assert$1("DeclareExportDeclaration", node, opts);
- }
- function assertDeclareExportAllDeclaration(node, opts) {
- assert$1("DeclareExportAllDeclaration", node, opts);
- }
- function assertDeclaredPredicate(node, opts) {
- assert$1("DeclaredPredicate", node, opts);
- }
- function assertExistsTypeAnnotation(node, opts) {
- assert$1("ExistsTypeAnnotation", node, opts);
- }
- function assertFunctionTypeAnnotation(node, opts) {
- assert$1("FunctionTypeAnnotation", node, opts);
- }
- function assertFunctionTypeParam(node, opts) {
- assert$1("FunctionTypeParam", node, opts);
- }
- function assertGenericTypeAnnotation(node, opts) {
- assert$1("GenericTypeAnnotation", node, opts);
- }
- function assertInferredPredicate(node, opts) {
- assert$1("InferredPredicate", node, opts);
- }
- function assertInterfaceExtends(node, opts) {
- assert$1("InterfaceExtends", node, opts);
- }
- function assertInterfaceDeclaration(node, opts) {
- assert$1("InterfaceDeclaration", node, opts);
- }
- function assertInterfaceTypeAnnotation(node, opts) {
- assert$1("InterfaceTypeAnnotation", node, opts);
- }
- function assertIntersectionTypeAnnotation(node, opts) {
- assert$1("IntersectionTypeAnnotation", node, opts);
- }
- function assertMixedTypeAnnotation(node, opts) {
- assert$1("MixedTypeAnnotation", node, opts);
- }
- function assertEmptyTypeAnnotation(node, opts) {
- assert$1("EmptyTypeAnnotation", node, opts);
- }
- function assertNullableTypeAnnotation(node, opts) {
- assert$1("NullableTypeAnnotation", node, opts);
- }
- function assertNumberLiteralTypeAnnotation(node, opts) {
- assert$1("NumberLiteralTypeAnnotation", node, opts);
- }
- function assertNumberTypeAnnotation(node, opts) {
- assert$1("NumberTypeAnnotation", node, opts);
- }
- function assertObjectTypeAnnotation(node, opts) {
- assert$1("ObjectTypeAnnotation", node, opts);
- }
- function assertObjectTypeInternalSlot(node, opts) {
- assert$1("ObjectTypeInternalSlot", node, opts);
- }
- function assertObjectTypeCallProperty(node, opts) {
- assert$1("ObjectTypeCallProperty", node, opts);
- }
- function assertObjectTypeIndexer(node, opts) {
- assert$1("ObjectTypeIndexer", node, opts);
- }
- function assertObjectTypeProperty(node, opts) {
- assert$1("ObjectTypeProperty", node, opts);
- }
- function assertObjectTypeSpreadProperty(node, opts) {
- assert$1("ObjectTypeSpreadProperty", node, opts);
- }
- function assertOpaqueType(node, opts) {
- assert$1("OpaqueType", node, opts);
- }
- function assertQualifiedTypeIdentifier(node, opts) {
- assert$1("QualifiedTypeIdentifier", node, opts);
- }
- function assertStringLiteralTypeAnnotation(node, opts) {
- assert$1("StringLiteralTypeAnnotation", node, opts);
- }
- function assertStringTypeAnnotation(node, opts) {
- assert$1("StringTypeAnnotation", node, opts);
- }
- function assertSymbolTypeAnnotation(node, opts) {
- assert$1("SymbolTypeAnnotation", node, opts);
- }
- function assertThisTypeAnnotation(node, opts) {
- assert$1("ThisTypeAnnotation", node, opts);
- }
- function assertTupleTypeAnnotation(node, opts) {
- assert$1("TupleTypeAnnotation", node, opts);
- }
- function assertTypeofTypeAnnotation(node, opts) {
- assert$1("TypeofTypeAnnotation", node, opts);
- }
- function assertTypeAlias(node, opts) {
- assert$1("TypeAlias", node, opts);
- }
- function assertTypeAnnotation(node, opts) {
- assert$1("TypeAnnotation", node, opts);
- }
- function assertTypeCastExpression(node, opts) {
- assert$1("TypeCastExpression", node, opts);
- }
- function assertTypeParameter(node, opts) {
- assert$1("TypeParameter", node, opts);
- }
- function assertTypeParameterDeclaration(node, opts) {
- assert$1("TypeParameterDeclaration", node, opts);
- }
- function assertTypeParameterInstantiation(node, opts) {
- assert$1("TypeParameterInstantiation", node, opts);
- }
- function assertUnionTypeAnnotation(node, opts) {
- assert$1("UnionTypeAnnotation", node, opts);
- }
- function assertVariance(node, opts) {
- assert$1("Variance", node, opts);
- }
- function assertVoidTypeAnnotation(node, opts) {
- assert$1("VoidTypeAnnotation", node, opts);
- }
- function assertEnumDeclaration(node, opts) {
- assert$1("EnumDeclaration", node, opts);
- }
- function assertEnumBooleanBody(node, opts) {
- assert$1("EnumBooleanBody", node, opts);
- }
- function assertEnumNumberBody(node, opts) {
- assert$1("EnumNumberBody", node, opts);
- }
- function assertEnumStringBody(node, opts) {
- assert$1("EnumStringBody", node, opts);
- }
- function assertEnumSymbolBody(node, opts) {
- assert$1("EnumSymbolBody", node, opts);
- }
- function assertEnumBooleanMember(node, opts) {
- assert$1("EnumBooleanMember", node, opts);
- }
- function assertEnumNumberMember(node, opts) {
- assert$1("EnumNumberMember", node, opts);
- }
- function assertEnumStringMember(node, opts) {
- assert$1("EnumStringMember", node, opts);
- }
- function assertEnumDefaultedMember(node, opts) {
- assert$1("EnumDefaultedMember", node, opts);
- }
- function assertIndexedAccessType(node, opts) {
- assert$1("IndexedAccessType", node, opts);
- }
- function assertOptionalIndexedAccessType(node, opts) {
- assert$1("OptionalIndexedAccessType", node, opts);
- }
- function assertJSXAttribute(node, opts) {
- assert$1("JSXAttribute", node, opts);
- }
- function assertJSXClosingElement(node, opts) {
- assert$1("JSXClosingElement", node, opts);
- }
- function assertJSXElement(node, opts) {
- assert$1("JSXElement", node, opts);
- }
- function assertJSXEmptyExpression(node, opts) {
- assert$1("JSXEmptyExpression", node, opts);
- }
- function assertJSXExpressionContainer(node, opts) {
- assert$1("JSXExpressionContainer", node, opts);
- }
- function assertJSXSpreadChild(node, opts) {
- assert$1("JSXSpreadChild", node, opts);
- }
- function assertJSXIdentifier(node, opts) {
- assert$1("JSXIdentifier", node, opts);
- }
- function assertJSXMemberExpression(node, opts) {
- assert$1("JSXMemberExpression", node, opts);
- }
- function assertJSXNamespacedName(node, opts) {
- assert$1("JSXNamespacedName", node, opts);
- }
- function assertJSXOpeningElement(node, opts) {
- assert$1("JSXOpeningElement", node, opts);
- }
- function assertJSXSpreadAttribute(node, opts) {
- assert$1("JSXSpreadAttribute", node, opts);
- }
- function assertJSXText(node, opts) {
- assert$1("JSXText", node, opts);
- }
- function assertJSXFragment(node, opts) {
- assert$1("JSXFragment", node, opts);
- }
- function assertJSXOpeningFragment(node, opts) {
- assert$1("JSXOpeningFragment", node, opts);
- }
- function assertJSXClosingFragment(node, opts) {
- assert$1("JSXClosingFragment", node, opts);
- }
- function assertNoop(node, opts) {
- assert$1("Noop", node, opts);
- }
- function assertPlaceholder(node, opts) {
- assert$1("Placeholder", node, opts);
- }
- function assertV8IntrinsicIdentifier(node, opts) {
- assert$1("V8IntrinsicIdentifier", node, opts);
- }
- function assertArgumentPlaceholder(node, opts) {
- assert$1("ArgumentPlaceholder", node, opts);
- }
- function assertBindExpression(node, opts) {
- assert$1("BindExpression", node, opts);
- }
- function assertImportAttribute(node, opts) {
- assert$1("ImportAttribute", node, opts);
- }
- function assertDecorator(node, opts) {
- assert$1("Decorator", node, opts);
- }
- function assertDoExpression(node, opts) {
- assert$1("DoExpression", node, opts);
- }
- function assertExportDefaultSpecifier(node, opts) {
- assert$1("ExportDefaultSpecifier", node, opts);
- }
- function assertRecordExpression(node, opts) {
- assert$1("RecordExpression", node, opts);
- }
- function assertTupleExpression(node, opts) {
- assert$1("TupleExpression", node, opts);
- }
- function assertDecimalLiteral(node, opts) {
- assert$1("DecimalLiteral", node, opts);
- }
- function assertStaticBlock(node, opts) {
- assert$1("StaticBlock", node, opts);
- }
- function assertModuleExpression(node, opts) {
- assert$1("ModuleExpression", node, opts);
- }
- function assertTopicReference(node, opts) {
- assert$1("TopicReference", node, opts);
- }
- function assertPipelineTopicExpression(node, opts) {
- assert$1("PipelineTopicExpression", node, opts);
- }
- function assertPipelineBareFunction(node, opts) {
- assert$1("PipelineBareFunction", node, opts);
- }
- function assertPipelinePrimaryTopicReference(node, opts) {
- assert$1("PipelinePrimaryTopicReference", node, opts);
- }
- function assertTSParameterProperty(node, opts) {
- assert$1("TSParameterProperty", node, opts);
- }
- function assertTSDeclareFunction(node, opts) {
- assert$1("TSDeclareFunction", node, opts);
- }
- function assertTSDeclareMethod(node, opts) {
- assert$1("TSDeclareMethod", node, opts);
- }
- function assertTSQualifiedName(node, opts) {
- assert$1("TSQualifiedName", node, opts);
- }
- function assertTSCallSignatureDeclaration(node, opts) {
- assert$1("TSCallSignatureDeclaration", node, opts);
- }
- function assertTSConstructSignatureDeclaration(node, opts) {
- assert$1("TSConstructSignatureDeclaration", node, opts);
- }
- function assertTSPropertySignature(node, opts) {
- assert$1("TSPropertySignature", node, opts);
- }
- function assertTSMethodSignature(node, opts) {
- assert$1("TSMethodSignature", node, opts);
- }
- function assertTSIndexSignature(node, opts) {
- assert$1("TSIndexSignature", node, opts);
- }
- function assertTSAnyKeyword(node, opts) {
- assert$1("TSAnyKeyword", node, opts);
- }
- function assertTSBooleanKeyword(node, opts) {
- assert$1("TSBooleanKeyword", node, opts);
- }
- function assertTSBigIntKeyword(node, opts) {
- assert$1("TSBigIntKeyword", node, opts);
- }
- function assertTSIntrinsicKeyword(node, opts) {
- assert$1("TSIntrinsicKeyword", node, opts);
- }
- function assertTSNeverKeyword(node, opts) {
- assert$1("TSNeverKeyword", node, opts);
- }
- function assertTSNullKeyword(node, opts) {
- assert$1("TSNullKeyword", node, opts);
- }
- function assertTSNumberKeyword(node, opts) {
- assert$1("TSNumberKeyword", node, opts);
- }
- function assertTSObjectKeyword(node, opts) {
- assert$1("TSObjectKeyword", node, opts);
- }
- function assertTSStringKeyword(node, opts) {
- assert$1("TSStringKeyword", node, opts);
- }
- function assertTSSymbolKeyword(node, opts) {
- assert$1("TSSymbolKeyword", node, opts);
- }
- function assertTSUndefinedKeyword(node, opts) {
- assert$1("TSUndefinedKeyword", node, opts);
- }
- function assertTSUnknownKeyword(node, opts) {
- assert$1("TSUnknownKeyword", node, opts);
- }
- function assertTSVoidKeyword(node, opts) {
- assert$1("TSVoidKeyword", node, opts);
- }
- function assertTSThisType(node, opts) {
- assert$1("TSThisType", node, opts);
- }
- function assertTSFunctionType(node, opts) {
- assert$1("TSFunctionType", node, opts);
- }
- function assertTSConstructorType(node, opts) {
- assert$1("TSConstructorType", node, opts);
- }
- function assertTSTypeReference(node, opts) {
- assert$1("TSTypeReference", node, opts);
- }
- function assertTSTypePredicate(node, opts) {
- assert$1("TSTypePredicate", node, opts);
- }
- function assertTSTypeQuery(node, opts) {
- assert$1("TSTypeQuery", node, opts);
- }
- function assertTSTypeLiteral(node, opts) {
- assert$1("TSTypeLiteral", node, opts);
- }
- function assertTSArrayType(node, opts) {
- assert$1("TSArrayType", node, opts);
- }
- function assertTSTupleType(node, opts) {
- assert$1("TSTupleType", node, opts);
- }
- function assertTSOptionalType(node, opts) {
- assert$1("TSOptionalType", node, opts);
- }
- function assertTSRestType(node, opts) {
- assert$1("TSRestType", node, opts);
- }
- function assertTSNamedTupleMember(node, opts) {
- assert$1("TSNamedTupleMember", node, opts);
- }
- function assertTSUnionType(node, opts) {
- assert$1("TSUnionType", node, opts);
- }
- function assertTSIntersectionType(node, opts) {
- assert$1("TSIntersectionType", node, opts);
- }
- function assertTSConditionalType(node, opts) {
- assert$1("TSConditionalType", node, opts);
- }
- function assertTSInferType(node, opts) {
- assert$1("TSInferType", node, opts);
- }
- function assertTSParenthesizedType(node, opts) {
- assert$1("TSParenthesizedType", node, opts);
- }
- function assertTSTypeOperator(node, opts) {
- assert$1("TSTypeOperator", node, opts);
- }
- function assertTSIndexedAccessType(node, opts) {
- assert$1("TSIndexedAccessType", node, opts);
- }
- function assertTSMappedType(node, opts) {
- assert$1("TSMappedType", node, opts);
- }
- function assertTSLiteralType(node, opts) {
- assert$1("TSLiteralType", node, opts);
- }
- function assertTSExpressionWithTypeArguments(node, opts) {
- assert$1("TSExpressionWithTypeArguments", node, opts);
- }
- function assertTSInterfaceDeclaration(node, opts) {
- assert$1("TSInterfaceDeclaration", node, opts);
- }
- function assertTSInterfaceBody(node, opts) {
- assert$1("TSInterfaceBody", node, opts);
- }
- function assertTSTypeAliasDeclaration(node, opts) {
- assert$1("TSTypeAliasDeclaration", node, opts);
- }
- function assertTSAsExpression(node, opts) {
- assert$1("TSAsExpression", node, opts);
- }
- function assertTSTypeAssertion(node, opts) {
- assert$1("TSTypeAssertion", node, opts);
- }
- function assertTSEnumDeclaration(node, opts) {
- assert$1("TSEnumDeclaration", node, opts);
- }
- function assertTSEnumMember(node, opts) {
- assert$1("TSEnumMember", node, opts);
- }
- function assertTSModuleDeclaration(node, opts) {
- assert$1("TSModuleDeclaration", node, opts);
- }
- function assertTSModuleBlock(node, opts) {
- assert$1("TSModuleBlock", node, opts);
- }
- function assertTSImportType(node, opts) {
- assert$1("TSImportType", node, opts);
- }
- function assertTSImportEqualsDeclaration(node, opts) {
- assert$1("TSImportEqualsDeclaration", node, opts);
- }
- function assertTSExternalModuleReference(node, opts) {
- assert$1("TSExternalModuleReference", node, opts);
- }
- function assertTSNonNullExpression(node, opts) {
- assert$1("TSNonNullExpression", node, opts);
- }
- function assertTSExportAssignment(node, opts) {
- assert$1("TSExportAssignment", node, opts);
- }
- function assertTSNamespaceExportDeclaration(node, opts) {
- assert$1("TSNamespaceExportDeclaration", node, opts);
- }
- function assertTSTypeAnnotation(node, opts) {
- assert$1("TSTypeAnnotation", node, opts);
- }
- function assertTSTypeParameterInstantiation(node, opts) {
- assert$1("TSTypeParameterInstantiation", node, opts);
- }
- function assertTSTypeParameterDeclaration(node, opts) {
- assert$1("TSTypeParameterDeclaration", node, opts);
- }
- function assertTSTypeParameter(node, opts) {
- assert$1("TSTypeParameter", node, opts);
- }
- function assertExpression(node, opts) {
- assert$1("Expression", node, opts);
- }
- function assertBinary(node, opts) {
- assert$1("Binary", node, opts);
- }
- function assertScopable(node, opts) {
- assert$1("Scopable", node, opts);
- }
- function assertBlockParent(node, opts) {
- assert$1("BlockParent", node, opts);
- }
- function assertBlock(node, opts) {
- assert$1("Block", node, opts);
- }
- function assertStatement(node, opts) {
- assert$1("Statement", node, opts);
- }
- function assertTerminatorless(node, opts) {
- assert$1("Terminatorless", node, opts);
- }
- function assertCompletionStatement(node, opts) {
- assert$1("CompletionStatement", node, opts);
- }
- function assertConditional(node, opts) {
- assert$1("Conditional", node, opts);
- }
- function assertLoop(node, opts) {
- assert$1("Loop", node, opts);
- }
- function assertWhile(node, opts) {
- assert$1("While", node, opts);
- }
- function assertExpressionWrapper(node, opts) {
- assert$1("ExpressionWrapper", node, opts);
- }
- function assertFor(node, opts) {
- assert$1("For", node, opts);
- }
- function assertForXStatement(node, opts) {
- assert$1("ForXStatement", node, opts);
- }
- function assertFunction(node, opts) {
- assert$1("Function", node, opts);
- }
- function assertFunctionParent(node, opts) {
- assert$1("FunctionParent", node, opts);
- }
- function assertPureish(node, opts) {
- assert$1("Pureish", node, opts);
- }
- function assertDeclaration(node, opts) {
- assert$1("Declaration", node, opts);
- }
- function assertPatternLike(node, opts) {
- assert$1("PatternLike", node, opts);
- }
- function assertLVal(node, opts) {
- assert$1("LVal", node, opts);
- }
- function assertTSEntityName(node, opts) {
- assert$1("TSEntityName", node, opts);
- }
- function assertLiteral(node, opts) {
- assert$1("Literal", node, opts);
- }
- function assertImmutable(node, opts) {
- assert$1("Immutable", node, opts);
- }
- function assertUserWhitespacable(node, opts) {
- assert$1("UserWhitespacable", node, opts);
- }
- function assertMethod(node, opts) {
- assert$1("Method", node, opts);
- }
- function assertObjectMember(node, opts) {
- assert$1("ObjectMember", node, opts);
- }
- function assertProperty(node, opts) {
- assert$1("Property", node, opts);
- }
- function assertUnaryLike(node, opts) {
- assert$1("UnaryLike", node, opts);
- }
- function assertPattern(node, opts) {
- assert$1("Pattern", node, opts);
- }
- function assertClass(node, opts) {
- assert$1("Class", node, opts);
- }
- function assertModuleDeclaration(node, opts) {
- assert$1("ModuleDeclaration", node, opts);
- }
- function assertExportDeclaration(node, opts) {
- assert$1("ExportDeclaration", node, opts);
- }
- function assertModuleSpecifier(node, opts) {
- assert$1("ModuleSpecifier", node, opts);
- }
- function assertPrivate(node, opts) {
- assert$1("Private", node, opts);
- }
- function assertFlow(node, opts) {
- assert$1("Flow", node, opts);
- }
- function assertFlowType(node, opts) {
- assert$1("FlowType", node, opts);
- }
- function assertFlowBaseAnnotation(node, opts) {
- assert$1("FlowBaseAnnotation", node, opts);
- }
- function assertFlowDeclaration(node, opts) {
- assert$1("FlowDeclaration", node, opts);
- }
- function assertFlowPredicate(node, opts) {
- assert$1("FlowPredicate", node, opts);
- }
- function assertEnumBody(node, opts) {
- assert$1("EnumBody", node, opts);
- }
- function assertEnumMember(node, opts) {
- assert$1("EnumMember", node, opts);
- }
- function assertJSX(node, opts) {
- assert$1("JSX", node, opts);
- }
- function assertTSTypeElement(node, opts) {
- assert$1("TSTypeElement", node, opts);
- }
- function assertTSType(node, opts) {
- assert$1("TSType", node, opts);
- }
- function assertTSBaseType(node, opts) {
- assert$1("TSBaseType", node, opts);
- }
- function assertNumberLiteral(node, opts) {
- console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
- assert$1("NumberLiteral", node, opts);
- }
- function assertRegexLiteral(node, opts) {
- console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
- assert$1("RegexLiteral", node, opts);
- }
- function assertRestProperty(node, opts) {
- console.trace("The node type RestProperty has been renamed to RestElement");
- assert$1("RestProperty", node, opts);
- }
- function assertSpreadProperty(node, opts) {
- console.trace("The node type SpreadProperty has been renamed to SpreadElement");
- assert$1("SpreadProperty", node, opts);
- }
- var createTypeAnnotationBasedOnTypeof$1 = {};
- Object.defineProperty(createTypeAnnotationBasedOnTypeof$1, "__esModule", {
- value: true
- });
- createTypeAnnotationBasedOnTypeof$1.default = createTypeAnnotationBasedOnTypeof;
- var _generated$l = generated$3;
- function createTypeAnnotationBasedOnTypeof(type) {
- if (type === "string") {
- return (0, _generated$l.stringTypeAnnotation)();
- } else if (type === "number") {
- return (0, _generated$l.numberTypeAnnotation)();
- } else if (type === "undefined") {
- return (0, _generated$l.voidTypeAnnotation)();
- } else if (type === "boolean") {
- return (0, _generated$l.booleanTypeAnnotation)();
- } else if (type === "function") {
- return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Function"));
- } else if (type === "object") {
- return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Object"));
- } else if (type === "symbol") {
- return (0, _generated$l.genericTypeAnnotation)((0, _generated$l.identifier)("Symbol"));
- } else if (type === "bigint") {
- return (0, _generated$l.anyTypeAnnotation)();
- } else {
- throw new Error("Invalid typeof value: " + type);
- }
- }
- var createFlowUnionType$1 = {};
- var removeTypeDuplicates$3 = {};
- Object.defineProperty(removeTypeDuplicates$3, "__esModule", {
- value: true
- });
- removeTypeDuplicates$3.default = removeTypeDuplicates$2;
- var _generated$k = generated$4;
- function getQualifiedName(node) {
- return (0, _generated$k.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`;
- }
- function removeTypeDuplicates$2(nodes) {
- const generics = {};
- const bases = {};
- const typeGroups = [];
- const types = [];
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if (!node) continue;
- if (types.indexOf(node) >= 0) {
- continue;
- }
- if ((0, _generated$k.isAnyTypeAnnotation)(node)) {
- return [node];
- }
- if ((0, _generated$k.isFlowBaseAnnotation)(node)) {
- bases[node.type] = node;
- continue;
- }
- if ((0, _generated$k.isUnionTypeAnnotation)(node)) {
- if (typeGroups.indexOf(node.types) < 0) {
- nodes = nodes.concat(node.types);
- typeGroups.push(node.types);
- }
- continue;
- }
- if ((0, _generated$k.isGenericTypeAnnotation)(node)) {
- const name = getQualifiedName(node.id);
- if (generics[name]) {
- let existing = generics[name];
- if (existing.typeParameters) {
- if (node.typeParameters) {
- existing.typeParameters.params = removeTypeDuplicates$2(existing.typeParameters.params.concat(node.typeParameters.params));
- }
- } else {
- existing = node.typeParameters;
- }
- } else {
- generics[name] = node;
- }
- continue;
- }
- types.push(node);
- }
- for (const type of Object.keys(bases)) {
- types.push(bases[type]);
- }
- for (const name of Object.keys(generics)) {
- types.push(generics[name]);
- }
- return types;
- }
- Object.defineProperty(createFlowUnionType$1, "__esModule", {
- value: true
- });
- createFlowUnionType$1.default = createFlowUnionType;
- var _generated$j = generated$3;
- var _removeTypeDuplicates$1 = removeTypeDuplicates$3;
- function createFlowUnionType(types) {
- const flattened = (0, _removeTypeDuplicates$1.default)(types);
- if (flattened.length === 1) {
- return flattened[0];
- } else {
- return (0, _generated$j.unionTypeAnnotation)(flattened);
- }
- }
- var createTSUnionType$1 = {};
- var removeTypeDuplicates$1 = {};
- Object.defineProperty(removeTypeDuplicates$1, "__esModule", {
- value: true
- });
- removeTypeDuplicates$1.default = removeTypeDuplicates;
- var _generated$i = generated$4;
- function removeTypeDuplicates(nodes) {
- const generics = {};
- const bases = {};
- const typeGroups = [];
- const types = [];
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if (!node) continue;
- if (types.indexOf(node) >= 0) {
- continue;
- }
- if ((0, _generated$i.isTSAnyKeyword)(node)) {
- return [node];
- }
- if ((0, _generated$i.isTSBaseType)(node)) {
- bases[node.type] = node;
- continue;
- }
- if ((0, _generated$i.isTSUnionType)(node)) {
- if (typeGroups.indexOf(node.types) < 0) {
- nodes = nodes.concat(node.types);
- typeGroups.push(node.types);
- }
- continue;
- }
- types.push(node);
- }
- for (const type of Object.keys(bases)) {
- types.push(bases[type]);
- }
- for (const name of Object.keys(generics)) {
- types.push(generics[name]);
- }
- return types;
- }
- Object.defineProperty(createTSUnionType$1, "__esModule", {
- value: true
- });
- createTSUnionType$1.default = createTSUnionType;
- var _generated$h = generated$3;
- var _removeTypeDuplicates = removeTypeDuplicates$1;
- function createTSUnionType(typeAnnotations) {
- const types = typeAnnotations.map(type => type.typeAnnotation);
- const flattened = (0, _removeTypeDuplicates.default)(types);
- if (flattened.length === 1) {
- return flattened[0];
- } else {
- return (0, _generated$h.tsUnionType)(flattened);
- }
- }
- var uppercase = {};
- (function (exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- Object.defineProperty(exports, "ArrayExpression", {
- enumerable: true,
- get: function () {
- return _index.arrayExpression;
- }
- });
- Object.defineProperty(exports, "AssignmentExpression", {
- enumerable: true,
- get: function () {
- return _index.assignmentExpression;
- }
- });
- Object.defineProperty(exports, "BinaryExpression", {
- enumerable: true,
- get: function () {
- return _index.binaryExpression;
- }
- });
- Object.defineProperty(exports, "InterpreterDirective", {
- enumerable: true,
- get: function () {
- return _index.interpreterDirective;
- }
- });
- Object.defineProperty(exports, "Directive", {
- enumerable: true,
- get: function () {
- return _index.directive;
- }
- });
- Object.defineProperty(exports, "DirectiveLiteral", {
- enumerable: true,
- get: function () {
- return _index.directiveLiteral;
- }
- });
- Object.defineProperty(exports, "BlockStatement", {
- enumerable: true,
- get: function () {
- return _index.blockStatement;
- }
- });
- Object.defineProperty(exports, "BreakStatement", {
- enumerable: true,
- get: function () {
- return _index.breakStatement;
- }
- });
- Object.defineProperty(exports, "CallExpression", {
- enumerable: true,
- get: function () {
- return _index.callExpression;
- }
- });
- Object.defineProperty(exports, "CatchClause", {
- enumerable: true,
- get: function () {
- return _index.catchClause;
- }
- });
- Object.defineProperty(exports, "ConditionalExpression", {
- enumerable: true,
- get: function () {
- return _index.conditionalExpression;
- }
- });
- Object.defineProperty(exports, "ContinueStatement", {
- enumerable: true,
- get: function () {
- return _index.continueStatement;
- }
- });
- Object.defineProperty(exports, "DebuggerStatement", {
- enumerable: true,
- get: function () {
- return _index.debuggerStatement;
- }
- });
- Object.defineProperty(exports, "DoWhileStatement", {
- enumerable: true,
- get: function () {
- return _index.doWhileStatement;
- }
- });
- Object.defineProperty(exports, "EmptyStatement", {
- enumerable: true,
- get: function () {
- return _index.emptyStatement;
- }
- });
- Object.defineProperty(exports, "ExpressionStatement", {
- enumerable: true,
- get: function () {
- return _index.expressionStatement;
- }
- });
- Object.defineProperty(exports, "File", {
- enumerable: true,
- get: function () {
- return _index.file;
- }
- });
- Object.defineProperty(exports, "ForInStatement", {
- enumerable: true,
- get: function () {
- return _index.forInStatement;
- }
- });
- Object.defineProperty(exports, "ForStatement", {
- enumerable: true,
- get: function () {
- return _index.forStatement;
- }
- });
- Object.defineProperty(exports, "FunctionDeclaration", {
- enumerable: true,
- get: function () {
- return _index.functionDeclaration;
- }
- });
- Object.defineProperty(exports, "FunctionExpression", {
- enumerable: true,
- get: function () {
- return _index.functionExpression;
- }
- });
- Object.defineProperty(exports, "Identifier", {
- enumerable: true,
- get: function () {
- return _index.identifier;
- }
- });
- Object.defineProperty(exports, "IfStatement", {
- enumerable: true,
- get: function () {
- return _index.ifStatement;
- }
- });
- Object.defineProperty(exports, "LabeledStatement", {
- enumerable: true,
- get: function () {
- return _index.labeledStatement;
- }
- });
- Object.defineProperty(exports, "StringLiteral", {
- enumerable: true,
- get: function () {
- return _index.stringLiteral;
- }
- });
- Object.defineProperty(exports, "NumericLiteral", {
- enumerable: true,
- get: function () {
- return _index.numericLiteral;
- }
- });
- Object.defineProperty(exports, "NullLiteral", {
- enumerable: true,
- get: function () {
- return _index.nullLiteral;
- }
- });
- Object.defineProperty(exports, "BooleanLiteral", {
- enumerable: true,
- get: function () {
- return _index.booleanLiteral;
- }
- });
- Object.defineProperty(exports, "RegExpLiteral", {
- enumerable: true,
- get: function () {
- return _index.regExpLiteral;
- }
- });
- Object.defineProperty(exports, "LogicalExpression", {
- enumerable: true,
- get: function () {
- return _index.logicalExpression;
- }
- });
- Object.defineProperty(exports, "MemberExpression", {
- enumerable: true,
- get: function () {
- return _index.memberExpression;
- }
- });
- Object.defineProperty(exports, "NewExpression", {
- enumerable: true,
- get: function () {
- return _index.newExpression;
- }
- });
- Object.defineProperty(exports, "Program", {
- enumerable: true,
- get: function () {
- return _index.program;
- }
- });
- Object.defineProperty(exports, "ObjectExpression", {
- enumerable: true,
- get: function () {
- return _index.objectExpression;
- }
- });
- Object.defineProperty(exports, "ObjectMethod", {
- enumerable: true,
- get: function () {
- return _index.objectMethod;
- }
- });
- Object.defineProperty(exports, "ObjectProperty", {
- enumerable: true,
- get: function () {
- return _index.objectProperty;
- }
- });
- Object.defineProperty(exports, "RestElement", {
- enumerable: true,
- get: function () {
- return _index.restElement;
- }
- });
- Object.defineProperty(exports, "ReturnStatement", {
- enumerable: true,
- get: function () {
- return _index.returnStatement;
- }
- });
- Object.defineProperty(exports, "SequenceExpression", {
- enumerable: true,
- get: function () {
- return _index.sequenceExpression;
- }
- });
- Object.defineProperty(exports, "ParenthesizedExpression", {
- enumerable: true,
- get: function () {
- return _index.parenthesizedExpression;
- }
- });
- Object.defineProperty(exports, "SwitchCase", {
- enumerable: true,
- get: function () {
- return _index.switchCase;
- }
- });
- Object.defineProperty(exports, "SwitchStatement", {
- enumerable: true,
- get: function () {
- return _index.switchStatement;
- }
- });
- Object.defineProperty(exports, "ThisExpression", {
- enumerable: true,
- get: function () {
- return _index.thisExpression;
- }
- });
- Object.defineProperty(exports, "ThrowStatement", {
- enumerable: true,
- get: function () {
- return _index.throwStatement;
- }
- });
- Object.defineProperty(exports, "TryStatement", {
- enumerable: true,
- get: function () {
- return _index.tryStatement;
- }
- });
- Object.defineProperty(exports, "UnaryExpression", {
- enumerable: true,
- get: function () {
- return _index.unaryExpression;
- }
- });
- Object.defineProperty(exports, "UpdateExpression", {
- enumerable: true,
- get: function () {
- return _index.updateExpression;
- }
- });
- Object.defineProperty(exports, "VariableDeclaration", {
- enumerable: true,
- get: function () {
- return _index.variableDeclaration;
- }
- });
- Object.defineProperty(exports, "VariableDeclarator", {
- enumerable: true,
- get: function () {
- return _index.variableDeclarator;
- }
- });
- Object.defineProperty(exports, "WhileStatement", {
- enumerable: true,
- get: function () {
- return _index.whileStatement;
- }
- });
- Object.defineProperty(exports, "WithStatement", {
- enumerable: true,
- get: function () {
- return _index.withStatement;
- }
- });
- Object.defineProperty(exports, "AssignmentPattern", {
- enumerable: true,
- get: function () {
- return _index.assignmentPattern;
- }
- });
- Object.defineProperty(exports, "ArrayPattern", {
- enumerable: true,
- get: function () {
- return _index.arrayPattern;
- }
- });
- Object.defineProperty(exports, "ArrowFunctionExpression", {
- enumerable: true,
- get: function () {
- return _index.arrowFunctionExpression;
- }
- });
- Object.defineProperty(exports, "ClassBody", {
- enumerable: true,
- get: function () {
- return _index.classBody;
- }
- });
- Object.defineProperty(exports, "ClassExpression", {
- enumerable: true,
- get: function () {
- return _index.classExpression;
- }
- });
- Object.defineProperty(exports, "ClassDeclaration", {
- enumerable: true,
- get: function () {
- return _index.classDeclaration;
- }
- });
- Object.defineProperty(exports, "ExportAllDeclaration", {
- enumerable: true,
- get: function () {
- return _index.exportAllDeclaration;
- }
- });
- Object.defineProperty(exports, "ExportDefaultDeclaration", {
- enumerable: true,
- get: function () {
- return _index.exportDefaultDeclaration;
- }
- });
- Object.defineProperty(exports, "ExportNamedDeclaration", {
- enumerable: true,
- get: function () {
- return _index.exportNamedDeclaration;
- }
- });
- Object.defineProperty(exports, "ExportSpecifier", {
- enumerable: true,
- get: function () {
- return _index.exportSpecifier;
- }
- });
- Object.defineProperty(exports, "ForOfStatement", {
- enumerable: true,
- get: function () {
- return _index.forOfStatement;
- }
- });
- Object.defineProperty(exports, "ImportDeclaration", {
- enumerable: true,
- get: function () {
- return _index.importDeclaration;
- }
- });
- Object.defineProperty(exports, "ImportDefaultSpecifier", {
- enumerable: true,
- get: function () {
- return _index.importDefaultSpecifier;
- }
- });
- Object.defineProperty(exports, "ImportNamespaceSpecifier", {
- enumerable: true,
- get: function () {
- return _index.importNamespaceSpecifier;
- }
- });
- Object.defineProperty(exports, "ImportSpecifier", {
- enumerable: true,
- get: function () {
- return _index.importSpecifier;
- }
- });
- Object.defineProperty(exports, "MetaProperty", {
- enumerable: true,
- get: function () {
- return _index.metaProperty;
- }
- });
- Object.defineProperty(exports, "ClassMethod", {
- enumerable: true,
- get: function () {
- return _index.classMethod;
- }
- });
- Object.defineProperty(exports, "ObjectPattern", {
- enumerable: true,
- get: function () {
- return _index.objectPattern;
- }
- });
- Object.defineProperty(exports, "SpreadElement", {
- enumerable: true,
- get: function () {
- return _index.spreadElement;
- }
- });
- Object.defineProperty(exports, "Super", {
- enumerable: true,
- get: function () {
- return _index.super;
- }
- });
- Object.defineProperty(exports, "TaggedTemplateExpression", {
- enumerable: true,
- get: function () {
- return _index.taggedTemplateExpression;
- }
- });
- Object.defineProperty(exports, "TemplateElement", {
- enumerable: true,
- get: function () {
- return _index.templateElement;
- }
- });
- Object.defineProperty(exports, "TemplateLiteral", {
- enumerable: true,
- get: function () {
- return _index.templateLiteral;
- }
- });
- Object.defineProperty(exports, "YieldExpression", {
- enumerable: true,
- get: function () {
- return _index.yieldExpression;
- }
- });
- Object.defineProperty(exports, "AwaitExpression", {
- enumerable: true,
- get: function () {
- return _index.awaitExpression;
- }
- });
- Object.defineProperty(exports, "Import", {
- enumerable: true,
- get: function () {
- return _index.import;
- }
- });
- Object.defineProperty(exports, "BigIntLiteral", {
- enumerable: true,
- get: function () {
- return _index.bigIntLiteral;
- }
- });
- Object.defineProperty(exports, "ExportNamespaceSpecifier", {
- enumerable: true,
- get: function () {
- return _index.exportNamespaceSpecifier;
- }
- });
- Object.defineProperty(exports, "OptionalMemberExpression", {
- enumerable: true,
- get: function () {
- return _index.optionalMemberExpression;
- }
- });
- Object.defineProperty(exports, "OptionalCallExpression", {
- enumerable: true,
- get: function () {
- return _index.optionalCallExpression;
- }
- });
- Object.defineProperty(exports, "ClassProperty", {
- enumerable: true,
- get: function () {
- return _index.classProperty;
- }
- });
- Object.defineProperty(exports, "ClassPrivateProperty", {
- enumerable: true,
- get: function () {
- return _index.classPrivateProperty;
- }
- });
- Object.defineProperty(exports, "ClassPrivateMethod", {
- enumerable: true,
- get: function () {
- return _index.classPrivateMethod;
- }
- });
- Object.defineProperty(exports, "PrivateName", {
- enumerable: true,
- get: function () {
- return _index.privateName;
- }
- });
- Object.defineProperty(exports, "AnyTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.anyTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "ArrayTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.arrayTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "BooleanTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.booleanTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "BooleanLiteralTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.booleanLiteralTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "NullLiteralTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.nullLiteralTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "ClassImplements", {
- enumerable: true,
- get: function () {
- return _index.classImplements;
- }
- });
- Object.defineProperty(exports, "DeclareClass", {
- enumerable: true,
- get: function () {
- return _index.declareClass;
- }
- });
- Object.defineProperty(exports, "DeclareFunction", {
- enumerable: true,
- get: function () {
- return _index.declareFunction;
- }
- });
- Object.defineProperty(exports, "DeclareInterface", {
- enumerable: true,
- get: function () {
- return _index.declareInterface;
- }
- });
- Object.defineProperty(exports, "DeclareModule", {
- enumerable: true,
- get: function () {
- return _index.declareModule;
- }
- });
- Object.defineProperty(exports, "DeclareModuleExports", {
- enumerable: true,
- get: function () {
- return _index.declareModuleExports;
- }
- });
- Object.defineProperty(exports, "DeclareTypeAlias", {
- enumerable: true,
- get: function () {
- return _index.declareTypeAlias;
- }
- });
- Object.defineProperty(exports, "DeclareOpaqueType", {
- enumerable: true,
- get: function () {
- return _index.declareOpaqueType;
- }
- });
- Object.defineProperty(exports, "DeclareVariable", {
- enumerable: true,
- get: function () {
- return _index.declareVariable;
- }
- });
- Object.defineProperty(exports, "DeclareExportDeclaration", {
- enumerable: true,
- get: function () {
- return _index.declareExportDeclaration;
- }
- });
- Object.defineProperty(exports, "DeclareExportAllDeclaration", {
- enumerable: true,
- get: function () {
- return _index.declareExportAllDeclaration;
- }
- });
- Object.defineProperty(exports, "DeclaredPredicate", {
- enumerable: true,
- get: function () {
- return _index.declaredPredicate;
- }
- });
- Object.defineProperty(exports, "ExistsTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.existsTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "FunctionTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.functionTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "FunctionTypeParam", {
- enumerable: true,
- get: function () {
- return _index.functionTypeParam;
- }
- });
- Object.defineProperty(exports, "GenericTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.genericTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "InferredPredicate", {
- enumerable: true,
- get: function () {
- return _index.inferredPredicate;
- }
- });
- Object.defineProperty(exports, "InterfaceExtends", {
- enumerable: true,
- get: function () {
- return _index.interfaceExtends;
- }
- });
- Object.defineProperty(exports, "InterfaceDeclaration", {
- enumerable: true,
- get: function () {
- return _index.interfaceDeclaration;
- }
- });
- Object.defineProperty(exports, "InterfaceTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.interfaceTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "IntersectionTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.intersectionTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "MixedTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.mixedTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "EmptyTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.emptyTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "NullableTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.nullableTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.numberLiteralTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "NumberTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.numberTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "ObjectTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.objectTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "ObjectTypeInternalSlot", {
- enumerable: true,
- get: function () {
- return _index.objectTypeInternalSlot;
- }
- });
- Object.defineProperty(exports, "ObjectTypeCallProperty", {
- enumerable: true,
- get: function () {
- return _index.objectTypeCallProperty;
- }
- });
- Object.defineProperty(exports, "ObjectTypeIndexer", {
- enumerable: true,
- get: function () {
- return _index.objectTypeIndexer;
- }
- });
- Object.defineProperty(exports, "ObjectTypeProperty", {
- enumerable: true,
- get: function () {
- return _index.objectTypeProperty;
- }
- });
- Object.defineProperty(exports, "ObjectTypeSpreadProperty", {
- enumerable: true,
- get: function () {
- return _index.objectTypeSpreadProperty;
- }
- });
- Object.defineProperty(exports, "OpaqueType", {
- enumerable: true,
- get: function () {
- return _index.opaqueType;
- }
- });
- Object.defineProperty(exports, "QualifiedTypeIdentifier", {
- enumerable: true,
- get: function () {
- return _index.qualifiedTypeIdentifier;
- }
- });
- Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.stringLiteralTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "StringTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.stringTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "SymbolTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.symbolTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "ThisTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.thisTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "TupleTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.tupleTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "TypeofTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.typeofTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "TypeAlias", {
- enumerable: true,
- get: function () {
- return _index.typeAlias;
- }
- });
- Object.defineProperty(exports, "TypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.typeAnnotation;
- }
- });
- Object.defineProperty(exports, "TypeCastExpression", {
- enumerable: true,
- get: function () {
- return _index.typeCastExpression;
- }
- });
- Object.defineProperty(exports, "TypeParameter", {
- enumerable: true,
- get: function () {
- return _index.typeParameter;
- }
- });
- Object.defineProperty(exports, "TypeParameterDeclaration", {
- enumerable: true,
- get: function () {
- return _index.typeParameterDeclaration;
- }
- });
- Object.defineProperty(exports, "TypeParameterInstantiation", {
- enumerable: true,
- get: function () {
- return _index.typeParameterInstantiation;
- }
- });
- Object.defineProperty(exports, "UnionTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.unionTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "Variance", {
- enumerable: true,
- get: function () {
- return _index.variance;
- }
- });
- Object.defineProperty(exports, "VoidTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.voidTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "EnumDeclaration", {
- enumerable: true,
- get: function () {
- return _index.enumDeclaration;
- }
- });
- Object.defineProperty(exports, "EnumBooleanBody", {
- enumerable: true,
- get: function () {
- return _index.enumBooleanBody;
- }
- });
- Object.defineProperty(exports, "EnumNumberBody", {
- enumerable: true,
- get: function () {
- return _index.enumNumberBody;
- }
- });
- Object.defineProperty(exports, "EnumStringBody", {
- enumerable: true,
- get: function () {
- return _index.enumStringBody;
- }
- });
- Object.defineProperty(exports, "EnumSymbolBody", {
- enumerable: true,
- get: function () {
- return _index.enumSymbolBody;
- }
- });
- Object.defineProperty(exports, "EnumBooleanMember", {
- enumerable: true,
- get: function () {
- return _index.enumBooleanMember;
- }
- });
- Object.defineProperty(exports, "EnumNumberMember", {
- enumerable: true,
- get: function () {
- return _index.enumNumberMember;
- }
- });
- Object.defineProperty(exports, "EnumStringMember", {
- enumerable: true,
- get: function () {
- return _index.enumStringMember;
- }
- });
- Object.defineProperty(exports, "EnumDefaultedMember", {
- enumerable: true,
- get: function () {
- return _index.enumDefaultedMember;
- }
- });
- Object.defineProperty(exports, "IndexedAccessType", {
- enumerable: true,
- get: function () {
- return _index.indexedAccessType;
- }
- });
- Object.defineProperty(exports, "OptionalIndexedAccessType", {
- enumerable: true,
- get: function () {
- return _index.optionalIndexedAccessType;
- }
- });
- Object.defineProperty(exports, "JSXAttribute", {
- enumerable: true,
- get: function () {
- return _index.jsxAttribute;
- }
- });
- Object.defineProperty(exports, "JSXClosingElement", {
- enumerable: true,
- get: function () {
- return _index.jsxClosingElement;
- }
- });
- Object.defineProperty(exports, "JSXElement", {
- enumerable: true,
- get: function () {
- return _index.jsxElement;
- }
- });
- Object.defineProperty(exports, "JSXEmptyExpression", {
- enumerable: true,
- get: function () {
- return _index.jsxEmptyExpression;
- }
- });
- Object.defineProperty(exports, "JSXExpressionContainer", {
- enumerable: true,
- get: function () {
- return _index.jsxExpressionContainer;
- }
- });
- Object.defineProperty(exports, "JSXSpreadChild", {
- enumerable: true,
- get: function () {
- return _index.jsxSpreadChild;
- }
- });
- Object.defineProperty(exports, "JSXIdentifier", {
- enumerable: true,
- get: function () {
- return _index.jsxIdentifier;
- }
- });
- Object.defineProperty(exports, "JSXMemberExpression", {
- enumerable: true,
- get: function () {
- return _index.jsxMemberExpression;
- }
- });
- Object.defineProperty(exports, "JSXNamespacedName", {
- enumerable: true,
- get: function () {
- return _index.jsxNamespacedName;
- }
- });
- Object.defineProperty(exports, "JSXOpeningElement", {
- enumerable: true,
- get: function () {
- return _index.jsxOpeningElement;
- }
- });
- Object.defineProperty(exports, "JSXSpreadAttribute", {
- enumerable: true,
- get: function () {
- return _index.jsxSpreadAttribute;
- }
- });
- Object.defineProperty(exports, "JSXText", {
- enumerable: true,
- get: function () {
- return _index.jsxText;
- }
- });
- Object.defineProperty(exports, "JSXFragment", {
- enumerable: true,
- get: function () {
- return _index.jsxFragment;
- }
- });
- Object.defineProperty(exports, "JSXOpeningFragment", {
- enumerable: true,
- get: function () {
- return _index.jsxOpeningFragment;
- }
- });
- Object.defineProperty(exports, "JSXClosingFragment", {
- enumerable: true,
- get: function () {
- return _index.jsxClosingFragment;
- }
- });
- Object.defineProperty(exports, "Noop", {
- enumerable: true,
- get: function () {
- return _index.noop;
- }
- });
- Object.defineProperty(exports, "Placeholder", {
- enumerable: true,
- get: function () {
- return _index.placeholder;
- }
- });
- Object.defineProperty(exports, "V8IntrinsicIdentifier", {
- enumerable: true,
- get: function () {
- return _index.v8IntrinsicIdentifier;
- }
- });
- Object.defineProperty(exports, "ArgumentPlaceholder", {
- enumerable: true,
- get: function () {
- return _index.argumentPlaceholder;
- }
- });
- Object.defineProperty(exports, "BindExpression", {
- enumerable: true,
- get: function () {
- return _index.bindExpression;
- }
- });
- Object.defineProperty(exports, "ImportAttribute", {
- enumerable: true,
- get: function () {
- return _index.importAttribute;
- }
- });
- Object.defineProperty(exports, "Decorator", {
- enumerable: true,
- get: function () {
- return _index.decorator;
- }
- });
- Object.defineProperty(exports, "DoExpression", {
- enumerable: true,
- get: function () {
- return _index.doExpression;
- }
- });
- Object.defineProperty(exports, "ExportDefaultSpecifier", {
- enumerable: true,
- get: function () {
- return _index.exportDefaultSpecifier;
- }
- });
- Object.defineProperty(exports, "RecordExpression", {
- enumerable: true,
- get: function () {
- return _index.recordExpression;
- }
- });
- Object.defineProperty(exports, "TupleExpression", {
- enumerable: true,
- get: function () {
- return _index.tupleExpression;
- }
- });
- Object.defineProperty(exports, "DecimalLiteral", {
- enumerable: true,
- get: function () {
- return _index.decimalLiteral;
- }
- });
- Object.defineProperty(exports, "StaticBlock", {
- enumerable: true,
- get: function () {
- return _index.staticBlock;
- }
- });
- Object.defineProperty(exports, "ModuleExpression", {
- enumerable: true,
- get: function () {
- return _index.moduleExpression;
- }
- });
- Object.defineProperty(exports, "TopicReference", {
- enumerable: true,
- get: function () {
- return _index.topicReference;
- }
- });
- Object.defineProperty(exports, "PipelineTopicExpression", {
- enumerable: true,
- get: function () {
- return _index.pipelineTopicExpression;
- }
- });
- Object.defineProperty(exports, "PipelineBareFunction", {
- enumerable: true,
- get: function () {
- return _index.pipelineBareFunction;
- }
- });
- Object.defineProperty(exports, "PipelinePrimaryTopicReference", {
- enumerable: true,
- get: function () {
- return _index.pipelinePrimaryTopicReference;
- }
- });
- Object.defineProperty(exports, "TSParameterProperty", {
- enumerable: true,
- get: function () {
- return _index.tsParameterProperty;
- }
- });
- Object.defineProperty(exports, "TSDeclareFunction", {
- enumerable: true,
- get: function () {
- return _index.tsDeclareFunction;
- }
- });
- Object.defineProperty(exports, "TSDeclareMethod", {
- enumerable: true,
- get: function () {
- return _index.tsDeclareMethod;
- }
- });
- Object.defineProperty(exports, "TSQualifiedName", {
- enumerable: true,
- get: function () {
- return _index.tsQualifiedName;
- }
- });
- Object.defineProperty(exports, "TSCallSignatureDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsCallSignatureDeclaration;
- }
- });
- Object.defineProperty(exports, "TSConstructSignatureDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsConstructSignatureDeclaration;
- }
- });
- Object.defineProperty(exports, "TSPropertySignature", {
- enumerable: true,
- get: function () {
- return _index.tsPropertySignature;
- }
- });
- Object.defineProperty(exports, "TSMethodSignature", {
- enumerable: true,
- get: function () {
- return _index.tsMethodSignature;
- }
- });
- Object.defineProperty(exports, "TSIndexSignature", {
- enumerable: true,
- get: function () {
- return _index.tsIndexSignature;
- }
- });
- Object.defineProperty(exports, "TSAnyKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsAnyKeyword;
- }
- });
- Object.defineProperty(exports, "TSBooleanKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsBooleanKeyword;
- }
- });
- Object.defineProperty(exports, "TSBigIntKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsBigIntKeyword;
- }
- });
- Object.defineProperty(exports, "TSIntrinsicKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsIntrinsicKeyword;
- }
- });
- Object.defineProperty(exports, "TSNeverKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsNeverKeyword;
- }
- });
- Object.defineProperty(exports, "TSNullKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsNullKeyword;
- }
- });
- Object.defineProperty(exports, "TSNumberKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsNumberKeyword;
- }
- });
- Object.defineProperty(exports, "TSObjectKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsObjectKeyword;
- }
- });
- Object.defineProperty(exports, "TSStringKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsStringKeyword;
- }
- });
- Object.defineProperty(exports, "TSSymbolKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsSymbolKeyword;
- }
- });
- Object.defineProperty(exports, "TSUndefinedKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsUndefinedKeyword;
- }
- });
- Object.defineProperty(exports, "TSUnknownKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsUnknownKeyword;
- }
- });
- Object.defineProperty(exports, "TSVoidKeyword", {
- enumerable: true,
- get: function () {
- return _index.tsVoidKeyword;
- }
- });
- Object.defineProperty(exports, "TSThisType", {
- enumerable: true,
- get: function () {
- return _index.tsThisType;
- }
- });
- Object.defineProperty(exports, "TSFunctionType", {
- enumerable: true,
- get: function () {
- return _index.tsFunctionType;
- }
- });
- Object.defineProperty(exports, "TSConstructorType", {
- enumerable: true,
- get: function () {
- return _index.tsConstructorType;
- }
- });
- Object.defineProperty(exports, "TSTypeReference", {
- enumerable: true,
- get: function () {
- return _index.tsTypeReference;
- }
- });
- Object.defineProperty(exports, "TSTypePredicate", {
- enumerable: true,
- get: function () {
- return _index.tsTypePredicate;
- }
- });
- Object.defineProperty(exports, "TSTypeQuery", {
- enumerable: true,
- get: function () {
- return _index.tsTypeQuery;
- }
- });
- Object.defineProperty(exports, "TSTypeLiteral", {
- enumerable: true,
- get: function () {
- return _index.tsTypeLiteral;
- }
- });
- Object.defineProperty(exports, "TSArrayType", {
- enumerable: true,
- get: function () {
- return _index.tsArrayType;
- }
- });
- Object.defineProperty(exports, "TSTupleType", {
- enumerable: true,
- get: function () {
- return _index.tsTupleType;
- }
- });
- Object.defineProperty(exports, "TSOptionalType", {
- enumerable: true,
- get: function () {
- return _index.tsOptionalType;
- }
- });
- Object.defineProperty(exports, "TSRestType", {
- enumerable: true,
- get: function () {
- return _index.tsRestType;
- }
- });
- Object.defineProperty(exports, "TSNamedTupleMember", {
- enumerable: true,
- get: function () {
- return _index.tsNamedTupleMember;
- }
- });
- Object.defineProperty(exports, "TSUnionType", {
- enumerable: true,
- get: function () {
- return _index.tsUnionType;
- }
- });
- Object.defineProperty(exports, "TSIntersectionType", {
- enumerable: true,
- get: function () {
- return _index.tsIntersectionType;
- }
- });
- Object.defineProperty(exports, "TSConditionalType", {
- enumerable: true,
- get: function () {
- return _index.tsConditionalType;
- }
- });
- Object.defineProperty(exports, "TSInferType", {
- enumerable: true,
- get: function () {
- return _index.tsInferType;
- }
- });
- Object.defineProperty(exports, "TSParenthesizedType", {
- enumerable: true,
- get: function () {
- return _index.tsParenthesizedType;
- }
- });
- Object.defineProperty(exports, "TSTypeOperator", {
- enumerable: true,
- get: function () {
- return _index.tsTypeOperator;
- }
- });
- Object.defineProperty(exports, "TSIndexedAccessType", {
- enumerable: true,
- get: function () {
- return _index.tsIndexedAccessType;
- }
- });
- Object.defineProperty(exports, "TSMappedType", {
- enumerable: true,
- get: function () {
- return _index.tsMappedType;
- }
- });
- Object.defineProperty(exports, "TSLiteralType", {
- enumerable: true,
- get: function () {
- return _index.tsLiteralType;
- }
- });
- Object.defineProperty(exports, "TSExpressionWithTypeArguments", {
- enumerable: true,
- get: function () {
- return _index.tsExpressionWithTypeArguments;
- }
- });
- Object.defineProperty(exports, "TSInterfaceDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsInterfaceDeclaration;
- }
- });
- Object.defineProperty(exports, "TSInterfaceBody", {
- enumerable: true,
- get: function () {
- return _index.tsInterfaceBody;
- }
- });
- Object.defineProperty(exports, "TSTypeAliasDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsTypeAliasDeclaration;
- }
- });
- Object.defineProperty(exports, "TSAsExpression", {
- enumerable: true,
- get: function () {
- return _index.tsAsExpression;
- }
- });
- Object.defineProperty(exports, "TSTypeAssertion", {
- enumerable: true,
- get: function () {
- return _index.tsTypeAssertion;
- }
- });
- Object.defineProperty(exports, "TSEnumDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsEnumDeclaration;
- }
- });
- Object.defineProperty(exports, "TSEnumMember", {
- enumerable: true,
- get: function () {
- return _index.tsEnumMember;
- }
- });
- Object.defineProperty(exports, "TSModuleDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsModuleDeclaration;
- }
- });
- Object.defineProperty(exports, "TSModuleBlock", {
- enumerable: true,
- get: function () {
- return _index.tsModuleBlock;
- }
- });
- Object.defineProperty(exports, "TSImportType", {
- enumerable: true,
- get: function () {
- return _index.tsImportType;
- }
- });
- Object.defineProperty(exports, "TSImportEqualsDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsImportEqualsDeclaration;
- }
- });
- Object.defineProperty(exports, "TSExternalModuleReference", {
- enumerable: true,
- get: function () {
- return _index.tsExternalModuleReference;
- }
- });
- Object.defineProperty(exports, "TSNonNullExpression", {
- enumerable: true,
- get: function () {
- return _index.tsNonNullExpression;
- }
- });
- Object.defineProperty(exports, "TSExportAssignment", {
- enumerable: true,
- get: function () {
- return _index.tsExportAssignment;
- }
- });
- Object.defineProperty(exports, "TSNamespaceExportDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsNamespaceExportDeclaration;
- }
- });
- Object.defineProperty(exports, "TSTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _index.tsTypeAnnotation;
- }
- });
- Object.defineProperty(exports, "TSTypeParameterInstantiation", {
- enumerable: true,
- get: function () {
- return _index.tsTypeParameterInstantiation;
- }
- });
- Object.defineProperty(exports, "TSTypeParameterDeclaration", {
- enumerable: true,
- get: function () {
- return _index.tsTypeParameterDeclaration;
- }
- });
- Object.defineProperty(exports, "TSTypeParameter", {
- enumerable: true,
- get: function () {
- return _index.tsTypeParameter;
- }
- });
- Object.defineProperty(exports, "NumberLiteral", {
- enumerable: true,
- get: function () {
- return _index.numberLiteral;
- }
- });
- Object.defineProperty(exports, "RegexLiteral", {
- enumerable: true,
- get: function () {
- return _index.regexLiteral;
- }
- });
- Object.defineProperty(exports, "RestProperty", {
- enumerable: true,
- get: function () {
- return _index.restProperty;
- }
- });
- Object.defineProperty(exports, "SpreadProperty", {
- enumerable: true,
- get: function () {
- return _index.spreadProperty;
- }
- });
- var _index = generated$3;
- }(uppercase));
- var cloneNode$1 = {};
- Object.defineProperty(cloneNode$1, "__esModule", {
- value: true
- });
- cloneNode$1.default = cloneNode;
- var _definitions$4 = definitions;
- var _generated$g = generated$4;
- const has = Function.call.bind(Object.prototype.hasOwnProperty);
- function cloneIfNode(obj, deep, withoutLoc) {
- if (obj && typeof obj.type === "string") {
- return cloneNode(obj, deep, withoutLoc);
- }
- return obj;
- }
- function cloneIfNodeOrArray(obj, deep, withoutLoc) {
- if (Array.isArray(obj)) {
- return obj.map(node => cloneIfNode(node, deep, withoutLoc));
- }
- return cloneIfNode(obj, deep, withoutLoc);
- }
- function cloneNode(node, deep = true, withoutLoc = false) {
- if (!node) return node;
- const {
- type
- } = node;
- const newNode = {
- type: node.type
- };
- if ((0, _generated$g.isIdentifier)(node)) {
- newNode.name = node.name;
- if (has(node, "optional") && typeof node.optional === "boolean") {
- newNode.optional = node.optional;
- }
- if (has(node, "typeAnnotation")) {
- newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc) : node.typeAnnotation;
- }
- } else if (!has(_definitions$4.NODE_FIELDS, type)) {
- throw new Error(`Unknown node type: "${type}"`);
- } else {
- for (const field of Object.keys(_definitions$4.NODE_FIELDS[type])) {
- if (has(node, field)) {
- if (deep) {
- newNode[field] = (0, _generated$g.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc) : cloneIfNodeOrArray(node[field], true, withoutLoc);
- } else {
- newNode[field] = node[field];
- }
- }
- }
- }
- if (has(node, "loc")) {
- if (withoutLoc) {
- newNode.loc = null;
- } else {
- newNode.loc = node.loc;
- }
- }
- if (has(node, "leadingComments")) {
- newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc);
- }
- if (has(node, "innerComments")) {
- newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc);
- }
- if (has(node, "trailingComments")) {
- newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc);
- }
- if (has(node, "extra")) {
- newNode.extra = Object.assign({}, node.extra);
- }
- return newNode;
- }
- function maybeCloneComments(comments, deep, withoutLoc) {
- if (!comments || !deep) {
- return comments;
- }
- return comments.map(({
- type,
- value,
- loc
- }) => {
- if (withoutLoc) {
- return {
- type,
- value,
- loc: null
- };
- }
- return {
- type,
- value,
- loc
- };
- });
- }
- var clone$1 = {};
- Object.defineProperty(clone$1, "__esModule", {
- value: true
- });
- clone$1.default = clone;
- var _cloneNode$5 = cloneNode$1;
- function clone(node) {
- return (0, _cloneNode$5.default)(node, false);
- }
- var cloneDeep$1 = {};
- Object.defineProperty(cloneDeep$1, "__esModule", {
- value: true
- });
- cloneDeep$1.default = cloneDeep;
- var _cloneNode$4 = cloneNode$1;
- function cloneDeep(node) {
- return (0, _cloneNode$4.default)(node);
- }
- var cloneDeepWithoutLoc$1 = {};
- Object.defineProperty(cloneDeepWithoutLoc$1, "__esModule", {
- value: true
- });
- cloneDeepWithoutLoc$1.default = cloneDeepWithoutLoc;
- var _cloneNode$3 = cloneNode$1;
- function cloneDeepWithoutLoc(node) {
- return (0, _cloneNode$3.default)(node, true, true);
- }
- var cloneWithoutLoc$1 = {};
- Object.defineProperty(cloneWithoutLoc$1, "__esModule", {
- value: true
- });
- cloneWithoutLoc$1.default = cloneWithoutLoc;
- var _cloneNode$2 = cloneNode$1;
- function cloneWithoutLoc(node) {
- return (0, _cloneNode$2.default)(node, false, true);
- }
- var addComment$1 = {};
- var addComments$1 = {};
- Object.defineProperty(addComments$1, "__esModule", {
- value: true
- });
- addComments$1.default = addComments;
- function addComments(node, type, comments) {
- if (!comments || !node) return node;
- const key = `${type}Comments`;
- if (node[key]) {
- if (type === "leading") {
- node[key] = comments.concat(node[key]);
- } else {
- node[key] = node[key].concat(comments);
- }
- } else {
- node[key] = comments;
- }
- return node;
- }
- Object.defineProperty(addComment$1, "__esModule", {
- value: true
- });
- addComment$1.default = addComment;
- var _addComments = addComments$1;
- function addComment(node, type, content, line) {
- return (0, _addComments.default)(node, type, [{
- type: line ? "CommentLine" : "CommentBlock",
- value: content
- }]);
- }
- var inheritInnerComments$1 = {};
- var inherit$1 = {};
- Object.defineProperty(inherit$1, "__esModule", {
- value: true
- });
- inherit$1.default = inherit;
- function inherit(key, child, parent) {
- if (child && parent) {
- child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean)));
- }
- }
- Object.defineProperty(inheritInnerComments$1, "__esModule", {
- value: true
- });
- inheritInnerComments$1.default = inheritInnerComments;
- var _inherit$2 = inherit$1;
- function inheritInnerComments(child, parent) {
- (0, _inherit$2.default)("innerComments", child, parent);
- }
- var inheritLeadingComments$1 = {};
- Object.defineProperty(inheritLeadingComments$1, "__esModule", {
- value: true
- });
- inheritLeadingComments$1.default = inheritLeadingComments;
- var _inherit$1 = inherit$1;
- function inheritLeadingComments(child, parent) {
- (0, _inherit$1.default)("leadingComments", child, parent);
- }
- var inheritsComments$1 = {};
- var inheritTrailingComments$1 = {};
- Object.defineProperty(inheritTrailingComments$1, "__esModule", {
- value: true
- });
- inheritTrailingComments$1.default = inheritTrailingComments;
- var _inherit = inherit$1;
- function inheritTrailingComments(child, parent) {
- (0, _inherit.default)("trailingComments", child, parent);
- }
- Object.defineProperty(inheritsComments$1, "__esModule", {
- value: true
- });
- inheritsComments$1.default = inheritsComments;
- var _inheritTrailingComments = inheritTrailingComments$1;
- var _inheritLeadingComments = inheritLeadingComments$1;
- var _inheritInnerComments = inheritInnerComments$1;
- function inheritsComments(child, parent) {
- (0, _inheritTrailingComments.default)(child, parent);
- (0, _inheritLeadingComments.default)(child, parent);
- (0, _inheritInnerComments.default)(child, parent);
- return child;
- }
- var removeComments$1 = {};
- Object.defineProperty(removeComments$1, "__esModule", {
- value: true
- });
- removeComments$1.default = removeComments;
- var _constants$4 = constants;
- function removeComments(node) {
- _constants$4.COMMENT_KEYS.forEach(key => {
- node[key] = null;
- });
- return node;
- }
- var generated$1 = {};
- Object.defineProperty(generated$1, "__esModule", {
- value: true
- });
- generated$1.TSBASETYPE_TYPES = generated$1.TSTYPE_TYPES = generated$1.TSTYPEELEMENT_TYPES = generated$1.JSX_TYPES = generated$1.ENUMMEMBER_TYPES = generated$1.ENUMBODY_TYPES = generated$1.FLOWPREDICATE_TYPES = generated$1.FLOWDECLARATION_TYPES = generated$1.FLOWBASEANNOTATION_TYPES = generated$1.FLOWTYPE_TYPES = generated$1.FLOW_TYPES = generated$1.PRIVATE_TYPES = generated$1.MODULESPECIFIER_TYPES = generated$1.EXPORTDECLARATION_TYPES = generated$1.MODULEDECLARATION_TYPES = generated$1.CLASS_TYPES = generated$1.PATTERN_TYPES = generated$1.UNARYLIKE_TYPES = generated$1.PROPERTY_TYPES = generated$1.OBJECTMEMBER_TYPES = generated$1.METHOD_TYPES = generated$1.USERWHITESPACABLE_TYPES = generated$1.IMMUTABLE_TYPES = generated$1.LITERAL_TYPES = generated$1.TSENTITYNAME_TYPES = generated$1.LVAL_TYPES = generated$1.PATTERNLIKE_TYPES = generated$1.DECLARATION_TYPES = generated$1.PUREISH_TYPES = generated$1.FUNCTIONPARENT_TYPES = generated$1.FUNCTION_TYPES = generated$1.FORXSTATEMENT_TYPES = generated$1.FOR_TYPES = generated$1.EXPRESSIONWRAPPER_TYPES = generated$1.WHILE_TYPES = generated$1.LOOP_TYPES = generated$1.CONDITIONAL_TYPES = generated$1.COMPLETIONSTATEMENT_TYPES = generated$1.TERMINATORLESS_TYPES = generated$1.STATEMENT_TYPES = generated$1.BLOCK_TYPES = generated$1.BLOCKPARENT_TYPES = generated$1.SCOPABLE_TYPES = generated$1.BINARY_TYPES = generated$1.EXPRESSION_TYPES = void 0;
- var _definitions$3 = definitions;
- const EXPRESSION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Expression"];
- generated$1.EXPRESSION_TYPES = EXPRESSION_TYPES;
- const BINARY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Binary"];
- generated$1.BINARY_TYPES = BINARY_TYPES;
- const SCOPABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Scopable"];
- generated$1.SCOPABLE_TYPES = SCOPABLE_TYPES;
- const BLOCKPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["BlockParent"];
- generated$1.BLOCKPARENT_TYPES = BLOCKPARENT_TYPES;
- const BLOCK_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Block"];
- generated$1.BLOCK_TYPES = BLOCK_TYPES;
- const STATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Statement"];
- generated$1.STATEMENT_TYPES = STATEMENT_TYPES;
- const TERMINATORLESS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Terminatorless"];
- generated$1.TERMINATORLESS_TYPES = TERMINATORLESS_TYPES;
- const COMPLETIONSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["CompletionStatement"];
- generated$1.COMPLETIONSTATEMENT_TYPES = COMPLETIONSTATEMENT_TYPES;
- const CONDITIONAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Conditional"];
- generated$1.CONDITIONAL_TYPES = CONDITIONAL_TYPES;
- const LOOP_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Loop"];
- generated$1.LOOP_TYPES = LOOP_TYPES;
- const WHILE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["While"];
- generated$1.WHILE_TYPES = WHILE_TYPES;
- const EXPRESSIONWRAPPER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
- generated$1.EXPRESSIONWRAPPER_TYPES = EXPRESSIONWRAPPER_TYPES;
- const FOR_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["For"];
- generated$1.FOR_TYPES = FOR_TYPES;
- const FORXSTATEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ForXStatement"];
- generated$1.FORXSTATEMENT_TYPES = FORXSTATEMENT_TYPES;
- const FUNCTION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Function"];
- generated$1.FUNCTION_TYPES = FUNCTION_TYPES;
- const FUNCTIONPARENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FunctionParent"];
- generated$1.FUNCTIONPARENT_TYPES = FUNCTIONPARENT_TYPES;
- const PUREISH_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pureish"];
- generated$1.PUREISH_TYPES = PUREISH_TYPES;
- const DECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Declaration"];
- generated$1.DECLARATION_TYPES = DECLARATION_TYPES;
- const PATTERNLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["PatternLike"];
- generated$1.PATTERNLIKE_TYPES = PATTERNLIKE_TYPES;
- const LVAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["LVal"];
- generated$1.LVAL_TYPES = LVAL_TYPES;
- const TSENTITYNAME_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSEntityName"];
- generated$1.TSENTITYNAME_TYPES = TSENTITYNAME_TYPES;
- const LITERAL_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Literal"];
- generated$1.LITERAL_TYPES = LITERAL_TYPES;
- const IMMUTABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Immutable"];
- generated$1.IMMUTABLE_TYPES = IMMUTABLE_TYPES;
- const USERWHITESPACABLE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UserWhitespacable"];
- generated$1.USERWHITESPACABLE_TYPES = USERWHITESPACABLE_TYPES;
- const METHOD_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Method"];
- generated$1.METHOD_TYPES = METHOD_TYPES;
- const OBJECTMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ObjectMember"];
- generated$1.OBJECTMEMBER_TYPES = OBJECTMEMBER_TYPES;
- const PROPERTY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Property"];
- generated$1.PROPERTY_TYPES = PROPERTY_TYPES;
- const UNARYLIKE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["UnaryLike"];
- generated$1.UNARYLIKE_TYPES = UNARYLIKE_TYPES;
- const PATTERN_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Pattern"];
- generated$1.PATTERN_TYPES = PATTERN_TYPES;
- const CLASS_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Class"];
- generated$1.CLASS_TYPES = CLASS_TYPES;
- const MODULEDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
- generated$1.MODULEDECLARATION_TYPES = MODULEDECLARATION_TYPES;
- const EXPORTDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ExportDeclaration"];
- generated$1.EXPORTDECLARATION_TYPES = EXPORTDECLARATION_TYPES;
- const MODULESPECIFIER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
- generated$1.MODULESPECIFIER_TYPES = MODULESPECIFIER_TYPES;
- const PRIVATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Private"];
- generated$1.PRIVATE_TYPES = PRIVATE_TYPES;
- const FLOW_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["Flow"];
- generated$1.FLOW_TYPES = FLOW_TYPES;
- const FLOWTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowType"];
- generated$1.FLOWTYPE_TYPES = FLOWTYPE_TYPES;
- const FLOWBASEANNOTATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
- generated$1.FLOWBASEANNOTATION_TYPES = FLOWBASEANNOTATION_TYPES;
- const FLOWDECLARATION_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowDeclaration"];
- generated$1.FLOWDECLARATION_TYPES = FLOWDECLARATION_TYPES;
- const FLOWPREDICATE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["FlowPredicate"];
- generated$1.FLOWPREDICATE_TYPES = FLOWPREDICATE_TYPES;
- const ENUMBODY_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumBody"];
- generated$1.ENUMBODY_TYPES = ENUMBODY_TYPES;
- const ENUMMEMBER_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["EnumMember"];
- generated$1.ENUMMEMBER_TYPES = ENUMMEMBER_TYPES;
- const JSX_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["JSX"];
- generated$1.JSX_TYPES = JSX_TYPES;
- const TSTYPEELEMENT_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSTypeElement"];
- generated$1.TSTYPEELEMENT_TYPES = TSTYPEELEMENT_TYPES;
- const TSTYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSType"];
- generated$1.TSTYPE_TYPES = TSTYPE_TYPES;
- const TSBASETYPE_TYPES = _definitions$3.FLIPPED_ALIAS_KEYS["TSBaseType"];
- generated$1.TSBASETYPE_TYPES = TSBASETYPE_TYPES;
- var ensureBlock$1 = {};
- var toBlock$1 = {};
- Object.defineProperty(toBlock$1, "__esModule", {
- value: true
- });
- toBlock$1.default = toBlock;
- var _generated$f = generated$4;
- var _generated2$3 = generated$3;
- function toBlock(node, parent) {
- if ((0, _generated$f.isBlockStatement)(node)) {
- return node;
- }
- let blockNodes = [];
- if ((0, _generated$f.isEmptyStatement)(node)) {
- blockNodes = [];
- } else {
- if (!(0, _generated$f.isStatement)(node)) {
- if ((0, _generated$f.isFunction)(parent)) {
- node = (0, _generated2$3.returnStatement)(node);
- } else {
- node = (0, _generated2$3.expressionStatement)(node);
- }
- }
- blockNodes = [node];
- }
- return (0, _generated2$3.blockStatement)(blockNodes);
- }
- Object.defineProperty(ensureBlock$1, "__esModule", {
- value: true
- });
- ensureBlock$1.default = ensureBlock;
- var _toBlock = toBlock$1;
- function ensureBlock(node, key = "body") {
- return node[key] = (0, _toBlock.default)(node[key], node);
- }
- var toBindingIdentifierName$1 = {};
- var toIdentifier$1 = {};
- Object.defineProperty(toIdentifier$1, "__esModule", {
- value: true
- });
- toIdentifier$1.default = toIdentifier;
- var _isValidIdentifier$2 = isValidIdentifier$1;
- var _helperValidatorIdentifier = lib;
- function toIdentifier(input) {
- input = input + "";
- let name = "";
- for (const c of input) {
- name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-";
- }
- name = name.replace(/^[-0-9]+/, "");
- name = name.replace(/[-\s]+(.)?/g, function (match, c) {
- return c ? c.toUpperCase() : "";
- });
- if (!(0, _isValidIdentifier$2.default)(name)) {
- name = `_${name}`;
- }
- return name || "_";
- }
- Object.defineProperty(toBindingIdentifierName$1, "__esModule", {
- value: true
- });
- toBindingIdentifierName$1.default = toBindingIdentifierName;
- var _toIdentifier = toIdentifier$1;
- function toBindingIdentifierName(name) {
- name = (0, _toIdentifier.default)(name);
- if (name === "eval" || name === "arguments") name = "_" + name;
- return name;
- }
- var toComputedKey$1 = {};
- Object.defineProperty(toComputedKey$1, "__esModule", {
- value: true
- });
- toComputedKey$1.default = toComputedKey;
- var _generated$e = generated$4;
- var _generated2$2 = generated$3;
- function toComputedKey(node, key = node.key || node.property) {
- if (!node.computed && (0, _generated$e.isIdentifier)(key)) key = (0, _generated2$2.stringLiteral)(key.name);
- return key;
- }
- var toExpression$1 = {};
- Object.defineProperty(toExpression$1, "__esModule", {
- value: true
- });
- toExpression$1.default = void 0;
- var _generated$d = generated$4;
- var _default$3 = toExpression;
- toExpression$1.default = _default$3;
- function toExpression(node) {
- if ((0, _generated$d.isExpressionStatement)(node)) {
- node = node.expression;
- }
- if ((0, _generated$d.isExpression)(node)) {
- return node;
- }
- if ((0, _generated$d.isClass)(node)) {
- node.type = "ClassExpression";
- } else if ((0, _generated$d.isFunction)(node)) {
- node.type = "FunctionExpression";
- }
- if (!(0, _generated$d.isExpression)(node)) {
- throw new Error(`cannot turn ${node.type} to an expression`);
- }
- return node;
- }
- var toKeyAlias$1 = {};
- var removePropertiesDeep$1 = {};
- var traverseFast$1 = {};
- Object.defineProperty(traverseFast$1, "__esModule", {
- value: true
- });
- traverseFast$1.default = traverseFast;
- var _definitions$2 = definitions;
- function traverseFast(node, enter, opts) {
- if (!node) return;
- const keys = _definitions$2.VISITOR_KEYS[node.type];
- if (!keys) return;
- opts = opts || {};
- enter(node, opts);
- for (const key of keys) {
- const subNode = node[key];
- if (Array.isArray(subNode)) {
- for (const node of subNode) {
- traverseFast(node, enter, opts);
- }
- } else {
- traverseFast(subNode, enter, opts);
- }
- }
- }
- var removeProperties$1 = {};
- Object.defineProperty(removeProperties$1, "__esModule", {
- value: true
- });
- removeProperties$1.default = removeProperties;
- var _constants$3 = constants;
- const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
- const CLEAR_KEYS_PLUS_COMMENTS = _constants$3.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
- function removeProperties(node, opts = {}) {
- const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
- for (const key of map) {
- if (node[key] != null) node[key] = undefined;
- }
- for (const key of Object.keys(node)) {
- if (key[0] === "_" && node[key] != null) node[key] = undefined;
- }
- const symbols = Object.getOwnPropertySymbols(node);
- for (const sym of symbols) {
- node[sym] = null;
- }
- }
- Object.defineProperty(removePropertiesDeep$1, "__esModule", {
- value: true
- });
- removePropertiesDeep$1.default = removePropertiesDeep;
- var _traverseFast = traverseFast$1;
- var _removeProperties = removeProperties$1;
- function removePropertiesDeep(tree, opts) {
- (0, _traverseFast.default)(tree, _removeProperties.default, opts);
- return tree;
- }
- Object.defineProperty(toKeyAlias$1, "__esModule", {
- value: true
- });
- toKeyAlias$1.default = toKeyAlias;
- var _generated$c = generated$4;
- var _cloneNode$1 = cloneNode$1;
- var _removePropertiesDeep = removePropertiesDeep$1;
- function toKeyAlias(node, key = node.key) {
- let alias;
- if (node.kind === "method") {
- return toKeyAlias.increment() + "";
- } else if ((0, _generated$c.isIdentifier)(key)) {
- alias = key.name;
- } else if ((0, _generated$c.isStringLiteral)(key)) {
- alias = JSON.stringify(key.value);
- } else {
- alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode$1.default)(key)));
- }
- if (node.computed) {
- alias = `[${alias}]`;
- }
- if (node.static) {
- alias = `static:${alias}`;
- }
- return alias;
- }
- toKeyAlias.uid = 0;
- toKeyAlias.increment = function () {
- if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
- return toKeyAlias.uid = 0;
- } else {
- return toKeyAlias.uid++;
- }
- };
- var toSequenceExpression$1 = {};
- var gatherSequenceExpressions$1 = {};
- var getBindingIdentifiers$1 = {};
- Object.defineProperty(getBindingIdentifiers$1, "__esModule", {
- value: true
- });
- getBindingIdentifiers$1.default = getBindingIdentifiers;
- var _generated$b = generated$4;
- function getBindingIdentifiers(node, duplicates, outerOnly) {
- let search = [].concat(node);
- const ids = Object.create(null);
- while (search.length) {
- const id = search.shift();
- if (!id) continue;
- const keys = getBindingIdentifiers.keys[id.type];
- if ((0, _generated$b.isIdentifier)(id)) {
- if (duplicates) {
- const _ids = ids[id.name] = ids[id.name] || [];
- _ids.push(id);
- } else {
- ids[id.name] = id;
- }
- continue;
- }
- if ((0, _generated$b.isExportDeclaration)(id) && !(0, _generated$b.isExportAllDeclaration)(id)) {
- if ((0, _generated$b.isDeclaration)(id.declaration)) {
- search.push(id.declaration);
- }
- continue;
- }
- if (outerOnly) {
- if ((0, _generated$b.isFunctionDeclaration)(id)) {
- search.push(id.id);
- continue;
- }
- if ((0, _generated$b.isFunctionExpression)(id)) {
- continue;
- }
- }
- if (keys) {
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i];
- if (id[key]) {
- search = search.concat(id[key]);
- }
- }
- }
- }
- return ids;
- }
- getBindingIdentifiers.keys = {
- DeclareClass: ["id"],
- DeclareFunction: ["id"],
- DeclareModule: ["id"],
- DeclareVariable: ["id"],
- DeclareInterface: ["id"],
- DeclareTypeAlias: ["id"],
- DeclareOpaqueType: ["id"],
- InterfaceDeclaration: ["id"],
- TypeAlias: ["id"],
- OpaqueType: ["id"],
- CatchClause: ["param"],
- LabeledStatement: ["label"],
- UnaryExpression: ["argument"],
- AssignmentExpression: ["left"],
- ImportSpecifier: ["local"],
- ImportNamespaceSpecifier: ["local"],
- ImportDefaultSpecifier: ["local"],
- ImportDeclaration: ["specifiers"],
- ExportSpecifier: ["exported"],
- ExportNamespaceSpecifier: ["exported"],
- ExportDefaultSpecifier: ["exported"],
- FunctionDeclaration: ["id", "params"],
- FunctionExpression: ["id", "params"],
- ArrowFunctionExpression: ["params"],
- ObjectMethod: ["params"],
- ClassMethod: ["params"],
- ForInStatement: ["left"],
- ForOfStatement: ["left"],
- ClassDeclaration: ["id"],
- ClassExpression: ["id"],
- RestElement: ["argument"],
- UpdateExpression: ["argument"],
- ObjectProperty: ["value"],
- AssignmentPattern: ["left"],
- ArrayPattern: ["elements"],
- ObjectPattern: ["properties"],
- VariableDeclaration: ["declarations"],
- VariableDeclarator: ["id"]
- };
- Object.defineProperty(gatherSequenceExpressions$1, "__esModule", {
- value: true
- });
- gatherSequenceExpressions$1.default = gatherSequenceExpressions;
- var _getBindingIdentifiers$2 = getBindingIdentifiers$1;
- var _generated$a = generated$4;
- var _generated2$1 = generated$3;
- var _cloneNode = cloneNode$1;
- function gatherSequenceExpressions(nodes, scope, declars) {
- const exprs = [];
- let ensureLastUndefined = true;
- for (const node of nodes) {
- if (!(0, _generated$a.isEmptyStatement)(node)) {
- ensureLastUndefined = false;
- }
- if ((0, _generated$a.isExpression)(node)) {
- exprs.push(node);
- } else if ((0, _generated$a.isExpressionStatement)(node)) {
- exprs.push(node.expression);
- } else if ((0, _generated$a.isVariableDeclaration)(node)) {
- if (node.kind !== "var") return;
- for (const declar of node.declarations) {
- const bindings = (0, _getBindingIdentifiers$2.default)(declar);
- for (const key of Object.keys(bindings)) {
- declars.push({
- kind: node.kind,
- id: (0, _cloneNode.default)(bindings[key])
- });
- }
- if (declar.init) {
- exprs.push((0, _generated2$1.assignmentExpression)("=", declar.id, declar.init));
- }
- }
- ensureLastUndefined = true;
- } else if ((0, _generated$a.isIfStatement)(node)) {
- const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
- const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
- if (!consequent || !alternate) return;
- exprs.push((0, _generated2$1.conditionalExpression)(node.test, consequent, alternate));
- } else if ((0, _generated$a.isBlockStatement)(node)) {
- const body = gatherSequenceExpressions(node.body, scope, declars);
- if (!body) return;
- exprs.push(body);
- } else if ((0, _generated$a.isEmptyStatement)(node)) {
- if (nodes.indexOf(node) === 0) {
- ensureLastUndefined = true;
- }
- } else {
- return;
- }
- }
- if (ensureLastUndefined) {
- exprs.push(scope.buildUndefinedNode());
- }
- if (exprs.length === 1) {
- return exprs[0];
- } else {
- return (0, _generated2$1.sequenceExpression)(exprs);
- }
- }
- Object.defineProperty(toSequenceExpression$1, "__esModule", {
- value: true
- });
- toSequenceExpression$1.default = toSequenceExpression;
- var _gatherSequenceExpressions = gatherSequenceExpressions$1;
- function toSequenceExpression(nodes, scope) {
- if (!(nodes != null && nodes.length)) return;
- const declars = [];
- const result = (0, _gatherSequenceExpressions.default)(nodes, scope, declars);
- if (!result) return;
- for (const declar of declars) {
- scope.push(declar);
- }
- return result;
- }
- var toStatement$1 = {};
- Object.defineProperty(toStatement$1, "__esModule", {
- value: true
- });
- toStatement$1.default = void 0;
- var _generated$9 = generated$4;
- var _generated2 = generated$3;
- var _default$2 = toStatement;
- toStatement$1.default = _default$2;
- function toStatement(node, ignore) {
- if ((0, _generated$9.isStatement)(node)) {
- return node;
- }
- let mustHaveId = false;
- let newType;
- if ((0, _generated$9.isClass)(node)) {
- mustHaveId = true;
- newType = "ClassDeclaration";
- } else if ((0, _generated$9.isFunction)(node)) {
- mustHaveId = true;
- newType = "FunctionDeclaration";
- } else if ((0, _generated$9.isAssignmentExpression)(node)) {
- return (0, _generated2.expressionStatement)(node);
- }
- if (mustHaveId && !node.id) {
- newType = false;
- }
- if (!newType) {
- if (ignore) {
- return false;
- } else {
- throw new Error(`cannot turn ${node.type} to a statement`);
- }
- }
- node.type = newType;
- return node;
- }
- var valueToNode$1 = {};
- Object.defineProperty(valueToNode$1, "__esModule", {
- value: true
- });
- valueToNode$1.default = void 0;
- var _isValidIdentifier$1 = isValidIdentifier$1;
- var _generated$8 = generated$3;
- var _default$1 = valueToNode;
- valueToNode$1.default = _default$1;
- const objectToString = Function.call.bind(Object.prototype.toString);
- function isRegExp(value) {
- return objectToString(value) === "[object RegExp]";
- }
- function isPlainObject(value) {
- if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") {
- return false;
- }
- const proto = Object.getPrototypeOf(value);
- return proto === null || Object.getPrototypeOf(proto) === null;
- }
- function valueToNode(value) {
- if (value === undefined) {
- return (0, _generated$8.identifier)("undefined");
- }
- if (value === true || value === false) {
- return (0, _generated$8.booleanLiteral)(value);
- }
- if (value === null) {
- return (0, _generated$8.nullLiteral)();
- }
- if (typeof value === "string") {
- return (0, _generated$8.stringLiteral)(value);
- }
- if (typeof value === "number") {
- let result;
- if (Number.isFinite(value)) {
- result = (0, _generated$8.numericLiteral)(Math.abs(value));
- } else {
- let numerator;
- if (Number.isNaN(value)) {
- numerator = (0, _generated$8.numericLiteral)(0);
- } else {
- numerator = (0, _generated$8.numericLiteral)(1);
- }
- result = (0, _generated$8.binaryExpression)("/", numerator, (0, _generated$8.numericLiteral)(0));
- }
- if (value < 0 || Object.is(value, -0)) {
- result = (0, _generated$8.unaryExpression)("-", result);
- }
- return result;
- }
- if (isRegExp(value)) {
- const pattern = value.source;
- const flags = value.toString().match(/\/([a-z]+|)$/)[1];
- return (0, _generated$8.regExpLiteral)(pattern, flags);
- }
- if (Array.isArray(value)) {
- return (0, _generated$8.arrayExpression)(value.map(valueToNode));
- }
- if (isPlainObject(value)) {
- const props = [];
- for (const key of Object.keys(value)) {
- let nodeKey;
- if ((0, _isValidIdentifier$1.default)(key)) {
- nodeKey = (0, _generated$8.identifier)(key);
- } else {
- nodeKey = (0, _generated$8.stringLiteral)(key);
- }
- props.push((0, _generated$8.objectProperty)(nodeKey, valueToNode(value[key])));
- }
- return (0, _generated$8.objectExpression)(props);
- }
- throw new Error("don't know how to turn this value into a node");
- }
- var appendToMemberExpression$1 = {};
- Object.defineProperty(appendToMemberExpression$1, "__esModule", {
- value: true
- });
- appendToMemberExpression$1.default = appendToMemberExpression;
- var _generated$7 = generated$3;
- function appendToMemberExpression(member, append, computed = false) {
- member.object = (0, _generated$7.memberExpression)(member.object, member.property, member.computed);
- member.property = append;
- member.computed = !!computed;
- return member;
- }
- var inherits$1 = {};
- Object.defineProperty(inherits$1, "__esModule", {
- value: true
- });
- inherits$1.default = inherits;
- var _constants$2 = constants;
- var _inheritsComments = inheritsComments$1;
- function inherits(child, parent) {
- if (!child || !parent) return child;
- for (const key of _constants$2.INHERIT_KEYS.optional) {
- if (child[key] == null) {
- child[key] = parent[key];
- }
- }
- for (const key of Object.keys(parent)) {
- if (key[0] === "_" && key !== "__clone") child[key] = parent[key];
- }
- for (const key of _constants$2.INHERIT_KEYS.force) {
- child[key] = parent[key];
- }
- (0, _inheritsComments.default)(child, parent);
- return child;
- }
- var prependToMemberExpression$1 = {};
- Object.defineProperty(prependToMemberExpression$1, "__esModule", {
- value: true
- });
- prependToMemberExpression$1.default = prependToMemberExpression;
- var _generated$6 = generated$3;
- function prependToMemberExpression(member, prepend) {
- member.object = (0, _generated$6.memberExpression)(prepend, member.object);
- return member;
- }
- var getOuterBindingIdentifiers$1 = {};
- Object.defineProperty(getOuterBindingIdentifiers$1, "__esModule", {
- value: true
- });
- getOuterBindingIdentifiers$1.default = void 0;
- var _getBindingIdentifiers$1 = getBindingIdentifiers$1;
- var _default = getOuterBindingIdentifiers;
- getOuterBindingIdentifiers$1.default = _default;
- function getOuterBindingIdentifiers(node, duplicates) {
- return (0, _getBindingIdentifiers$1.default)(node, duplicates, true);
- }
- var traverse$1 = {};
- Object.defineProperty(traverse$1, "__esModule", {
- value: true
- });
- traverse$1.default = traverse;
- var _definitions$1 = definitions;
- function traverse(node, handlers, state) {
- if (typeof handlers === "function") {
- handlers = {
- enter: handlers
- };
- }
- const {
- enter,
- exit
- } = handlers;
- traverseSimpleImpl(node, enter, exit, state, []);
- }
- function traverseSimpleImpl(node, enter, exit, state, ancestors) {
- const keys = _definitions$1.VISITOR_KEYS[node.type];
- if (!keys) return;
- if (enter) enter(node, ancestors, state);
- for (const key of keys) {
- const subNode = node[key];
- if (Array.isArray(subNode)) {
- for (let i = 0; i < subNode.length; i++) {
- const child = subNode[i];
- if (!child) continue;
- ancestors.push({
- node,
- key,
- index: i
- });
- traverseSimpleImpl(child, enter, exit, state, ancestors);
- ancestors.pop();
- }
- } else if (subNode) {
- ancestors.push({
- node,
- key
- });
- traverseSimpleImpl(subNode, enter, exit, state, ancestors);
- ancestors.pop();
- }
- }
- if (exit) exit(node, ancestors, state);
- }
- var isBinding$1 = {};
- Object.defineProperty(isBinding$1, "__esModule", {
- value: true
- });
- isBinding$1.default = isBinding;
- var _getBindingIdentifiers = getBindingIdentifiers$1;
- function isBinding(node, parent, grandparent) {
- if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
- return false;
- }
- const keys = _getBindingIdentifiers.default.keys[parent.type];
- if (keys) {
- for (let i = 0; i < keys.length; i++) {
- const key = keys[i];
- const val = parent[key];
- if (Array.isArray(val)) {
- if (val.indexOf(node) >= 0) return true;
- } else {
- if (val === node) return true;
- }
- }
- }
- return false;
- }
- var isBlockScoped$1 = {};
- var isLet$1 = {};
- Object.defineProperty(isLet$1, "__esModule", {
- value: true
- });
- isLet$1.default = isLet;
- var _generated$5 = generated$4;
- var _constants$1 = constants;
- function isLet(node) {
- return (0, _generated$5.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants$1.BLOCK_SCOPED_SYMBOL]);
- }
- Object.defineProperty(isBlockScoped$1, "__esModule", {
- value: true
- });
- isBlockScoped$1.default = isBlockScoped;
- var _generated$4 = generated$4;
- var _isLet = isLet$1;
- function isBlockScoped(node) {
- return (0, _generated$4.isFunctionDeclaration)(node) || (0, _generated$4.isClassDeclaration)(node) || (0, _isLet.default)(node);
- }
- var isImmutable$1 = {};
- Object.defineProperty(isImmutable$1, "__esModule", {
- value: true
- });
- isImmutable$1.default = isImmutable;
- var _isType = isType$1;
- var _generated$3 = generated$4;
- function isImmutable(node) {
- if ((0, _isType.default)(node.type, "Immutable")) return true;
- if ((0, _generated$3.isIdentifier)(node)) {
- if (node.name === "undefined") {
- return true;
- } else {
- return false;
- }
- }
- return false;
- }
- var isNodesEquivalent$1 = {};
- Object.defineProperty(isNodesEquivalent$1, "__esModule", {
- value: true
- });
- isNodesEquivalent$1.default = isNodesEquivalent;
- var _definitions = definitions;
- function isNodesEquivalent(a, b) {
- if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
- return a === b;
- }
- if (a.type !== b.type) {
- return false;
- }
- const fields = Object.keys(_definitions.NODE_FIELDS[a.type] || a.type);
- const visitorKeys = _definitions.VISITOR_KEYS[a.type];
- for (const field of fields) {
- if (typeof a[field] !== typeof b[field]) {
- return false;
- }
- if (a[field] == null && b[field] == null) {
- continue;
- } else if (a[field] == null || b[field] == null) {
- return false;
- }
- if (Array.isArray(a[field])) {
- if (!Array.isArray(b[field])) {
- return false;
- }
- if (a[field].length !== b[field].length) {
- return false;
- }
- for (let i = 0; i < a[field].length; i++) {
- if (!isNodesEquivalent(a[field][i], b[field][i])) {
- return false;
- }
- }
- continue;
- }
- if (typeof a[field] === "object" && !(visitorKeys != null && visitorKeys.includes(field))) {
- for (const key of Object.keys(a[field])) {
- if (a[field][key] !== b[field][key]) {
- return false;
- }
- }
- continue;
- }
- if (!isNodesEquivalent(a[field], b[field])) {
- return false;
- }
- }
- return true;
- }
- var isReferenced$1 = {};
- Object.defineProperty(isReferenced$1, "__esModule", {
- value: true
- });
- isReferenced$1.default = isReferenced;
- function isReferenced(node, parent, grandparent) {
- switch (parent.type) {
- case "MemberExpression":
- case "JSXMemberExpression":
- case "OptionalMemberExpression":
- if (parent.property === node) {
- return !!parent.computed;
- }
- return parent.object === node;
- case "VariableDeclarator":
- return parent.init === node;
- case "ArrowFunctionExpression":
- return parent.body === node;
- case "PrivateName":
- return false;
- case "ClassMethod":
- case "ClassPrivateMethod":
- case "ObjectMethod":
- if (parent.params.includes(node)) {
- return false;
- }
- case "ObjectProperty":
- case "ClassProperty":
- case "ClassPrivateProperty":
- if (parent.key === node) {
- return !!parent.computed;
- }
- if (parent.value === node) {
- return !grandparent || grandparent.type !== "ObjectPattern";
- }
- return true;
- case "ClassDeclaration":
- case "ClassExpression":
- return parent.superClass === node;
- case "AssignmentExpression":
- return parent.right === node;
- case "AssignmentPattern":
- return parent.right === node;
- case "LabeledStatement":
- return false;
- case "CatchClause":
- return false;
- case "RestElement":
- return false;
- case "BreakStatement":
- case "ContinueStatement":
- return false;
- case "FunctionDeclaration":
- case "FunctionExpression":
- return false;
- case "ExportNamespaceSpecifier":
- case "ExportDefaultSpecifier":
- return false;
- case "ExportSpecifier":
- if (grandparent != null && grandparent.source) {
- return false;
- }
- return parent.local === node;
- case "ImportDefaultSpecifier":
- case "ImportNamespaceSpecifier":
- case "ImportSpecifier":
- return false;
- case "JSXAttribute":
- return false;
- case "ObjectPattern":
- case "ArrayPattern":
- return false;
- case "MetaProperty":
- return false;
- case "ObjectTypeProperty":
- return parent.key !== node;
- case "TSEnumMember":
- return parent.id !== node;
- case "TSPropertySignature":
- if (parent.key === node) {
- return !!parent.computed;
- }
- return true;
- }
- return true;
- }
- var isScope$1 = {};
- Object.defineProperty(isScope$1, "__esModule", {
- value: true
- });
- isScope$1.default = isScope;
- var _generated$2 = generated$4;
- function isScope(node, parent) {
- if ((0, _generated$2.isBlockStatement)(node) && ((0, _generated$2.isFunction)(parent) || (0, _generated$2.isCatchClause)(parent))) {
- return false;
- }
- if ((0, _generated$2.isPattern)(node) && ((0, _generated$2.isFunction)(parent) || (0, _generated$2.isCatchClause)(parent))) {
- return true;
- }
- return (0, _generated$2.isScopable)(node);
- }
- var isSpecifierDefault$1 = {};
- Object.defineProperty(isSpecifierDefault$1, "__esModule", {
- value: true
- });
- isSpecifierDefault$1.default = isSpecifierDefault;
- var _generated$1 = generated$4;
- function isSpecifierDefault(specifier) {
- return (0, _generated$1.isImportDefaultSpecifier)(specifier) || (0, _generated$1.isIdentifier)(specifier.imported || specifier.exported, {
- name: "default"
- });
- }
- var isValidES3Identifier$1 = {};
- Object.defineProperty(isValidES3Identifier$1, "__esModule", {
- value: true
- });
- isValidES3Identifier$1.default = isValidES3Identifier;
- var _isValidIdentifier = isValidIdentifier$1;
- const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
- function isValidES3Identifier(name) {
- return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
- }
- var isVar$1 = {};
- Object.defineProperty(isVar$1, "__esModule", {
- value: true
- });
- isVar$1.default = isVar;
- var _generated = generated$4;
- var _constants = constants;
- function isVar(node) {
- return (0, _generated.isVariableDeclaration)(node, {
- kind: "var"
- }) && !node[_constants.BLOCK_SCOPED_SYMBOL];
- }
- var generated = {
- __proto__: null
- };
- var require$$65 = /*@__PURE__*/build.getAugmentedNamespace(generated);
- (function (exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var _exportNames = {
- react: true,
- assertNode: true,
- createTypeAnnotationBasedOnTypeof: true,
- createUnionTypeAnnotation: true,
- createFlowUnionType: true,
- createTSUnionType: true,
- cloneNode: true,
- clone: true,
- cloneDeep: true,
- cloneDeepWithoutLoc: true,
- cloneWithoutLoc: true,
- addComment: true,
- addComments: true,
- inheritInnerComments: true,
- inheritLeadingComments: true,
- inheritsComments: true,
- inheritTrailingComments: true,
- removeComments: true,
- ensureBlock: true,
- toBindingIdentifierName: true,
- toBlock: true,
- toComputedKey: true,
- toExpression: true,
- toIdentifier: true,
- toKeyAlias: true,
- toSequenceExpression: true,
- toStatement: true,
- valueToNode: true,
- appendToMemberExpression: true,
- inherits: true,
- prependToMemberExpression: true,
- removeProperties: true,
- removePropertiesDeep: true,
- removeTypeDuplicates: true,
- getBindingIdentifiers: true,
- getOuterBindingIdentifiers: true,
- traverse: true,
- traverseFast: true,
- shallowEqual: true,
- is: true,
- isBinding: true,
- isBlockScoped: true,
- isImmutable: true,
- isLet: true,
- isNode: true,
- isNodesEquivalent: true,
- isPlaceholderType: true,
- isReferenced: true,
- isScope: true,
- isSpecifierDefault: true,
- isType: true,
- isValidES3Identifier: true,
- isValidIdentifier: true,
- isVar: true,
- matchesPattern: true,
- validate: true,
- buildMatchMemberExpression: true
- };
- Object.defineProperty(exports, "assertNode", {
- enumerable: true,
- get: function () {
- return _assertNode.default;
- }
- });
- Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
- enumerable: true,
- get: function () {
- return _createTypeAnnotationBasedOnTypeof.default;
- }
- });
- Object.defineProperty(exports, "createUnionTypeAnnotation", {
- enumerable: true,
- get: function () {
- return _createFlowUnionType.default;
- }
- });
- Object.defineProperty(exports, "createFlowUnionType", {
- enumerable: true,
- get: function () {
- return _createFlowUnionType.default;
- }
- });
- Object.defineProperty(exports, "createTSUnionType", {
- enumerable: true,
- get: function () {
- return _createTSUnionType.default;
- }
- });
- Object.defineProperty(exports, "cloneNode", {
- enumerable: true,
- get: function () {
- return _cloneNode.default;
- }
- });
- Object.defineProperty(exports, "clone", {
- enumerable: true,
- get: function () {
- return _clone.default;
- }
- });
- Object.defineProperty(exports, "cloneDeep", {
- enumerable: true,
- get: function () {
- return _cloneDeep.default;
- }
- });
- Object.defineProperty(exports, "cloneDeepWithoutLoc", {
- enumerable: true,
- get: function () {
- return _cloneDeepWithoutLoc.default;
- }
- });
- Object.defineProperty(exports, "cloneWithoutLoc", {
- enumerable: true,
- get: function () {
- return _cloneWithoutLoc.default;
- }
- });
- Object.defineProperty(exports, "addComment", {
- enumerable: true,
- get: function () {
- return _addComment.default;
- }
- });
- Object.defineProperty(exports, "addComments", {
- enumerable: true,
- get: function () {
- return _addComments.default;
- }
- });
- Object.defineProperty(exports, "inheritInnerComments", {
- enumerable: true,
- get: function () {
- return _inheritInnerComments.default;
- }
- });
- Object.defineProperty(exports, "inheritLeadingComments", {
- enumerable: true,
- get: function () {
- return _inheritLeadingComments.default;
- }
- });
- Object.defineProperty(exports, "inheritsComments", {
- enumerable: true,
- get: function () {
- return _inheritsComments.default;
- }
- });
- Object.defineProperty(exports, "inheritTrailingComments", {
- enumerable: true,
- get: function () {
- return _inheritTrailingComments.default;
- }
- });
- Object.defineProperty(exports, "removeComments", {
- enumerable: true,
- get: function () {
- return _removeComments.default;
- }
- });
- Object.defineProperty(exports, "ensureBlock", {
- enumerable: true,
- get: function () {
- return _ensureBlock.default;
- }
- });
- Object.defineProperty(exports, "toBindingIdentifierName", {
- enumerable: true,
- get: function () {
- return _toBindingIdentifierName.default;
- }
- });
- Object.defineProperty(exports, "toBlock", {
- enumerable: true,
- get: function () {
- return _toBlock.default;
- }
- });
- Object.defineProperty(exports, "toComputedKey", {
- enumerable: true,
- get: function () {
- return _toComputedKey.default;
- }
- });
- Object.defineProperty(exports, "toExpression", {
- enumerable: true,
- get: function () {
- return _toExpression.default;
- }
- });
- Object.defineProperty(exports, "toIdentifier", {
- enumerable: true,
- get: function () {
- return _toIdentifier.default;
- }
- });
- Object.defineProperty(exports, "toKeyAlias", {
- enumerable: true,
- get: function () {
- return _toKeyAlias.default;
- }
- });
- Object.defineProperty(exports, "toSequenceExpression", {
- enumerable: true,
- get: function () {
- return _toSequenceExpression.default;
- }
- });
- Object.defineProperty(exports, "toStatement", {
- enumerable: true,
- get: function () {
- return _toStatement.default;
- }
- });
- Object.defineProperty(exports, "valueToNode", {
- enumerable: true,
- get: function () {
- return _valueToNode.default;
- }
- });
- Object.defineProperty(exports, "appendToMemberExpression", {
- enumerable: true,
- get: function () {
- return _appendToMemberExpression.default;
- }
- });
- Object.defineProperty(exports, "inherits", {
- enumerable: true,
- get: function () {
- return _inherits.default;
- }
- });
- Object.defineProperty(exports, "prependToMemberExpression", {
- enumerable: true,
- get: function () {
- return _prependToMemberExpression.default;
- }
- });
- Object.defineProperty(exports, "removeProperties", {
- enumerable: true,
- get: function () {
- return _removeProperties.default;
- }
- });
- Object.defineProperty(exports, "removePropertiesDeep", {
- enumerable: true,
- get: function () {
- return _removePropertiesDeep.default;
- }
- });
- Object.defineProperty(exports, "removeTypeDuplicates", {
- enumerable: true,
- get: function () {
- return _removeTypeDuplicates.default;
- }
- });
- Object.defineProperty(exports, "getBindingIdentifiers", {
- enumerable: true,
- get: function () {
- return _getBindingIdentifiers.default;
- }
- });
- Object.defineProperty(exports, "getOuterBindingIdentifiers", {
- enumerable: true,
- get: function () {
- return _getOuterBindingIdentifiers.default;
- }
- });
- Object.defineProperty(exports, "traverse", {
- enumerable: true,
- get: function () {
- return _traverse.default;
- }
- });
- Object.defineProperty(exports, "traverseFast", {
- enumerable: true,
- get: function () {
- return _traverseFast.default;
- }
- });
- Object.defineProperty(exports, "shallowEqual", {
- enumerable: true,
- get: function () {
- return _shallowEqual.default;
- }
- });
- Object.defineProperty(exports, "is", {
- enumerable: true,
- get: function () {
- return _is.default;
- }
- });
- Object.defineProperty(exports, "isBinding", {
- enumerable: true,
- get: function () {
- return _isBinding.default;
- }
- });
- Object.defineProperty(exports, "isBlockScoped", {
- enumerable: true,
- get: function () {
- return _isBlockScoped.default;
- }
- });
- Object.defineProperty(exports, "isImmutable", {
- enumerable: true,
- get: function () {
- return _isImmutable.default;
- }
- });
- Object.defineProperty(exports, "isLet", {
- enumerable: true,
- get: function () {
- return _isLet.default;
- }
- });
- Object.defineProperty(exports, "isNode", {
- enumerable: true,
- get: function () {
- return _isNode.default;
- }
- });
- Object.defineProperty(exports, "isNodesEquivalent", {
- enumerable: true,
- get: function () {
- return _isNodesEquivalent.default;
- }
- });
- Object.defineProperty(exports, "isPlaceholderType", {
- enumerable: true,
- get: function () {
- return _isPlaceholderType.default;
- }
- });
- Object.defineProperty(exports, "isReferenced", {
- enumerable: true,
- get: function () {
- return _isReferenced.default;
- }
- });
- Object.defineProperty(exports, "isScope", {
- enumerable: true,
- get: function () {
- return _isScope.default;
- }
- });
- Object.defineProperty(exports, "isSpecifierDefault", {
- enumerable: true,
- get: function () {
- return _isSpecifierDefault.default;
- }
- });
- Object.defineProperty(exports, "isType", {
- enumerable: true,
- get: function () {
- return _isType.default;
- }
- });
- Object.defineProperty(exports, "isValidES3Identifier", {
- enumerable: true,
- get: function () {
- return _isValidES3Identifier.default;
- }
- });
- Object.defineProperty(exports, "isValidIdentifier", {
- enumerable: true,
- get: function () {
- return _isValidIdentifier.default;
- }
- });
- Object.defineProperty(exports, "isVar", {
- enumerable: true,
- get: function () {
- return _isVar.default;
- }
- });
- Object.defineProperty(exports, "matchesPattern", {
- enumerable: true,
- get: function () {
- return _matchesPattern.default;
- }
- });
- Object.defineProperty(exports, "validate", {
- enumerable: true,
- get: function () {
- return _validate.default;
- }
- });
- Object.defineProperty(exports, "buildMatchMemberExpression", {
- enumerable: true,
- get: function () {
- return _buildMatchMemberExpression.default;
- }
- });
- exports.react = void 0;
- var _isReactComponent = isReactComponent$1;
- var _isCompatTag = isCompatTag$1;
- var _buildChildren = buildChildren$1;
- var _assertNode = assertNode$1;
- var _generated = generated$2;
- Object.keys(_generated).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _generated[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _generated[key];
- }
- });
- });
- var _createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof$1;
- var _createFlowUnionType = createFlowUnionType$1;
- var _createTSUnionType = createTSUnionType$1;
- var _generated2 = generated$3;
- Object.keys(_generated2).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _generated2[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _generated2[key];
- }
- });
- });
- var _uppercase = uppercase;
- Object.keys(_uppercase).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _uppercase[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _uppercase[key];
- }
- });
- });
- var _cloneNode = cloneNode$1;
- var _clone = clone$1;
- var _cloneDeep = cloneDeep$1;
- var _cloneDeepWithoutLoc = cloneDeepWithoutLoc$1;
- var _cloneWithoutLoc = cloneWithoutLoc$1;
- var _addComment = addComment$1;
- var _addComments = addComments$1;
- var _inheritInnerComments = inheritInnerComments$1;
- var _inheritLeadingComments = inheritLeadingComments$1;
- var _inheritsComments = inheritsComments$1;
- var _inheritTrailingComments = inheritTrailingComments$1;
- var _removeComments = removeComments$1;
- var _generated3 = generated$1;
- Object.keys(_generated3).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _generated3[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _generated3[key];
- }
- });
- });
- var _constants = constants;
- Object.keys(_constants).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _constants[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _constants[key];
- }
- });
- });
- var _ensureBlock = ensureBlock$1;
- var _toBindingIdentifierName = toBindingIdentifierName$1;
- var _toBlock = toBlock$1;
- var _toComputedKey = toComputedKey$1;
- var _toExpression = toExpression$1;
- var _toIdentifier = toIdentifier$1;
- var _toKeyAlias = toKeyAlias$1;
- var _toSequenceExpression = toSequenceExpression$1;
- var _toStatement = toStatement$1;
- var _valueToNode = valueToNode$1;
- var _definitions = definitions;
- Object.keys(_definitions).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _definitions[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _definitions[key];
- }
- });
- });
- var _appendToMemberExpression = appendToMemberExpression$1;
- var _inherits = inherits$1;
- var _prependToMemberExpression = prependToMemberExpression$1;
- var _removeProperties = removeProperties$1;
- var _removePropertiesDeep = removePropertiesDeep$1;
- var _removeTypeDuplicates = removeTypeDuplicates$3;
- var _getBindingIdentifiers = getBindingIdentifiers$1;
- var _getOuterBindingIdentifiers = getOuterBindingIdentifiers$1;
- var _traverse = traverse$1;
- Object.keys(_traverse).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _traverse[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _traverse[key];
- }
- });
- });
- var _traverseFast = traverseFast$1;
- var _shallowEqual = shallowEqual$1;
- var _is = is$1;
- var _isBinding = isBinding$1;
- var _isBlockScoped = isBlockScoped$1;
- var _isImmutable = isImmutable$1;
- var _isLet = isLet$1;
- var _isNode = isNode$1;
- var _isNodesEquivalent = isNodesEquivalent$1;
- var _isPlaceholderType = isPlaceholderType$1;
- var _isReferenced = isReferenced$1;
- var _isScope = isScope$1;
- var _isSpecifierDefault = isSpecifierDefault$1;
- var _isType = isType$1;
- var _isValidES3Identifier = isValidES3Identifier$1;
- var _isValidIdentifier = isValidIdentifier$1;
- var _isVar = isVar$1;
- var _matchesPattern = matchesPattern$1;
- var _validate = validate$2;
- var _buildMatchMemberExpression = buildMatchMemberExpression$1;
- var _generated4 = generated$4;
- Object.keys(_generated4).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _generated4[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _generated4[key];
- }
- });
- });
- var _generated5 = require$$65;
- Object.keys(_generated5).forEach(function (key) {
- if (key === "default" || key === "__esModule") return;
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
- if (key in exports && exports[key] === _generated5[key]) return;
- Object.defineProperty(exports, key, {
- enumerable: true,
- get: function () {
- return _generated5[key];
- }
- });
- });
- const react = {
- isReactComponent: _isReactComponent.default,
- isCompatTag: _isCompatTag.default,
- buildChildren: _buildChildren.default
- };
- exports.react = react;
- }(lib$1));
- function defaultOnError(error) {
- throw error;
- }
- function defaultOnWarn(msg) {
- (process.env.NODE_ENV !== 'production') && console.warn(`[Vue warn] ${msg.message}`);
- }
- function createCompilerError(code, loc, messages, additionalMessage) {
- const msg = (process.env.NODE_ENV !== 'production') || !true
- ? (messages || errorMessages)[code] + (additionalMessage || ``)
- : code;
- const error = new SyntaxError(String(msg));
- error.code = code;
- error.loc = loc;
- return error;
- }
- const errorMessages = {
- // parse errors
- [0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */]: 'Illegal comment.',
- [1 /* CDATA_IN_HTML_CONTENT */]: 'CDATA section is allowed only in XML context.',
- [2 /* DUPLICATE_ATTRIBUTE */]: 'Duplicate attribute.',
- [3 /* END_TAG_WITH_ATTRIBUTES */]: 'End tag cannot have attributes.',
- [4 /* END_TAG_WITH_TRAILING_SOLIDUS */]: "Illegal '/' in tags.",
- [5 /* EOF_BEFORE_TAG_NAME */]: 'Unexpected EOF in tag.',
- [6 /* EOF_IN_CDATA */]: 'Unexpected EOF in CDATA section.',
- [7 /* EOF_IN_COMMENT */]: 'Unexpected EOF in comment.',
- [8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */]: 'Unexpected EOF in script.',
- [9 /* EOF_IN_TAG */]: 'Unexpected EOF in tag.',
- [10 /* INCORRECTLY_CLOSED_COMMENT */]: 'Incorrectly closed comment.',
- [11 /* INCORRECTLY_OPENED_COMMENT */]: 'Incorrectly opened comment.',
- [12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */]: "Illegal tag name. Use '<' to print '<'.",
- [13 /* MISSING_ATTRIBUTE_VALUE */]: 'Attribute value was expected.',
- [14 /* MISSING_END_TAG_NAME */]: 'End tag name was expected.',
- [15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */]: 'Whitespace was expected.',
- [16 /* NESTED_COMMENT */]: "Unexpected '<!--' in comment.",
- [17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */]: 'Attribute name cannot contain U+0022 ("), U+0027 (\'), and U+003C (<).',
- [18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */]: 'Unquoted attribute value cannot contain U+0022 ("), U+0027 (\'), U+003C (<), U+003D (=), and U+0060 (`).',
- [19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */]: "Attribute name cannot start with '='.",
- [21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */]: "'<?' is allowed only in XML context.",
- [20 /* UNEXPECTED_NULL_CHARACTER */]: `Unexpected null cahracter.`,
- [22 /* UNEXPECTED_SOLIDUS_IN_TAG */]: "Illegal '/' in tags.",
- // Vue-specific parse errors
- [23 /* X_INVALID_END_TAG */]: 'Invalid end tag.',
- [24 /* X_MISSING_END_TAG */]: 'Element is missing end tag.',
- [25 /* X_MISSING_INTERPOLATION_END */]: 'Interpolation end sign was not found.',
- [26 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */]: 'End bracket for dynamic directive argument was not found. ' +
- 'Note that dynamic directive argument cannot contain spaces.',
- // transform errors
- [27 /* X_V_IF_NO_EXPRESSION */]: `v-if/v-else-if is missing expression.`,
- [28 /* X_V_IF_SAME_KEY */]: `v-if/else branches must use unique keys.`,
- [29 /* X_V_ELSE_NO_ADJACENT_IF */]: `v-else/v-else-if has no adjacent v-if.`,
- [30 /* X_V_FOR_NO_EXPRESSION */]: `v-for is missing expression.`,
- [31 /* X_V_FOR_MALFORMED_EXPRESSION */]: `v-for has invalid expression.`,
- [32 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */]: `<template v-for> key should be placed on the <template> tag.`,
- [33 /* X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,
- [34 /* X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,
- [35 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,
- [36 /* X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>.` +
- `When there are multiple named slots, all slots should use <template> ` +
- `syntax to avoid scope ambiguity.`,
- [37 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,
- [38 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */]: `Extraneous children found when component already has explicitly named ` +
- `default slot. These children will be ignored.`,
- [39 /* X_V_SLOT_MISPLACED */]: `v-slot can only be used on components or <template> tags.`,
- [40 /* X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,
- [41 /* X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,
- [42 /* X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
- [43 /* X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,
- [44 /* X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,
- // generic errors
- [45 /* X_PREFIX_ID_NOT_SUPPORTED */]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
- [46 /* X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,
- [47 /* X_CACHE_HANDLER_NOT_SUPPORTED */]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
- [48 /* X_SCOPE_ID_NOT_SUPPORTED */]: `"scopeId" option is only supported in module mode.`,
- // just to fullfill types
- [49 /* __EXTEND_POINT__ */]: ``
- };
- const FRAGMENT = Symbol((process.env.NODE_ENV !== 'production') ? `Fragment` : ``);
- const TELEPORT = Symbol((process.env.NODE_ENV !== 'production') ? `Teleport` : ``);
- const SUSPENSE = Symbol((process.env.NODE_ENV !== 'production') ? `Suspense` : ``);
- const KEEP_ALIVE = Symbol((process.env.NODE_ENV !== 'production') ? `KeepAlive` : ``);
- const BASE_TRANSITION = Symbol((process.env.NODE_ENV !== 'production') ? `BaseTransition` : ``);
- const OPEN_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `openBlock` : ``);
- const CREATE_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `createBlock` : ``);
- const CREATE_ELEMENT_BLOCK = Symbol((process.env.NODE_ENV !== 'production') ? `createElementBlock` : ``);
- const CREATE_VNODE = Symbol((process.env.NODE_ENV !== 'production') ? `createVNode` : ``);
- const CREATE_ELEMENT_VNODE = Symbol((process.env.NODE_ENV !== 'production') ? `createElementVNode` : ``);
- const CREATE_COMMENT = Symbol((process.env.NODE_ENV !== 'production') ? `createCommentVNode` : ``);
- const CREATE_TEXT = Symbol((process.env.NODE_ENV !== 'production') ? `createTextVNode` : ``);
- const CREATE_STATIC = Symbol((process.env.NODE_ENV !== 'production') ? `createStaticVNode` : ``);
- const RESOLVE_COMPONENT = Symbol((process.env.NODE_ENV !== 'production') ? `resolveComponent` : ``);
- const RESOLVE_DYNAMIC_COMPONENT = Symbol((process.env.NODE_ENV !== 'production') ? `resolveDynamicComponent` : ``);
- const RESOLVE_DIRECTIVE = Symbol((process.env.NODE_ENV !== 'production') ? `resolveDirective` : ``);
- const RESOLVE_FILTER = Symbol((process.env.NODE_ENV !== 'production') ? `resolveFilter` : ``);
- const WITH_DIRECTIVES = Symbol((process.env.NODE_ENV !== 'production') ? `withDirectives` : ``);
- const RENDER_LIST = Symbol((process.env.NODE_ENV !== 'production') ? `renderList` : ``);
- const RENDER_SLOT = Symbol((process.env.NODE_ENV !== 'production') ? `renderSlot` : ``);
- const CREATE_SLOTS = Symbol((process.env.NODE_ENV !== 'production') ? `createSlots` : ``);
- const TO_DISPLAY_STRING = Symbol((process.env.NODE_ENV !== 'production') ? `toDisplayString` : ``);
- const MERGE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `mergeProps` : ``);
- const NORMALIZE_CLASS = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeClass` : ``);
- const NORMALIZE_STYLE = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeStyle` : ``);
- const NORMALIZE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `normalizeProps` : ``);
- const GUARD_REACTIVE_PROPS = Symbol((process.env.NODE_ENV !== 'production') ? `guardReactiveProps` : ``);
- const TO_HANDLERS = Symbol((process.env.NODE_ENV !== 'production') ? `toHandlers` : ``);
- const CAMELIZE = Symbol((process.env.NODE_ENV !== 'production') ? `camelize` : ``);
- const CAPITALIZE = Symbol((process.env.NODE_ENV !== 'production') ? `capitalize` : ``);
- const TO_HANDLER_KEY = Symbol((process.env.NODE_ENV !== 'production') ? `toHandlerKey` : ``);
- const SET_BLOCK_TRACKING = Symbol((process.env.NODE_ENV !== 'production') ? `setBlockTracking` : ``);
- const PUSH_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `pushScopeId` : ``);
- const POP_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `popScopeId` : ``);
- const WITH_SCOPE_ID = Symbol((process.env.NODE_ENV !== 'production') ? `withScopeId` : ``);
- const WITH_CTX = Symbol((process.env.NODE_ENV !== 'production') ? `withCtx` : ``);
- const UNREF = Symbol((process.env.NODE_ENV !== 'production') ? `unref` : ``);
- const IS_REF = Symbol((process.env.NODE_ENV !== 'production') ? `isRef` : ``);
- const WITH_MEMO = Symbol((process.env.NODE_ENV !== 'production') ? `withMemo` : ``);
- const IS_MEMO_SAME = Symbol((process.env.NODE_ENV !== 'production') ? `isMemoSame` : ``);
- // Name mapping for runtime helpers that need to be imported from 'vue' in
- // generated code. Make sure these are correctly exported in the runtime!
- // Using `any` here because TS doesn't allow symbols as index type.
- const helperNameMap = {
- [FRAGMENT]: `Fragment`,
- [TELEPORT]: `Teleport`,
- [SUSPENSE]: `Suspense`,
- [KEEP_ALIVE]: `KeepAlive`,
- [BASE_TRANSITION]: `BaseTransition`,
- [OPEN_BLOCK]: `openBlock`,
- [CREATE_BLOCK]: `createBlock`,
- [CREATE_ELEMENT_BLOCK]: `createElementBlock`,
- [CREATE_VNODE]: `createVNode`,
- [CREATE_ELEMENT_VNODE]: `createElementVNode`,
- [CREATE_COMMENT]: `createCommentVNode`,
- [CREATE_TEXT]: `createTextVNode`,
- [CREATE_STATIC]: `createStaticVNode`,
- [RESOLVE_COMPONENT]: `resolveComponent`,
- [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
- [RESOLVE_DIRECTIVE]: `resolveDirective`,
- [RESOLVE_FILTER]: `resolveFilter`,
- [WITH_DIRECTIVES]: `withDirectives`,
- [RENDER_LIST]: `renderList`,
- [RENDER_SLOT]: `renderSlot`,
- [CREATE_SLOTS]: `createSlots`,
- [TO_DISPLAY_STRING]: `toDisplayString`,
- [MERGE_PROPS]: `mergeProps`,
- [NORMALIZE_CLASS]: `normalizeClass`,
- [NORMALIZE_STYLE]: `normalizeStyle`,
- [NORMALIZE_PROPS]: `normalizeProps`,
- [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
- [TO_HANDLERS]: `toHandlers`,
- [CAMELIZE]: `camelize`,
- [CAPITALIZE]: `capitalize`,
- [TO_HANDLER_KEY]: `toHandlerKey`,
- [SET_BLOCK_TRACKING]: `setBlockTracking`,
- [PUSH_SCOPE_ID]: `pushScopeId`,
- [POP_SCOPE_ID]: `popScopeId`,
- [WITH_SCOPE_ID]: `withScopeId`,
- [WITH_CTX]: `withCtx`,
- [UNREF]: `unref`,
- [IS_REF]: `isRef`,
- [WITH_MEMO]: `withMemo`,
- [IS_MEMO_SAME]: `isMemoSame`
- };
- function registerRuntimeHelpers(helpers) {
- Object.getOwnPropertySymbols(helpers).forEach(s => {
- helperNameMap[s] = helpers[s];
- });
- }
- // AST Utilities ---------------------------------------------------------------
- // Some expressions, e.g. sequence and conditional expressions, are never
- // associated with template nodes, so their source locations are just a stub.
- // Container types like CompoundExpression also don't need a real location.
- const locStub = {
- source: '',
- start: { line: 1, column: 1, offset: 0 },
- end: { line: 1, column: 1, offset: 0 }
- };
- function createRoot(children, loc = locStub) {
- return {
- type: 0 /* ROOT */,
- children,
- helpers: [],
- components: [],
- directives: [],
- hoists: [],
- imports: [],
- cached: 0,
- temps: 0,
- codegenNode: undefined,
- loc
- };
- }
- function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {
- if (context) {
- if (isBlock) {
- context.helper(OPEN_BLOCK);
- context.helper(getVNodeBlockHelper(context.inSSR, isComponent));
- }
- else {
- context.helper(getVNodeHelper(context.inSSR, isComponent));
- }
- if (directives) {
- context.helper(WITH_DIRECTIVES);
- }
- }
- return {
- type: 13 /* VNODE_CALL */,
- tag,
- props,
- children,
- patchFlag,
- dynamicProps,
- directives,
- isBlock,
- disableTracking,
- isComponent,
- loc
- };
- }
- function createArrayExpression(elements, loc = locStub) {
- return {
- type: 17 /* JS_ARRAY_EXPRESSION */,
- loc,
- elements
- };
- }
- function createObjectExpression(properties, loc = locStub) {
- return {
- type: 15 /* JS_OBJECT_EXPRESSION */,
- loc,
- properties
- };
- }
- function createObjectProperty(key, value) {
- return {
- type: 16 /* JS_PROPERTY */,
- loc: locStub,
- key: isString(key) ? createSimpleExpression(key, true) : key,
- value
- };
- }
- function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0 /* NOT_CONSTANT */) {
- return {
- type: 4 /* SIMPLE_EXPRESSION */,
- loc,
- content,
- isStatic,
- constType: isStatic ? 3 /* CAN_STRINGIFY */ : constType
- };
- }
- function createInterpolation(content, loc) {
- return {
- type: 5 /* INTERPOLATION */,
- loc,
- content: isString(content)
- ? createSimpleExpression(content, false, loc)
- : content
- };
- }
- function createCompoundExpression(children, loc = locStub) {
- return {
- type: 8 /* COMPOUND_EXPRESSION */,
- loc,
- children
- };
- }
- function createCallExpression(callee, args = [], loc = locStub) {
- return {
- type: 14 /* JS_CALL_EXPRESSION */,
- loc,
- callee,
- arguments: args
- };
- }
- function createFunctionExpression(params, returns = undefined, newline = false, isSlot = false, loc = locStub) {
- return {
- type: 18 /* JS_FUNCTION_EXPRESSION */,
- params,
- returns,
- newline,
- isSlot,
- loc
- };
- }
- function createConditionalExpression(test, consequent, alternate, newline = true) {
- return {
- type: 19 /* JS_CONDITIONAL_EXPRESSION */,
- test,
- consequent,
- alternate,
- newline,
- loc: locStub
- };
- }
- function createCacheExpression(index, value, isVNode = false) {
- return {
- type: 20 /* JS_CACHE_EXPRESSION */,
- index,
- value,
- isVNode,
- loc: locStub
- };
- }
- function createBlockStatement(body) {
- return {
- type: 21 /* JS_BLOCK_STATEMENT */,
- body,
- loc: locStub
- };
- }
- function createTemplateLiteral(elements) {
- return {
- type: 22 /* JS_TEMPLATE_LITERAL */,
- elements,
- loc: locStub
- };
- }
- function createIfStatement(test, consequent, alternate) {
- return {
- type: 23 /* JS_IF_STATEMENT */,
- test,
- consequent,
- alternate,
- loc: locStub
- };
- }
- function createAssignmentExpression(left, right) {
- return {
- type: 24 /* JS_ASSIGNMENT_EXPRESSION */,
- left,
- right,
- loc: locStub
- };
- }
- function createSequenceExpression(expressions) {
- return {
- type: 25 /* JS_SEQUENCE_EXPRESSION */,
- expressions,
- loc: locStub
- };
- }
- function createReturnStatement(returns) {
- return {
- type: 26 /* JS_RETURN_STATEMENT */,
- returns,
- loc: locStub
- };
- }
- const isStaticExp = (p) => p.type === 4 /* SIMPLE_EXPRESSION */ && p.isStatic;
- const isBuiltInType = (tag, expected) => tag === expected || tag === hyphenate(expected);
- function isCoreComponent(tag) {
- if (isBuiltInType(tag, 'Teleport')) {
- return TELEPORT;
- }
- else if (isBuiltInType(tag, 'Suspense')) {
- return SUSPENSE;
- }
- else if (isBuiltInType(tag, 'KeepAlive')) {
- return KEEP_ALIVE;
- }
- else if (isBuiltInType(tag, 'BaseTransition')) {
- return BASE_TRANSITION;
- }
- }
- const nonIdentifierRE = /^\d|[^\$\w]/;
- const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
- const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
- const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
- const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
- /**
- * Simple lexer to check if an expression is a member expression. This is
- * lax and only checks validity at the root level (i.e. does not validate exps
- * inside square brackets), but it's ok since these are only used on template
- * expressions and false positives are invalid expressions in the first place.
- */
- const isMemberExpression = (path) => {
- // remove whitespaces around . or [ first
- path = path.trim().replace(whitespaceRE, s => s.trim());
- let state = 0 /* inMemberExp */;
- let stateStack = [];
- let currentOpenBracketCount = 0;
- let currentOpenParensCount = 0;
- let currentStringType = null;
- for (let i = 0; i < path.length; i++) {
- const char = path.charAt(i);
- switch (state) {
- case 0 /* inMemberExp */:
- if (char === '[') {
- stateStack.push(state);
- state = 1 /* inBrackets */;
- currentOpenBracketCount++;
- }
- else if (char === '(') {
- stateStack.push(state);
- state = 2 /* inParens */;
- currentOpenParensCount++;
- }
- else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {
- return false;
- }
- break;
- case 1 /* inBrackets */:
- if (char === `'` || char === `"` || char === '`') {
- stateStack.push(state);
- state = 3 /* inString */;
- currentStringType = char;
- }
- else if (char === `[`) {
- currentOpenBracketCount++;
- }
- else if (char === `]`) {
- if (!--currentOpenBracketCount) {
- state = stateStack.pop();
- }
- }
- break;
- case 2 /* inParens */:
- if (char === `'` || char === `"` || char === '`') {
- stateStack.push(state);
- state = 3 /* inString */;
- currentStringType = char;
- }
- else if (char === `(`) {
- currentOpenParensCount++;
- }
- else if (char === `)`) {
- // if the exp ends as a call then it should not be considered valid
- if (i === path.length - 1) {
- return false;
- }
- if (!--currentOpenParensCount) {
- state = stateStack.pop();
- }
- }
- break;
- case 3 /* inString */:
- if (char === currentStringType) {
- state = stateStack.pop();
- currentStringType = null;
- }
- break;
- }
- }
- return !currentOpenBracketCount && !currentOpenParensCount;
- };
- function getInnerRange(loc, offset, length) {
- const source = loc.source.substr(offset, length);
- const newLoc = {
- source,
- start: advancePositionWithClone(loc.start, loc.source, offset),
- end: loc.end
- };
- if (length != null) {
- newLoc.end = advancePositionWithClone(loc.start, loc.source, offset + length);
- }
- return newLoc;
- }
- function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
- return advancePositionWithMutation(extend({}, pos), source, numberOfCharacters);
- }
- // advance by mutation without cloning (for performance reasons), since this
- // gets called a lot in the parser
- function advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {
- let linesCount = 0;
- let lastNewLinePos = -1;
- for (let i = 0; i < numberOfCharacters; i++) {
- if (source.charCodeAt(i) === 10 /* newline char code */) {
- linesCount++;
- lastNewLinePos = i;
- }
- }
- pos.offset += numberOfCharacters;
- pos.line += linesCount;
- pos.column =
- lastNewLinePos === -1
- ? pos.column + numberOfCharacters
- : numberOfCharacters - lastNewLinePos;
- return pos;
- }
- function assert(condition, msg) {
- /* istanbul ignore if */
- if (!condition) {
- throw new Error(msg || `unexpected compiler condition`);
- }
- }
- function findDir(node, name, allowEmpty = false) {
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 7 /* DIRECTIVE */ &&
- (allowEmpty || p.exp) &&
- (isString(name) ? p.name === name : name.test(p.name))) {
- return p;
- }
- }
- }
- function findProp(node, name, dynamicOnly = false, allowEmpty = false) {
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 6 /* ATTRIBUTE */) {
- if (dynamicOnly)
- continue;
- if (p.name === name && (p.value || allowEmpty)) {
- return p;
- }
- }
- else if (p.name === 'bind' &&
- (p.exp || allowEmpty) &&
- isBindKey(p.arg, name)) {
- return p;
- }
- }
- }
- function isBindKey(arg, name) {
- return !!(arg && isStaticExp(arg) && arg.content === name);
- }
- function hasDynamicKeyVBind(node) {
- return node.props.some(p => p.type === 7 /* DIRECTIVE */ &&
- p.name === 'bind' &&
- (!p.arg || // v-bind="obj"
- p.arg.type !== 4 /* SIMPLE_EXPRESSION */ || // v-bind:[_ctx.foo]
- !p.arg.isStatic) // v-bind:[foo]
- );
- }
- function isText(node) {
- return node.type === 5 /* INTERPOLATION */ || node.type === 2 /* TEXT */;
- }
- function isVSlot(p) {
- return p.type === 7 /* DIRECTIVE */ && p.name === 'slot';
- }
- function isTemplateNode(node) {
- return (node.type === 1 /* ELEMENT */ && node.tagType === 3 /* TEMPLATE */);
- }
- function isSlotOutlet(node) {
- return node.type === 1 /* ELEMENT */ && node.tagType === 2 /* SLOT */;
- }
- function getVNodeHelper(ssr, isComponent) {
- return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
- }
- function getVNodeBlockHelper(ssr, isComponent) {
- return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
- }
- const propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);
- function getUnnormalizedProps(props, callPath = []) {
- if (props &&
- !isString(props) &&
- props.type === 14 /* JS_CALL_EXPRESSION */) {
- const callee = props.callee;
- if (!isString(callee) && propsHelperSet.has(callee)) {
- return getUnnormalizedProps(props.arguments[0], callPath.concat(props));
- }
- }
- return [props, callPath];
- }
- function injectProp(node, prop, context) {
- let propsWithInjection;
- const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];
- /**
- * 1. mergeProps(...)
- * 2. toHandlers(...)
- * 3. normalizeProps(...)
- * 4. normalizeProps(guardReactiveProps(...))
- *
- * we need to get the real props before normalization
- */
- let props = originalProps;
- let callPath = [];
- let parentCall;
- if (props &&
- !isString(props) &&
- props.type === 14 /* JS_CALL_EXPRESSION */) {
- const ret = getUnnormalizedProps(props);
- props = ret[0];
- callPath = ret[1];
- parentCall = callPath[callPath.length - 1];
- }
- if (props == null || isString(props)) {
- propsWithInjection = createObjectExpression([prop]);
- }
- else if (props.type === 14 /* JS_CALL_EXPRESSION */) {
- // merged props... add ours
- // only inject key to object literal if it's the first argument so that
- // if doesn't override user provided keys
- const first = props.arguments[0];
- if (!isString(first) && first.type === 15 /* JS_OBJECT_EXPRESSION */) {
- first.properties.unshift(prop);
- }
- else {
- if (props.callee === TO_HANDLERS) {
- // #2366
- propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
- createObjectExpression([prop]),
- props
- ]);
- }
- else {
- props.arguments.unshift(createObjectExpression([prop]));
- }
- }
- !propsWithInjection && (propsWithInjection = props);
- }
- else if (props.type === 15 /* JS_OBJECT_EXPRESSION */) {
- let alreadyExists = false;
- // check existing key to avoid overriding user provided keys
- if (prop.key.type === 4 /* SIMPLE_EXPRESSION */) {
- const propKeyName = prop.key.content;
- alreadyExists = props.properties.some(p => p.key.type === 4 /* SIMPLE_EXPRESSION */ &&
- p.key.content === propKeyName);
- }
- if (!alreadyExists) {
- props.properties.unshift(prop);
- }
- propsWithInjection = props;
- }
- else {
- // single v-bind with expression, return a merged replacement
- propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [
- createObjectExpression([prop]),
- props
- ]);
- // in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(props))`,
- // it will be rewritten as `normalizeProps(mergeProps({ key: 0 }, props))`,
- // the `guardReactiveProps` will no longer be needed
- if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {
- parentCall = callPath[callPath.length - 2];
- }
- }
- if (node.type === 13 /* VNODE_CALL */) {
- if (parentCall) {
- parentCall.arguments[0] = propsWithInjection;
- }
- else {
- node.props = propsWithInjection;
- }
- }
- else {
- if (parentCall) {
- parentCall.arguments[0] = propsWithInjection;
- }
- else {
- node.arguments[2] = propsWithInjection;
- }
- }
- }
- function toValidAssetId(name, type) {
- // see issue#4422, we need adding identifier on validAssetId if variable `name` has specific character
- return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
- return searchValue === '-' ? '_' : name.charCodeAt(replaceValue).toString();
- })}`;
- }
- // Check if a node contains expressions that reference current context scope ids
- function hasScopeRef(node, ids) {
- if (!node || Object.keys(ids).length === 0) {
- return false;
- }
- switch (node.type) {
- case 1 /* ELEMENT */:
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 7 /* DIRECTIVE */ &&
- (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {
- return true;
- }
- }
- return node.children.some(c => hasScopeRef(c, ids));
- case 11 /* FOR */:
- if (hasScopeRef(node.source, ids)) {
- return true;
- }
- return node.children.some(c => hasScopeRef(c, ids));
- case 9 /* IF */:
- return node.branches.some(b => hasScopeRef(b, ids));
- case 10 /* IF_BRANCH */:
- if (hasScopeRef(node.condition, ids)) {
- return true;
- }
- return node.children.some(c => hasScopeRef(c, ids));
- case 4 /* SIMPLE_EXPRESSION */:
- return (!node.isStatic &&
- isSimpleIdentifier(node.content) &&
- !!ids[node.content]);
- case 8 /* COMPOUND_EXPRESSION */:
- return node.children.some(c => isObject(c) && hasScopeRef(c, ids));
- case 5 /* INTERPOLATION */:
- case 12 /* TEXT_CALL */:
- return hasScopeRef(node.content, ids);
- case 2 /* TEXT */:
- case 3 /* COMMENT */:
- return false;
- default:
- if ((process.env.NODE_ENV !== 'production')) ;
- return false;
- }
- }
- function getMemoedVNodeCall(node) {
- if (node.type === 14 /* JS_CALL_EXPRESSION */ && node.callee === WITH_MEMO) {
- return node.arguments[1].returns;
- }
- else {
- return node;
- }
- }
- function makeBlock(node, { helper, removeHelper, inSSR }) {
- if (!node.isBlock) {
- node.isBlock = true;
- removeHelper(getVNodeHelper(inSSR, node.isComponent));
- helper(OPEN_BLOCK);
- helper(getVNodeBlockHelper(inSSR, node.isComponent));
- }
- }
- const deprecationData = {
- ["COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */]: {
- message: `Platform-native elements with "is" prop will no longer be ` +
- `treated as components in Vue 3 unless the "is" value is explicitly ` +
- `prefixed with "vue:".`,
- link: `https://v3.vuejs.org/guide/migration/custom-elements-interop.html`
- },
- ["COMPILER_V_BIND_SYNC" /* COMPILER_V_BIND_SYNC */]: {
- message: key => `.sync modifier for v-bind has been removed. Use v-model with ` +
- `argument instead. \`v-bind:${key}.sync\` should be changed to ` +
- `\`v-model:${key}\`.`,
- link: `https://v3.vuejs.org/guide/migration/v-model.html`
- },
- ["COMPILER_V_BIND_PROP" /* COMPILER_V_BIND_PROP */]: {
- message: `.prop modifier for v-bind has been removed and no longer necessary. ` +
- `Vue 3 will automatically set a binding as DOM property when appropriate.`
- },
- ["COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */]: {
- message: `v-bind="obj" usage is now order sensitive and behaves like JavaScript ` +
- `object spread: it will now overwrite an existing non-mergeable attribute ` +
- `that appears before v-bind in the case of conflict. ` +
- `To retain 2.x behavior, move v-bind to make it the first attribute. ` +
- `You can also suppress this warning if the usage is intended.`,
- link: `https://v3.vuejs.org/guide/migration/v-bind.html`
- },
- ["COMPILER_V_ON_NATIVE" /* COMPILER_V_ON_NATIVE */]: {
- message: `.native modifier for v-on has been removed as is no longer necessary.`,
- link: `https://v3.vuejs.org/guide/migration/v-on-native-modifier-removed.html`
- },
- ["COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */]: {
- message: `v-if / v-for precedence when used on the same element has changed ` +
- `in Vue 3: v-if now takes higher precedence and will no longer have ` +
- `access to v-for scope variables. It is best to avoid the ambiguity ` +
- `with <template> tags or use a computed property that filters v-for ` +
- `data source.`,
- link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`
- },
- ["COMPILER_V_FOR_REF" /* COMPILER_V_FOR_REF */]: {
- message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +
- `Consider using function refs or refactor to avoid ref usage altogether.`,
- link: `https://v3.vuejs.org/guide/migration/array-refs.html`
- },
- ["COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */]: {
- message: `<template> with no special directives will render as a native template ` +
- `element instead of its inner content in Vue 3.`
- },
- ["COMPILER_INLINE_TEMPLATE" /* COMPILER_INLINE_TEMPLATE */]: {
- message: `"inline-template" has been removed in Vue 3.`,
- link: `https://v3.vuejs.org/guide/migration/inline-template-attribute.html`
- },
- ["COMPILER_FILTER" /* COMPILER_FILTERS */]: {
- message: `filters have been removed in Vue 3. ` +
- `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
- `Use method calls or computed properties instead.`,
- link: `https://v3.vuejs.org/guide/migration/filters.html`
- }
- };
- function getCompatValue(key, context) {
- const config = context.options
- ? context.options.compatConfig
- : context.compatConfig;
- const value = config && config[key];
- if (key === 'MODE') {
- return value || 3; // compiler defaults to v3 behavior
- }
- else {
- return value;
- }
- }
- function isCompatEnabled(key, context) {
- const mode = getCompatValue('MODE', context);
- const value = getCompatValue(key, context);
- // in v3 mode, only enable if explicitly set to true
- // otherwise enable for any non-false value
- return mode === 3 ? value === true : value !== false;
- }
- function checkCompatEnabled(key, context, loc, ...args) {
- const enabled = isCompatEnabled(key, context);
- if ((process.env.NODE_ENV !== 'production') && enabled) {
- warnDeprecation(key, context, loc, ...args);
- }
- return enabled;
- }
- function warnDeprecation(key, context, loc, ...args) {
- const val = getCompatValue(key, context);
- if (val === 'suppress-warning') {
- return;
- }
- const { message, link } = deprecationData[key];
- const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\n Details: ${link}` : ``}`;
- const err = new SyntaxError(msg);
- err.code = key;
- if (loc)
- err.loc = loc;
- context.onWarn(err);
- }
- // The default decoder only provides escapes for characters reserved as part of
- // the template syntax, and is only used if the custom renderer did not provide
- // a platform-specific decoder.
- const decodeRE = /&(gt|lt|amp|apos|quot);/g;
- const decodeMap = {
- gt: '>',
- lt: '<',
- amp: '&',
- apos: "'",
- quot: '"'
- };
- const defaultParserOptions = {
- delimiters: [`{{`, `}}`],
- getNamespace: () => 0 /* HTML */,
- getTextMode: () => 0 /* DATA */,
- isVoidTag: NO,
- isPreTag: NO,
- isCustomElement: NO,
- decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),
- onError: defaultOnError,
- onWarn: defaultOnWarn,
- comments: (process.env.NODE_ENV !== 'production')
- };
- function baseParse(content, options = {}) {
- const context = createParserContext(content, options);
- const start = getCursor(context);
- return createRoot(parseChildren(context, 0 /* DATA */, []), getSelection(context, start));
- }
- function createParserContext(content, rawOptions) {
- const options = extend({}, defaultParserOptions);
- let key;
- for (key in rawOptions) {
- // @ts-ignore
- options[key] =
- rawOptions[key] === undefined
- ? defaultParserOptions[key]
- : rawOptions[key];
- }
- return {
- options,
- column: 1,
- line: 1,
- offset: 0,
- originalSource: content,
- source: content,
- inPre: false,
- inVPre: false,
- onWarn: options.onWarn
- };
- }
- function parseChildren(context, mode, ancestors) {
- const parent = last(ancestors);
- const ns = parent ? parent.ns : 0 /* HTML */;
- const nodes = [];
- while (!isEnd(context, mode, ancestors)) {
- const s = context.source;
- let node = undefined;
- if (mode === 0 /* DATA */ || mode === 1 /* RCDATA */) {
- if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {
- // '{{'
- node = parseInterpolation(context, mode);
- }
- else if (mode === 0 /* DATA */ && s[0] === '<') {
- // https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state
- if (s.length === 1) {
- emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 1);
- }
- else if (s[1] === '!') {
- // https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
- if (startsWith(s, '<!--')) {
- node = parseComment(context);
- }
- else if (startsWith(s, '<!DOCTYPE')) {
- // Ignore DOCTYPE by a limitation.
- node = parseBogusComment(context);
- }
- else if (startsWith(s, '<![CDATA[')) {
- if (ns !== 0 /* HTML */) {
- node = parseCDATA(context, ancestors);
- }
- else {
- emitError(context, 1 /* CDATA_IN_HTML_CONTENT */);
- node = parseBogusComment(context);
- }
- }
- else {
- emitError(context, 11 /* INCORRECTLY_OPENED_COMMENT */);
- node = parseBogusComment(context);
- }
- }
- else if (s[1] === '/') {
- // https://html.spec.whatwg.org/multipage/parsing.html#end-tag-open-state
- if (s.length === 2) {
- emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 2);
- }
- else if (s[2] === '>') {
- emitError(context, 14 /* MISSING_END_TAG_NAME */, 2);
- advanceBy(context, 3);
- continue;
- }
- else if (/[a-z]/i.test(s[2])) {
- emitError(context, 23 /* X_INVALID_END_TAG */);
- parseTag(context, 1 /* End */, parent);
- continue;
- }
- else {
- emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 2);
- node = parseBogusComment(context);
- }
- }
- else if (/[a-z]/i.test(s[1])) {
- node = parseElement(context, ancestors);
- // 2.x <template> with no directive compat
- if (isCompatEnabled("COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */, context) &&
- node &&
- node.tag === 'template' &&
- !node.props.some(p => p.type === 7 /* DIRECTIVE */ &&
- isSpecialTemplateDirective(p.name))) {
- (process.env.NODE_ENV !== 'production') &&
- warnDeprecation("COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */, context, node.loc);
- node = node.children;
- }
- }
- else if (s[1] === '?') {
- emitError(context, 21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */, 1);
- node = parseBogusComment(context);
- }
- else {
- emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 1);
- }
- }
- }
- if (!node) {
- node = parseText(context, mode);
- }
- if (isArray(node)) {
- for (let i = 0; i < node.length; i++) {
- pushNode(nodes, node[i]);
- }
- }
- else {
- pushNode(nodes, node);
- }
- }
- // Whitespace handling strategy like v2
- let removedWhitespace = false;
- if (mode !== 2 /* RAWTEXT */ && mode !== 1 /* RCDATA */) {
- const shouldCondense = context.options.whitespace !== 'preserve';
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if (!context.inPre && node.type === 2 /* TEXT */) {
- if (!/[^\t\r\n\f ]/.test(node.content)) {
- const prev = nodes[i - 1];
- const next = nodes[i + 1];
- // Remove if:
- // - the whitespace is the first or last node, or:
- // - (condense mode) the whitespace is adjacent to a comment, or:
- // - (condense mode) the whitespace is between two elements AND contains newline
- if (!prev ||
- !next ||
- (shouldCondense &&
- (prev.type === 3 /* COMMENT */ ||
- next.type === 3 /* COMMENT */ ||
- (prev.type === 1 /* ELEMENT */ &&
- next.type === 1 /* ELEMENT */ &&
- /[\r\n]/.test(node.content))))) {
- removedWhitespace = true;
- nodes[i] = null;
- }
- else {
- // Otherwise, the whitespace is condensed into a single space
- node.content = ' ';
- }
- }
- else if (shouldCondense) {
- // in condense mode, consecutive whitespaces in text are condensed
- // down to a single space.
- node.content = node.content.replace(/[\t\r\n\f ]+/g, ' ');
- }
- }
- // Remove comment nodes if desired by configuration.
- else if (node.type === 3 /* COMMENT */ && !context.options.comments) {
- removedWhitespace = true;
- nodes[i] = null;
- }
- }
- if (context.inPre && parent && context.options.isPreTag(parent.tag)) {
- // remove leading newline per html spec
- // https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element
- const first = nodes[0];
- if (first && first.type === 2 /* TEXT */) {
- first.content = first.content.replace(/^\r?\n/, '');
- }
- }
- }
- return removedWhitespace ? nodes.filter(Boolean) : nodes;
- }
- function pushNode(nodes, node) {
- if (node.type === 2 /* TEXT */) {
- const prev = last(nodes);
- // Merge if both this and the previous node are text and those are
- // consecutive. This happens for cases like "a < b".
- if (prev &&
- prev.type === 2 /* TEXT */ &&
- prev.loc.end.offset === node.loc.start.offset) {
- prev.content += node.content;
- prev.loc.end = node.loc.end;
- prev.loc.source += node.loc.source;
- return;
- }
- }
- nodes.push(node);
- }
- function parseCDATA(context, ancestors) {
- advanceBy(context, 9);
- const nodes = parseChildren(context, 3 /* CDATA */, ancestors);
- if (context.source.length === 0) {
- emitError(context, 6 /* EOF_IN_CDATA */);
- }
- else {
- advanceBy(context, 3);
- }
- return nodes;
- }
- function parseComment(context) {
- const start = getCursor(context);
- let content;
- // Regular comment.
- const match = /--(\!)?>/.exec(context.source);
- if (!match) {
- content = context.source.slice(4);
- advanceBy(context, context.source.length);
- emitError(context, 7 /* EOF_IN_COMMENT */);
- }
- else {
- if (match.index <= 3) {
- emitError(context, 0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */);
- }
- if (match[1]) {
- emitError(context, 10 /* INCORRECTLY_CLOSED_COMMENT */);
- }
- content = context.source.slice(4, match.index);
- // Advancing with reporting nested comments.
- const s = context.source.slice(0, match.index);
- let prevIndex = 1, nestedIndex = 0;
- while ((nestedIndex = s.indexOf('<!--', prevIndex)) !== -1) {
- advanceBy(context, nestedIndex - prevIndex + 1);
- if (nestedIndex + 4 < s.length) {
- emitError(context, 16 /* NESTED_COMMENT */);
- }
- prevIndex = nestedIndex + 1;
- }
- advanceBy(context, match.index + match[0].length - prevIndex + 1);
- }
- return {
- type: 3 /* COMMENT */,
- content,
- loc: getSelection(context, start)
- };
- }
- function parseBogusComment(context) {
- const start = getCursor(context);
- const contentStart = context.source[1] === '?' ? 1 : 2;
- let content;
- const closeIndex = context.source.indexOf('>');
- if (closeIndex === -1) {
- content = context.source.slice(contentStart);
- advanceBy(context, context.source.length);
- }
- else {
- content = context.source.slice(contentStart, closeIndex);
- advanceBy(context, closeIndex + 1);
- }
- return {
- type: 3 /* COMMENT */,
- content,
- loc: getSelection(context, start)
- };
- }
- function parseElement(context, ancestors) {
- // Start tag.
- const wasInPre = context.inPre;
- const wasInVPre = context.inVPre;
- const parent = last(ancestors);
- const element = parseTag(context, 0 /* Start */, parent);
- const isPreBoundary = context.inPre && !wasInPre;
- const isVPreBoundary = context.inVPre && !wasInVPre;
- if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
- // #4030 self-closing <pre> tag
- if (isPreBoundary) {
- context.inPre = false;
- }
- if (isVPreBoundary) {
- context.inVPre = false;
- }
- return element;
- }
- // Children.
- ancestors.push(element);
- const mode = context.options.getTextMode(element, parent);
- const children = parseChildren(context, mode, ancestors);
- ancestors.pop();
- // 2.x inline-template compat
- {
- const inlineTemplateProp = element.props.find(p => p.type === 6 /* ATTRIBUTE */ && p.name === 'inline-template');
- if (inlineTemplateProp &&
- checkCompatEnabled("COMPILER_INLINE_TEMPLATE" /* COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {
- const loc = getSelection(context, element.loc.end);
- inlineTemplateProp.value = {
- type: 2 /* TEXT */,
- content: loc.source,
- loc
- };
- }
- }
- element.children = children;
- // End tag.
- if (startsWithEndTagOpen(context.source, element.tag)) {
- parseTag(context, 1 /* End */, parent);
- }
- else {
- emitError(context, 24 /* X_MISSING_END_TAG */, 0, element.loc.start);
- if (context.source.length === 0 && element.tag.toLowerCase() === 'script') {
- const first = children[0];
- if (first && startsWith(first.loc.source, '<!--')) {
- emitError(context, 8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */);
- }
- }
- }
- element.loc = getSelection(context, element.loc.start);
- if (isPreBoundary) {
- context.inPre = false;
- }
- if (isVPreBoundary) {
- context.inVPre = false;
- }
- return element;
- }
- const isSpecialTemplateDirective = /*#__PURE__*/ makeMap(`if,else,else-if,for,slot`);
- function parseTag(context, type, parent) {
- // Tag open.
- const start = getCursor(context);
- const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
- const tag = match[1];
- const ns = context.options.getNamespace(tag, parent);
- advanceBy(context, match[0].length);
- advanceSpaces(context);
- // save current state in case we need to re-parse attributes with v-pre
- const cursor = getCursor(context);
- const currentSource = context.source;
- // check <pre> tag
- if (context.options.isPreTag(tag)) {
- context.inPre = true;
- }
- // Attributes.
- let props = parseAttributes(context, type);
- // check v-pre
- if (type === 0 /* Start */ &&
- !context.inVPre &&
- props.some(p => p.type === 7 /* DIRECTIVE */ && p.name === 'pre')) {
- context.inVPre = true;
- // reset context
- extend(context, cursor);
- context.source = currentSource;
- // re-parse attrs and filter out v-pre itself
- props = parseAttributes(context, type).filter(p => p.name !== 'v-pre');
- }
- // Tag close.
- let isSelfClosing = false;
- if (context.source.length === 0) {
- emitError(context, 9 /* EOF_IN_TAG */);
- }
- else {
- isSelfClosing = startsWith(context.source, '/>');
- if (type === 1 /* End */ && isSelfClosing) {
- emitError(context, 4 /* END_TAG_WITH_TRAILING_SOLIDUS */);
- }
- advanceBy(context, isSelfClosing ? 2 : 1);
- }
- if (type === 1 /* End */) {
- return;
- }
- // 2.x deprecation checks
- if ((process.env.NODE_ENV !== 'production') &&
- isCompatEnabled("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context)) {
- let hasIf = false;
- let hasFor = false;
- for (let i = 0; i < props.length; i++) {
- const p = props[i];
- if (p.type === 7 /* DIRECTIVE */) {
- if (p.name === 'if') {
- hasIf = true;
- }
- else if (p.name === 'for') {
- hasFor = true;
- }
- }
- if (hasIf && hasFor) {
- warnDeprecation("COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */, context, getSelection(context, start));
- }
- }
- }
- let tagType = 0 /* ELEMENT */;
- if (!context.inVPre) {
- if (tag === 'slot') {
- tagType = 2 /* SLOT */;
- }
- else if (tag === 'template') {
- if (props.some(p => p.type === 7 /* DIRECTIVE */ && isSpecialTemplateDirective(p.name))) {
- tagType = 3 /* TEMPLATE */;
- }
- }
- else if (isComponent(tag, props, context)) {
- tagType = 1 /* COMPONENT */;
- }
- }
- return {
- type: 1 /* ELEMENT */,
- ns,
- tag,
- tagType,
- props,
- isSelfClosing,
- children: [],
- loc: getSelection(context, start),
- codegenNode: undefined // to be created during transform phase
- };
- }
- function isComponent(tag, props, context) {
- const options = context.options;
- if (options.isCustomElement(tag)) {
- return false;
- }
- if (tag === 'component' ||
- /^[A-Z]/.test(tag) ||
- isCoreComponent(tag) ||
- (options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||
- (options.isNativeTag && !options.isNativeTag(tag))) {
- return true;
- }
- // at this point the tag should be a native tag, but check for potential "is"
- // casting
- for (let i = 0; i < props.length; i++) {
- const p = props[i];
- if (p.type === 6 /* ATTRIBUTE */) {
- if (p.name === 'is' && p.value) {
- if (p.value.content.startsWith('vue:')) {
- return true;
- }
- else if (checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
- return true;
- }
- }
- }
- else {
- // directive
- // v-is (TODO Deprecate)
- if (p.name === 'is') {
- return true;
- }
- else if (
- // :is on plain element - only treat as component in compat mode
- p.name === 'bind' &&
- isBindKey(p.arg, 'is') &&
- true &&
- checkCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {
- return true;
- }
- }
- }
- }
- function parseAttributes(context, type) {
- const props = [];
- const attributeNames = new Set();
- while (context.source.length > 0 &&
- !startsWith(context.source, '>') &&
- !startsWith(context.source, '/>')) {
- if (startsWith(context.source, '/')) {
- emitError(context, 22 /* UNEXPECTED_SOLIDUS_IN_TAG */);
- advanceBy(context, 1);
- advanceSpaces(context);
- continue;
- }
- if (type === 1 /* End */) {
- emitError(context, 3 /* END_TAG_WITH_ATTRIBUTES */);
- }
- const attr = parseAttribute(context, attributeNames);
- if (type === 0 /* Start */) {
- props.push(attr);
- }
- if (/^[^\t\r\n\f />]/.test(context.source)) {
- emitError(context, 15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */);
- }
- advanceSpaces(context);
- }
- return props;
- }
- function parseAttribute(context, nameSet) {
- // Name.
- const start = getCursor(context);
- const match = /^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(context.source);
- const name = match[0];
- if (nameSet.has(name)) {
- emitError(context, 2 /* DUPLICATE_ATTRIBUTE */);
- }
- nameSet.add(name);
- if (name[0] === '=') {
- emitError(context, 19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */);
- }
- {
- const pattern = /["'<]/g;
- let m;
- while ((m = pattern.exec(name))) {
- emitError(context, 17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */, m.index);
- }
- }
- advanceBy(context, name.length);
- // Value
- let value = undefined;
- if (/^[\t\r\n\f ]*=/.test(context.source)) {
- advanceSpaces(context);
- advanceBy(context, 1);
- advanceSpaces(context);
- value = parseAttributeValue(context);
- if (!value) {
- emitError(context, 13 /* MISSING_ATTRIBUTE_VALUE */);
- }
- }
- const loc = getSelection(context, start);
- if (!context.inVPre && /^(v-|:|\.|@|#)/.test(name)) {
- const match = /(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(name);
- let isPropShorthand = startsWith(name, '.');
- let dirName = match[1] ||
- (isPropShorthand || startsWith(name, ':')
- ? 'bind'
- : startsWith(name, '@')
- ? 'on'
- : 'slot');
- let arg;
- if (match[2]) {
- const isSlot = dirName === 'slot';
- const startOffset = name.lastIndexOf(match[2]);
- const loc = getSelection(context, getNewPosition(context, start, startOffset), getNewPosition(context, start, startOffset + match[2].length + ((isSlot && match[3]) || '').length));
- let content = match[2];
- let isStatic = true;
- if (content.startsWith('[')) {
- isStatic = false;
- if (!content.endsWith(']')) {
- emitError(context, 26 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);
- }
- content = content.substr(1, content.length - 2);
- }
- else if (isSlot) {
- // #1241 special case for v-slot: vuetify relies extensively on slot
- // names containing dots. v-slot doesn't have any modifiers and Vue 2.x
- // supports such usage so we are keeping it consistent with 2.x.
- content += match[3] || '';
- }
- arg = {
- type: 4 /* SIMPLE_EXPRESSION */,
- content,
- isStatic,
- constType: isStatic
- ? 3 /* CAN_STRINGIFY */
- : 0 /* NOT_CONSTANT */,
- loc
- };
- }
- if (value && value.isQuoted) {
- const valueLoc = value.loc;
- valueLoc.start.offset++;
- valueLoc.start.column++;
- valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);
- valueLoc.source = valueLoc.source.slice(1, -1);
- }
- const modifiers = match[3] ? match[3].substr(1).split('.') : [];
- if (isPropShorthand)
- modifiers.push('prop');
- // 2.x compat v-bind:foo.sync -> v-model:foo
- if (dirName === 'bind' && arg) {
- if (modifiers.includes('sync') &&
- checkCompatEnabled("COMPILER_V_BIND_SYNC" /* COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {
- dirName = 'model';
- modifiers.splice(modifiers.indexOf('sync'), 1);
- }
- if ((process.env.NODE_ENV !== 'production') && modifiers.includes('prop')) {
- checkCompatEnabled("COMPILER_V_BIND_PROP" /* COMPILER_V_BIND_PROP */, context, loc);
- }
- }
- return {
- type: 7 /* DIRECTIVE */,
- name: dirName,
- exp: value && {
- type: 4 /* SIMPLE_EXPRESSION */,
- content: value.content,
- isStatic: false,
- // Treat as non-constant by default. This can be potentially set to
- // other values by `transformExpression` to make it eligible for hoisting.
- constType: 0 /* NOT_CONSTANT */,
- loc: value.loc
- },
- arg,
- modifiers,
- loc
- };
- }
- return {
- type: 6 /* ATTRIBUTE */,
- name,
- value: value && {
- type: 2 /* TEXT */,
- content: value.content,
- loc: value.loc
- },
- loc
- };
- }
- function parseAttributeValue(context) {
- const start = getCursor(context);
- let content;
- const quote = context.source[0];
- const isQuoted = quote === `"` || quote === `'`;
- if (isQuoted) {
- // Quoted value.
- advanceBy(context, 1);
- const endIndex = context.source.indexOf(quote);
- if (endIndex === -1) {
- content = parseTextData(context, context.source.length, 4 /* ATTRIBUTE_VALUE */);
- }
- else {
- content = parseTextData(context, endIndex, 4 /* ATTRIBUTE_VALUE */);
- advanceBy(context, 1);
- }
- }
- else {
- // Unquoted
- const match = /^[^\t\r\n\f >]+/.exec(context.source);
- if (!match) {
- return undefined;
- }
- const unexpectedChars = /["'<=`]/g;
- let m;
- while ((m = unexpectedChars.exec(match[0]))) {
- emitError(context, 18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */, m.index);
- }
- content = parseTextData(context, match[0].length, 4 /* ATTRIBUTE_VALUE */);
- }
- return { content, isQuoted, loc: getSelection(context, start) };
- }
- function parseInterpolation(context, mode) {
- const [open, close] = context.options.delimiters;
- const closeIndex = context.source.indexOf(close, open.length);
- if (closeIndex === -1) {
- emitError(context, 25 /* X_MISSING_INTERPOLATION_END */);
- return undefined;
- }
- const start = getCursor(context);
- advanceBy(context, open.length);
- const innerStart = getCursor(context);
- const innerEnd = getCursor(context);
- const rawContentLength = closeIndex - open.length;
- const rawContent = context.source.slice(0, rawContentLength);
- const preTrimContent = parseTextData(context, rawContentLength, mode);
- const content = preTrimContent.trim();
- const startOffset = preTrimContent.indexOf(content);
- if (startOffset > 0) {
- advancePositionWithMutation(innerStart, rawContent, startOffset);
- }
- const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);
- advancePositionWithMutation(innerEnd, rawContent, endOffset);
- advanceBy(context, close.length);
- return {
- type: 5 /* INTERPOLATION */,
- content: {
- type: 4 /* SIMPLE_EXPRESSION */,
- isStatic: false,
- // Set `isConstant` to false by default and will decide in transformExpression
- constType: 0 /* NOT_CONSTANT */,
- content,
- loc: getSelection(context, innerStart, innerEnd)
- },
- loc: getSelection(context, start)
- };
- }
- function parseText(context, mode) {
- const endTokens = ['<', context.options.delimiters[0]];
- if (mode === 3 /* CDATA */) {
- endTokens.push(']]>');
- }
- let endIndex = context.source.length;
- for (let i = 0; i < endTokens.length; i++) {
- const index = context.source.indexOf(endTokens[i], 1);
- if (index !== -1 && endIndex > index) {
- endIndex = index;
- }
- }
- const start = getCursor(context);
- const content = parseTextData(context, endIndex, mode);
- return {
- type: 2 /* TEXT */,
- content,
- loc: getSelection(context, start)
- };
- }
- /**
- * Get text data with a given length from the current location.
- * This translates HTML entities in the text data.
- */
- function parseTextData(context, length, mode) {
- const rawText = context.source.slice(0, length);
- advanceBy(context, length);
- if (mode === 2 /* RAWTEXT */ ||
- mode === 3 /* CDATA */ ||
- rawText.indexOf('&') === -1) {
- return rawText;
- }
- else {
- // DATA or RCDATA containing "&"". Entity decoding required.
- return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);
- }
- }
- function getCursor(context) {
- const { column, line, offset } = context;
- return { column, line, offset };
- }
- function getSelection(context, start, end) {
- end = end || getCursor(context);
- return {
- start,
- end,
- source: context.originalSource.slice(start.offset, end.offset)
- };
- }
- function last(xs) {
- return xs[xs.length - 1];
- }
- function startsWith(source, searchString) {
- return source.startsWith(searchString);
- }
- function advanceBy(context, numberOfCharacters) {
- const { source } = context;
- advancePositionWithMutation(context, source, numberOfCharacters);
- context.source = source.slice(numberOfCharacters);
- }
- function advanceSpaces(context) {
- const match = /^[\t\r\n\f ]+/.exec(context.source);
- if (match) {
- advanceBy(context, match[0].length);
- }
- }
- function getNewPosition(context, start, numberOfCharacters) {
- return advancePositionWithClone(start, context.originalSource.slice(start.offset, numberOfCharacters), numberOfCharacters);
- }
- function emitError(context, code, offset, loc = getCursor(context)) {
- if (offset) {
- loc.offset += offset;
- loc.column += offset;
- }
- context.options.onError(createCompilerError(code, {
- start: loc,
- end: loc,
- source: ''
- }));
- }
- function isEnd(context, mode, ancestors) {
- const s = context.source;
- switch (mode) {
- case 0 /* DATA */:
- if (startsWith(s, '</')) {
- // TODO: probably bad performance
- for (let i = ancestors.length - 1; i >= 0; --i) {
- if (startsWithEndTagOpen(s, ancestors[i].tag)) {
- return true;
- }
- }
- }
- break;
- case 1 /* RCDATA */:
- case 2 /* RAWTEXT */: {
- const parent = last(ancestors);
- if (parent && startsWithEndTagOpen(s, parent.tag)) {
- return true;
- }
- break;
- }
- case 3 /* CDATA */:
- if (startsWith(s, ']]>')) {
- return true;
- }
- break;
- }
- return !s;
- }
- function startsWithEndTagOpen(source, tag) {
- return (startsWith(source, '</') &&
- source.substr(2, tag.length).toLowerCase() === tag.toLowerCase() &&
- /[\t\r\n\f />]/.test(source[2 + tag.length] || '>'));
- }
- function hoistStatic(root, context) {
- walk(root, context,
- // Root node is unfortunately non-hoistable due to potential parent
- // fallthrough attributes.
- isSingleElementRoot(root, root.children[0]));
- }
- function isSingleElementRoot(root, child) {
- const { children } = root;
- return (children.length === 1 &&
- child.type === 1 /* ELEMENT */ &&
- !isSlotOutlet(child));
- }
- function walk(node, context, doNotHoistNode = false) {
- // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
- // static bindings with expressions. These expressions are guaranteed to be
- // constant so they are still eligible for hoisting, but they are only
- // available at runtime and therefore cannot be evaluated ahead of time.
- // This is only a concern for pre-stringification (via transformHoist by
- // @vue/compiler-dom), but doing it here allows us to perform only one full
- // walk of the AST and allow `stringifyStatic` to stop walking as soon as its
- // stringficiation threshold is met.
- let canStringify = true;
- const { children } = node;
- const originalCount = children.length;
- let hoistedCount = 0;
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- // only plain elements & text calls are eligible for hoisting.
- if (child.type === 1 /* ELEMENT */ &&
- child.tagType === 0 /* ELEMENT */) {
- const constantType = doNotHoistNode
- ? 0 /* NOT_CONSTANT */
- : getConstantType(child, context);
- if (constantType > 0 /* NOT_CONSTANT */) {
- if (constantType < 3 /* CAN_STRINGIFY */) {
- canStringify = false;
- }
- if (constantType >= 2 /* CAN_HOIST */) {
- child.codegenNode.patchFlag =
- -1 /* HOISTED */ + ((process.env.NODE_ENV !== 'production') ? ` /* HOISTED */` : ``);
- child.codegenNode = context.hoist(child.codegenNode);
- hoistedCount++;
- continue;
- }
- }
- else {
- // node may contain dynamic children, but its props may be eligible for
- // hoisting.
- const codegenNode = child.codegenNode;
- if (codegenNode.type === 13 /* VNODE_CALL */) {
- const flag = getPatchFlag(codegenNode);
- if ((!flag ||
- flag === 512 /* NEED_PATCH */ ||
- flag === 1 /* TEXT */) &&
- getGeneratedPropsConstantType(child, context) >=
- 2 /* CAN_HOIST */) {
- const props = getNodeProps(child);
- if (props) {
- codegenNode.props = context.hoist(props);
- }
- }
- if (codegenNode.dynamicProps) {
- codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);
- }
- }
- }
- }
- else if (child.type === 12 /* TEXT_CALL */) {
- const contentType = getConstantType(child.content, context);
- if (contentType > 0) {
- if (contentType < 3 /* CAN_STRINGIFY */) {
- canStringify = false;
- }
- if (contentType >= 2 /* CAN_HOIST */) {
- child.codegenNode = context.hoist(child.codegenNode);
- hoistedCount++;
- }
- }
- }
- // walk further
- if (child.type === 1 /* ELEMENT */) {
- const isComponent = child.tagType === 1 /* COMPONENT */;
- if (isComponent) {
- context.scopes.vSlot++;
- }
- walk(child, context);
- if (isComponent) {
- context.scopes.vSlot--;
- }
- }
- else if (child.type === 11 /* FOR */) {
- // Do not hoist v-for single child because it has to be a block
- walk(child, context, child.children.length === 1);
- }
- else if (child.type === 9 /* IF */) {
- for (let i = 0; i < child.branches.length; i++) {
- // Do not hoist v-if single child because it has to be a block
- walk(child.branches[i], context, child.branches[i].children.length === 1);
- }
- }
- }
- if (canStringify && hoistedCount && context.transformHoist) {
- context.transformHoist(children, context, node);
- }
- // all children were hoisted - the entire children array is hoistable.
- if (hoistedCount &&
- hoistedCount === originalCount &&
- node.type === 1 /* ELEMENT */ &&
- node.tagType === 0 /* ELEMENT */ &&
- node.codegenNode &&
- node.codegenNode.type === 13 /* VNODE_CALL */ &&
- isArray(node.codegenNode.children)) {
- node.codegenNode.children = context.hoist(createArrayExpression(node.codegenNode.children));
- }
- }
- function getConstantType(node, context) {
- const { constantCache } = context;
- switch (node.type) {
- case 1 /* ELEMENT */:
- if (node.tagType !== 0 /* ELEMENT */) {
- return 0 /* NOT_CONSTANT */;
- }
- const cached = constantCache.get(node);
- if (cached !== undefined) {
- return cached;
- }
- const codegenNode = node.codegenNode;
- if (codegenNode.type !== 13 /* VNODE_CALL */) {
- return 0 /* NOT_CONSTANT */;
- }
- const flag = getPatchFlag(codegenNode);
- if (!flag) {
- let returnType = 3 /* CAN_STRINGIFY */;
- // Element itself has no patch flag. However we still need to check:
- // 1. Even for a node with no patch flag, it is possible for it to contain
- // non-hoistable expressions that refers to scope variables, e.g. compiler
- // injected keys or cached event handlers. Therefore we need to always
- // check the codegenNode's props to be sure.
- const generatedPropsType = getGeneratedPropsConstantType(node, context);
- if (generatedPropsType === 0 /* NOT_CONSTANT */) {
- constantCache.set(node, 0 /* NOT_CONSTANT */);
- return 0 /* NOT_CONSTANT */;
- }
- if (generatedPropsType < returnType) {
- returnType = generatedPropsType;
- }
- // 2. its children.
- for (let i = 0; i < node.children.length; i++) {
- const childType = getConstantType(node.children[i], context);
- if (childType === 0 /* NOT_CONSTANT */) {
- constantCache.set(node, 0 /* NOT_CONSTANT */);
- return 0 /* NOT_CONSTANT */;
- }
- if (childType < returnType) {
- returnType = childType;
- }
- }
- // 3. if the type is not already CAN_SKIP_PATCH which is the lowest non-0
- // type, check if any of the props can cause the type to be lowered
- // we can skip can_patch because it's guaranteed by the absence of a
- // patchFlag.
- if (returnType > 1 /* CAN_SKIP_PATCH */) {
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind' && p.exp) {
- const expType = getConstantType(p.exp, context);
- if (expType === 0 /* NOT_CONSTANT */) {
- constantCache.set(node, 0 /* NOT_CONSTANT */);
- return 0 /* NOT_CONSTANT */;
- }
- if (expType < returnType) {
- returnType = expType;
- }
- }
- }
- }
- // only svg/foreignObject could be block here, however if they are
- // static then they don't need to be blocks since there will be no
- // nested updates.
- if (codegenNode.isBlock) {
- context.removeHelper(OPEN_BLOCK);
- context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
- codegenNode.isBlock = false;
- context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));
- }
- constantCache.set(node, returnType);
- return returnType;
- }
- else {
- constantCache.set(node, 0 /* NOT_CONSTANT */);
- return 0 /* NOT_CONSTANT */;
- }
- case 2 /* TEXT */:
- case 3 /* COMMENT */:
- return 3 /* CAN_STRINGIFY */;
- case 9 /* IF */:
- case 11 /* FOR */:
- case 10 /* IF_BRANCH */:
- return 0 /* NOT_CONSTANT */;
- case 5 /* INTERPOLATION */:
- case 12 /* TEXT_CALL */:
- return getConstantType(node.content, context);
- case 4 /* SIMPLE_EXPRESSION */:
- return node.constType;
- case 8 /* COMPOUND_EXPRESSION */:
- let returnType = 3 /* CAN_STRINGIFY */;
- for (let i = 0; i < node.children.length; i++) {
- const child = node.children[i];
- if (isString(child) || isSymbol(child)) {
- continue;
- }
- const childType = getConstantType(child, context);
- if (childType === 0 /* NOT_CONSTANT */) {
- return 0 /* NOT_CONSTANT */;
- }
- else if (childType < returnType) {
- returnType = childType;
- }
- }
- return returnType;
- default:
- if ((process.env.NODE_ENV !== 'production')) ;
- return 0 /* NOT_CONSTANT */;
- }
- }
- const allowHoistedHelperSet = new Set([
- NORMALIZE_CLASS,
- NORMALIZE_STYLE,
- NORMALIZE_PROPS,
- GUARD_REACTIVE_PROPS
- ]);
- function getConstantTypeOfHelperCall(value, context) {
- if (value.type === 14 /* JS_CALL_EXPRESSION */ &&
- !isString(value.callee) &&
- allowHoistedHelperSet.has(value.callee)) {
- const arg = value.arguments[0];
- if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
- return getConstantType(arg, context);
- }
- else if (arg.type === 14 /* JS_CALL_EXPRESSION */) {
- // in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(exp))`
- return getConstantTypeOfHelperCall(arg, context);
- }
- }
- return 0 /* NOT_CONSTANT */;
- }
- function getGeneratedPropsConstantType(node, context) {
- let returnType = 3 /* CAN_STRINGIFY */;
- const props = getNodeProps(node);
- if (props && props.type === 15 /* JS_OBJECT_EXPRESSION */) {
- const { properties } = props;
- for (let i = 0; i < properties.length; i++) {
- const { key, value } = properties[i];
- const keyType = getConstantType(key, context);
- if (keyType === 0 /* NOT_CONSTANT */) {
- return keyType;
- }
- if (keyType < returnType) {
- returnType = keyType;
- }
- let valueType;
- if (value.type === 4 /* SIMPLE_EXPRESSION */) {
- valueType = getConstantType(value, context);
- }
- else if (value.type === 14 /* JS_CALL_EXPRESSION */) {
- // some helper calls can be hoisted,
- // such as the `normalizeProps` generated by the compiler for pre-normalize class,
- // in this case we need to respect the ConstanType of the helper's argments
- valueType = getConstantTypeOfHelperCall(value, context);
- }
- else {
- valueType = 0 /* NOT_CONSTANT */;
- }
- if (valueType === 0 /* NOT_CONSTANT */) {
- return valueType;
- }
- if (valueType < returnType) {
- returnType = valueType;
- }
- }
- }
- return returnType;
- }
- function getNodeProps(node) {
- const codegenNode = node.codegenNode;
- if (codegenNode.type === 13 /* VNODE_CALL */) {
- return codegenNode.props;
- }
- }
- function getPatchFlag(node) {
- const flag = node.patchFlag;
- return flag ? parseInt(flag, 10) : undefined;
- }
- function createTransformContext(root, { filename = '', prefixIdentifiers = false, hoistStatic = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = NOOP, isCustomElement = NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {
- const nameMatch = filename.replace(/\?.*$/, '').match(/([^/\\]+)\.\w+$/);
- const context = {
- // options
- selfName: nameMatch && capitalize(camelize$1(nameMatch[1])),
- prefixIdentifiers,
- hoistStatic,
- cacheHandlers,
- nodeTransforms,
- directiveTransforms,
- transformHoist,
- isBuiltInComponent,
- isCustomElement,
- expressionPlugins,
- scopeId,
- slotted,
- ssr,
- inSSR,
- ssrCssVars,
- bindingMetadata,
- inline,
- isTS,
- onError,
- onWarn,
- compatConfig,
- // state
- root,
- helpers: new Map(),
- components: new Set(),
- directives: new Set(),
- hoists: [],
- imports: [],
- constantCache: new Map(),
- temps: 0,
- cached: 0,
- identifiers: Object.create(null),
- scopes: {
- vFor: 0,
- vSlot: 0,
- vPre: 0,
- vOnce: 0
- },
- parent: null,
- currentNode: root,
- childIndex: 0,
- inVOnce: false,
- // methods
- helper(name) {
- const count = context.helpers.get(name) || 0;
- context.helpers.set(name, count + 1);
- return name;
- },
- removeHelper(name) {
- const count = context.helpers.get(name);
- if (count) {
- const currentCount = count - 1;
- if (!currentCount) {
- context.helpers.delete(name);
- }
- else {
- context.helpers.set(name, currentCount);
- }
- }
- },
- helperString(name) {
- return `_${helperNameMap[context.helper(name)]}`;
- },
- replaceNode(node) {
- /* istanbul ignore if */
- if ((process.env.NODE_ENV !== 'production')) {
- if (!context.currentNode) {
- throw new Error(`Node being replaced is already removed.`);
- }
- if (!context.parent) {
- throw new Error(`Cannot replace root node.`);
- }
- }
- context.parent.children[context.childIndex] = context.currentNode = node;
- },
- removeNode(node) {
- if ((process.env.NODE_ENV !== 'production') && !context.parent) {
- throw new Error(`Cannot remove root node.`);
- }
- const list = context.parent.children;
- const removalIndex = node
- ? list.indexOf(node)
- : context.currentNode
- ? context.childIndex
- : -1;
- /* istanbul ignore if */
- if ((process.env.NODE_ENV !== 'production') && removalIndex < 0) {
- throw new Error(`node being removed is not a child of current parent`);
- }
- if (!node || node === context.currentNode) {
- // current node removed
- context.currentNode = null;
- context.onNodeRemoved();
- }
- else {
- // sibling node removed
- if (context.childIndex > removalIndex) {
- context.childIndex--;
- context.onNodeRemoved();
- }
- }
- context.parent.children.splice(removalIndex, 1);
- },
- onNodeRemoved: () => { },
- addIdentifiers(exp) {
- },
- removeIdentifiers(exp) {
- },
- hoist(exp) {
- if (isString(exp))
- exp = createSimpleExpression(exp);
- context.hoists.push(exp);
- const identifier = createSimpleExpression(`_hoisted_${context.hoists.length}`, false, exp.loc, 2 /* CAN_HOIST */);
- identifier.hoisted = exp;
- return identifier;
- },
- cache(exp, isVNode = false) {
- return createCacheExpression(context.cached++, exp, isVNode);
- }
- };
- {
- context.filters = new Set();
- }
- return context;
- }
- function transform(root, options) {
- const context = createTransformContext(root, options);
- traverseNode(root, context);
- if (options.hoistStatic) {
- hoistStatic(root, context);
- }
- if (!options.ssr) {
- createRootCodegen(root, context);
- }
- // finalize meta information
- root.helpers = [...context.helpers.keys()];
- root.components = [...context.components];
- root.directives = [...context.directives];
- root.imports = context.imports;
- root.hoists = context.hoists;
- root.temps = context.temps;
- root.cached = context.cached;
- {
- root.filters = [...context.filters];
- }
- }
- function createRootCodegen(root, context) {
- const { helper } = context;
- const { children } = root;
- if (children.length === 1) {
- const child = children[0];
- // if the single child is an element, turn it into a block.
- if (isSingleElementRoot(root, child) && child.codegenNode) {
- // single element root is never hoisted so codegenNode will never be
- // SimpleExpressionNode
- const codegenNode = child.codegenNode;
- if (codegenNode.type === 13 /* VNODE_CALL */) {
- makeBlock(codegenNode, context);
- }
- root.codegenNode = codegenNode;
- }
- else {
- // - single <slot/>, IfNode, ForNode: already blocks.
- // - single text node: always patched.
- // root codegen falls through via genNode()
- root.codegenNode = child;
- }
- }
- else if (children.length > 1) {
- // root has multiple nodes - return a fragment block.
- let patchFlag = 64 /* STABLE_FRAGMENT */;
- let patchFlagText = PatchFlagNames[64 /* STABLE_FRAGMENT */];
- // check if the fragment actually contains a single valid child with
- // the rest being comments
- if ((process.env.NODE_ENV !== 'production') &&
- children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {
- patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;
- patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
- }
- root.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root.children, patchFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${patchFlagText} */` : ``), undefined, undefined, true, undefined, false /* isComponent */);
- }
- else ;
- }
- function traverseChildren(parent, context) {
- let i = 0;
- const nodeRemoved = () => {
- i--;
- };
- for (; i < parent.children.length; i++) {
- const child = parent.children[i];
- if (isString(child))
- continue;
- context.parent = parent;
- context.childIndex = i;
- context.onNodeRemoved = nodeRemoved;
- traverseNode(child, context);
- }
- }
- function traverseNode(node, context) {
- context.currentNode = node;
- // apply transform plugins
- const { nodeTransforms } = context;
- const exitFns = [];
- for (let i = 0; i < nodeTransforms.length; i++) {
- const onExit = nodeTransforms[i](node, context);
- if (onExit) {
- if (isArray(onExit)) {
- exitFns.push(...onExit);
- }
- else {
- exitFns.push(onExit);
- }
- }
- if (!context.currentNode) {
- // node was removed
- return;
- }
- else {
- // node may have been replaced
- node = context.currentNode;
- }
- }
- switch (node.type) {
- case 3 /* COMMENT */:
- if (!context.ssr) {
- // inject import for the Comment symbol, which is needed for creating
- // comment nodes with `createVNode`
- context.helper(CREATE_COMMENT);
- }
- break;
- case 5 /* INTERPOLATION */:
- // no need to traverse, but we need to inject toString helper
- if (!context.ssr) {
- context.helper(TO_DISPLAY_STRING);
- }
- break;
- // for container types, further traverse downwards
- case 9 /* IF */:
- for (let i = 0; i < node.branches.length; i++) {
- traverseNode(node.branches[i], context);
- }
- break;
- case 10 /* IF_BRANCH */:
- case 11 /* FOR */:
- case 1 /* ELEMENT */:
- case 0 /* ROOT */:
- traverseChildren(node, context);
- break;
- }
- // exit transforms
- context.currentNode = node;
- let i = exitFns.length;
- while (i--) {
- exitFns[i]();
- }
- }
- function createStructuralDirectiveTransform(name, fn) {
- const matches = isString(name)
- ? (n) => n === name
- : (n) => name.test(n);
- return (node, context) => {
- if (node.type === 1 /* ELEMENT */) {
- const { props } = node;
- // structural directive transforms are not concerned with slots
- // as they are handled separately in vSlot.ts
- if (node.tagType === 3 /* TEMPLATE */ && props.some(isVSlot)) {
- return;
- }
- const exitFns = [];
- for (let i = 0; i < props.length; i++) {
- const prop = props[i];
- if (prop.type === 7 /* DIRECTIVE */ && matches(prop.name)) {
- // structural directives are removed to avoid infinite recursion
- // also we remove them *before* applying so that it can further
- // traverse itself in case it moves the node around
- props.splice(i, 1);
- i--;
- const onExit = fn(node, prop, context);
- if (onExit)
- exitFns.push(onExit);
- }
- }
- return exitFns;
- }
- };
- }
- const PURE_ANNOTATION = `/*#__PURE__*/`;
- function createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssr = false, isTS = false, inSSR = false }) {
- const context = {
- mode,
- prefixIdentifiers,
- sourceMap,
- filename,
- scopeId,
- optimizeImports,
- runtimeGlobalName,
- runtimeModuleName,
- ssr,
- isTS,
- inSSR,
- source: ast.loc.source,
- code: ``,
- column: 1,
- line: 1,
- offset: 0,
- indentLevel: 0,
- pure: false,
- map: undefined,
- helper(key) {
- return `_${helperNameMap[key]}`;
- },
- push(code, node) {
- context.code += code;
- },
- indent() {
- newline(++context.indentLevel);
- },
- deindent(withoutNewLine = false) {
- if (withoutNewLine) {
- --context.indentLevel;
- }
- else {
- newline(--context.indentLevel);
- }
- },
- newline() {
- newline(context.indentLevel);
- }
- };
- function newline(n) {
- context.push('\n' + ` `.repeat(n));
- }
- return context;
- }
- function generate(ast, options = {}) {
- const context = createCodegenContext(ast, options);
- if (options.onContextCreated)
- options.onContextCreated(context);
- const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;
- const hasHelpers = ast.helpers.length > 0;
- const useWithBlock = !prefixIdentifiers && mode !== 'module';
- // preambles
- // in setup() inline mode, the preamble is generated in a sub context
- // and returned separately.
- const preambleContext = context;
- {
- genFunctionPreamble(ast, preambleContext);
- }
- // enter render function
- const functionName = ssr ? `ssrRender` : `render`;
- const args = ssr ? ['_ctx', '_push', '_parent', '_attrs'] : ['_ctx', '_cache'];
- const signature = args.join(', ');
- {
- push(`function ${functionName}(${signature}) {`);
- }
- indent();
- if (useWithBlock) {
- push(`with (_ctx) {`);
- indent();
- // function mode const declarations should be inside with block
- // also they should be renamed to avoid collision with user properties
- if (hasHelpers) {
- push(`const { ${ast.helpers
- .map(s => `${helperNameMap[s]}: _${helperNameMap[s]}`)
- .join(', ')} } = _Vue`);
- push(`\n`);
- newline();
- }
- }
- // generate asset resolution statements
- if (ast.components.length) {
- genAssets(ast.components, 'component', context);
- if (ast.directives.length || ast.temps > 0) {
- newline();
- }
- }
- if (ast.directives.length) {
- genAssets(ast.directives, 'directive', context);
- if (ast.temps > 0) {
- newline();
- }
- }
- if (ast.filters && ast.filters.length) {
- newline();
- genAssets(ast.filters, 'filter', context);
- newline();
- }
- if (ast.temps > 0) {
- push(`let `);
- for (let i = 0; i < ast.temps; i++) {
- push(`${i > 0 ? `, ` : ``}_temp${i}`);
- }
- }
- if (ast.components.length || ast.directives.length || ast.temps) {
- push(`\n`);
- newline();
- }
- // generate the VNode tree expression
- if (!ssr) {
- push(`return `);
- }
- if (ast.codegenNode) {
- genNode(ast.codegenNode, context);
- }
- else {
- push(`null`);
- }
- if (useWithBlock) {
- deindent();
- push(`}`);
- }
- deindent();
- push(`}`);
- return {
- ast,
- code: context.code,
- preamble: ``,
- // SourceMapGenerator does have toJSON() method but it's not in the types
- map: context.map ? context.map.toJSON() : undefined
- };
- }
- function genFunctionPreamble(ast, context) {
- const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName } = context;
- const VueBinding = runtimeGlobalName;
- const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;
- // Generate const declaration for helpers
- // In prefix mode, we place the const declaration at top so it's done
- // only once; But if we not prefixing, we place the declaration inside the
- // with block so it doesn't incur the `in` check cost for every helper access.
- if (ast.helpers.length > 0) {
- {
- // "with" mode.
- // save Vue in a separate variable to avoid collision
- push(`const _Vue = ${VueBinding}\n`);
- // in "with" mode, helpers are declared inside the with block to avoid
- // has check cost, but hoists are lifted out of the function - we need
- // to provide the helper here.
- if (ast.hoists.length) {
- const staticHelpers = [
- CREATE_VNODE,
- CREATE_ELEMENT_VNODE,
- CREATE_COMMENT,
- CREATE_TEXT,
- CREATE_STATIC
- ]
- .filter(helper => ast.helpers.includes(helper))
- .map(aliasHelper)
- .join(', ');
- push(`const { ${staticHelpers} } = _Vue\n`);
- }
- }
- }
- genHoists(ast.hoists, context);
- newline();
- push(`return `);
- }
- function genAssets(assets, type, { helper, push, newline, isTS }) {
- const resolver = helper(type === 'filter'
- ? RESOLVE_FILTER
- : type === 'component'
- ? RESOLVE_COMPONENT
- : RESOLVE_DIRECTIVE);
- for (let i = 0; i < assets.length; i++) {
- let id = assets[i];
- // potential component implicit self-reference inferred from SFC filename
- const maybeSelfReference = id.endsWith('__self');
- if (maybeSelfReference) {
- id = id.slice(0, -6);
- }
- push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`);
- if (i < assets.length - 1) {
- newline();
- }
- }
- }
- function genHoists(hoists, context) {
- if (!hoists.length) {
- return;
- }
- context.pure = true;
- const { push, newline, helper, scopeId, mode } = context;
- newline();
- hoists.forEach((exp, i) => {
- if (exp) {
- push(`const _hoisted_${i + 1} = `);
- genNode(exp, context);
- newline();
- }
- });
- context.pure = false;
- }
- function isText$1(n) {
- return (isString(n) ||
- n.type === 4 /* SIMPLE_EXPRESSION */ ||
- n.type === 2 /* TEXT */ ||
- n.type === 5 /* INTERPOLATION */ ||
- n.type === 8 /* COMPOUND_EXPRESSION */);
- }
- function genNodeListAsArray(nodes, context) {
- const multilines = nodes.length > 3 ||
- (((process.env.NODE_ENV !== 'production')) && nodes.some(n => isArray(n) || !isText$1(n)));
- context.push(`[`);
- multilines && context.indent();
- genNodeList(nodes, context, multilines);
- multilines && context.deindent();
- context.push(`]`);
- }
- function genNodeList(nodes, context, multilines = false, comma = true) {
- const { push, newline } = context;
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- if (isString(node)) {
- push(node);
- }
- else if (isArray(node)) {
- genNodeListAsArray(node, context);
- }
- else {
- genNode(node, context);
- }
- if (i < nodes.length - 1) {
- if (multilines) {
- comma && push(',');
- newline();
- }
- else {
- comma && push(', ');
- }
- }
- }
- }
- function genNode(node, context) {
- if (isString(node)) {
- context.push(node);
- return;
- }
- if (isSymbol(node)) {
- context.push(context.helper(node));
- return;
- }
- switch (node.type) {
- case 1 /* ELEMENT */:
- case 9 /* IF */:
- case 11 /* FOR */:
- (process.env.NODE_ENV !== 'production') &&
- assert(node.codegenNode != null, `Codegen node is missing for element/if/for node. ` +
- `Apply appropriate transforms first.`);
- genNode(node.codegenNode, context);
- break;
- case 2 /* TEXT */:
- genText(node, context);
- break;
- case 4 /* SIMPLE_EXPRESSION */:
- genExpression(node, context);
- break;
- case 5 /* INTERPOLATION */:
- genInterpolation(node, context);
- break;
- case 12 /* TEXT_CALL */:
- genNode(node.codegenNode, context);
- break;
- case 8 /* COMPOUND_EXPRESSION */:
- genCompoundExpression(node, context);
- break;
- case 3 /* COMMENT */:
- genComment(node, context);
- break;
- case 13 /* VNODE_CALL */:
- genVNodeCall(node, context);
- break;
- case 14 /* JS_CALL_EXPRESSION */:
- genCallExpression(node, context);
- break;
- case 15 /* JS_OBJECT_EXPRESSION */:
- genObjectExpression(node, context);
- break;
- case 17 /* JS_ARRAY_EXPRESSION */:
- genArrayExpression(node, context);
- break;
- case 18 /* JS_FUNCTION_EXPRESSION */:
- genFunctionExpression(node, context);
- break;
- case 19 /* JS_CONDITIONAL_EXPRESSION */:
- genConditionalExpression(node, context);
- break;
- case 20 /* JS_CACHE_EXPRESSION */:
- genCacheExpression(node, context);
- break;
- case 21 /* JS_BLOCK_STATEMENT */:
- genNodeList(node.body, context, true, false);
- break;
- // SSR only types
- case 22 /* JS_TEMPLATE_LITERAL */:
- break;
- case 23 /* JS_IF_STATEMENT */:
- break;
- case 24 /* JS_ASSIGNMENT_EXPRESSION */:
- break;
- case 25 /* JS_SEQUENCE_EXPRESSION */:
- break;
- case 26 /* JS_RETURN_STATEMENT */:
- break;
- /* istanbul ignore next */
- case 10 /* IF_BRANCH */:
- // noop
- break;
- default:
- if ((process.env.NODE_ENV !== 'production')) {
- assert(false, `unhandled codegen node type: ${node.type}`);
- // make sure we exhaust all possible types
- const exhaustiveCheck = node;
- return exhaustiveCheck;
- }
- }
- }
- function genText(node, context) {
- context.push(JSON.stringify(node.content), node);
- }
- function genExpression(node, context) {
- const { content, isStatic } = node;
- context.push(isStatic ? JSON.stringify(content) : content, node);
- }
- function genInterpolation(node, context) {
- const { push, helper, pure } = context;
- if (pure)
- push(PURE_ANNOTATION);
- push(`${helper(TO_DISPLAY_STRING)}(`);
- genNode(node.content, context);
- push(`)`);
- }
- function genCompoundExpression(node, context) {
- for (let i = 0; i < node.children.length; i++) {
- const child = node.children[i];
- if (isString(child)) {
- context.push(child);
- }
- else {
- genNode(child, context);
- }
- }
- }
- function genExpressionAsPropertyKey(node, context) {
- const { push } = context;
- if (node.type === 8 /* COMPOUND_EXPRESSION */) {
- push(`[`);
- genCompoundExpression(node, context);
- push(`]`);
- }
- else if (node.isStatic) {
- // only quote keys if necessary
- const text = isSimpleIdentifier(node.content)
- ? node.content
- : JSON.stringify(node.content);
- push(text, node);
- }
- else {
- push(`[${node.content}]`, node);
- }
- }
- function genComment(node, context) {
- const { push, helper, pure } = context;
- if (pure) {
- push(PURE_ANNOTATION);
- }
- push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);
- }
- function genVNodeCall(node, context) {
- const { push, helper, pure } = context;
- const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;
- if (directives) {
- push(helper(WITH_DIRECTIVES) + `(`);
- }
- if (isBlock) {
- push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);
- }
- if (pure) {
- push(PURE_ANNOTATION);
- }
- const callHelper = isBlock
- ? getVNodeBlockHelper(context.inSSR, isComponent)
- : getVNodeHelper(context.inSSR, isComponent);
- push(helper(callHelper) + `(`, node);
- genNodeList(genNullableArgs([tag, props, children, patchFlag, dynamicProps]), context);
- push(`)`);
- if (isBlock) {
- push(`)`);
- }
- if (directives) {
- push(`, `);
- genNode(directives, context);
- push(`)`);
- }
- }
- function genNullableArgs(args) {
- let i = args.length;
- while (i--) {
- if (args[i] != null)
- break;
- }
- return args.slice(0, i + 1).map(arg => arg || `null`);
- }
- // JavaScript
- function genCallExpression(node, context) {
- const { push, helper, pure } = context;
- const callee = isString(node.callee) ? node.callee : helper(node.callee);
- if (pure) {
- push(PURE_ANNOTATION);
- }
- push(callee + `(`, node);
- genNodeList(node.arguments, context);
- push(`)`);
- }
- function genObjectExpression(node, context) {
- const { push, indent, deindent, newline } = context;
- const { properties } = node;
- if (!properties.length) {
- push(`{}`, node);
- return;
- }
- const multilines = properties.length > 1 ||
- (((process.env.NODE_ENV !== 'production')) &&
- properties.some(p => p.value.type !== 4 /* SIMPLE_EXPRESSION */));
- push(multilines ? `{` : `{ `);
- multilines && indent();
- for (let i = 0; i < properties.length; i++) {
- const { key, value } = properties[i];
- // key
- genExpressionAsPropertyKey(key, context);
- push(`: `);
- // value
- genNode(value, context);
- if (i < properties.length - 1) {
- // will only reach this if it's multilines
- push(`,`);
- newline();
- }
- }
- multilines && deindent();
- push(multilines ? `}` : ` }`);
- }
- function genArrayExpression(node, context) {
- genNodeListAsArray(node.elements, context);
- }
- function genFunctionExpression(node, context) {
- const { push, indent, deindent } = context;
- const { params, returns, body, newline, isSlot } = node;
- if (isSlot) {
- // wrap slot functions with owner context
- push(`_${helperNameMap[WITH_CTX]}(`);
- }
- push(`(`, node);
- if (isArray(params)) {
- genNodeList(params, context);
- }
- else if (params) {
- genNode(params, context);
- }
- push(`) => `);
- if (newline || body) {
- push(`{`);
- indent();
- }
- if (returns) {
- if (newline) {
- push(`return `);
- }
- if (isArray(returns)) {
- genNodeListAsArray(returns, context);
- }
- else {
- genNode(returns, context);
- }
- }
- else if (body) {
- genNode(body, context);
- }
- if (newline || body) {
- deindent();
- push(`}`);
- }
- if (isSlot) {
- if (node.isNonScopedSlot) {
- push(`, undefined, true`);
- }
- push(`)`);
- }
- }
- function genConditionalExpression(node, context) {
- const { test, consequent, alternate, newline: needNewline } = node;
- const { push, indent, deindent, newline } = context;
- if (test.type === 4 /* SIMPLE_EXPRESSION */) {
- const needsParens = !isSimpleIdentifier(test.content);
- needsParens && push(`(`);
- genExpression(test, context);
- needsParens && push(`)`);
- }
- else {
- push(`(`);
- genNode(test, context);
- push(`)`);
- }
- needNewline && indent();
- context.indentLevel++;
- needNewline || push(` `);
- push(`? `);
- genNode(consequent, context);
- context.indentLevel--;
- needNewline && newline();
- needNewline || push(` `);
- push(`: `);
- const isNested = alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */;
- if (!isNested) {
- context.indentLevel++;
- }
- genNode(alternate, context);
- if (!isNested) {
- context.indentLevel--;
- }
- needNewline && deindent(true /* without newline */);
- }
- function genCacheExpression(node, context) {
- const { push, helper, indent, deindent, newline } = context;
- push(`_cache[${node.index}] || (`);
- if (node.isVNode) {
- indent();
- push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
- newline();
- }
- push(`_cache[${node.index}] = `);
- genNode(node.value, context);
- if (node.isVNode) {
- push(`,`);
- newline();
- push(`${helper(SET_BLOCK_TRACKING)}(1),`);
- newline();
- push(`_cache[${node.index}]`);
- deindent();
- }
- push(`)`);
- }
- function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = Object.create(null)) {
- const rootExp = root.type === 'Program' &&
- root.body[0].type === 'ExpressionStatement' &&
- root.body[0].expression;
- build.walk(root, {
- enter(node, parent) {
- parent && parentStack.push(parent);
- if (parent &&
- parent.type.startsWith('TS') &&
- parent.type !== 'TSAsExpression' &&
- parent.type !== 'TSNonNullExpression' &&
- parent.type !== 'TSTypeAssertion') {
- return this.skip();
- }
- if (node.type === 'Identifier') {
- const isLocal = !!knownIds[node.name];
- const isRefed = isReferencedIdentifier(node, parent, parentStack);
- if (includeAll || (isRefed && !isLocal)) {
- onIdentifier(node, parent, parentStack, isRefed, isLocal);
- }
- }
- else if (node.type === 'ObjectProperty' &&
- parent.type === 'ObjectPattern') {
- node.inPattern = true;
- }
- else if (isFunctionType(node)) {
- // walk function expressions and add its arguments to known identifiers
- // so that we don't prefix them
- walkFunctionParams(node, id => markScopeIdentifier(node, id, knownIds));
- }
- else if (node.type === 'BlockStatement') {
- // #3445 record block-level local variables
- walkBlockDeclarations(node, id => markScopeIdentifier(node, id, knownIds));
- }
- },
- leave(node, parent) {
- parent && parentStack.pop();
- if (node !== rootExp && node.scopeIds) {
- for (const id of node.scopeIds) {
- knownIds[id]--;
- if (knownIds[id] === 0) {
- delete knownIds[id];
- }
- }
- }
- }
- });
- }
- function isReferencedIdentifier(id, parent, parentStack) {
- if (!parent) {
- return true;
- }
- // is a special keyword but parsed as identifier
- if (id.name === 'arguments') {
- return false;
- }
- if (lib$1.isReferenced(id, parent)) {
- return true;
- }
- // babel's isReferenced check returns false for ids being assigned to, so we
- // need to cover those cases here
- switch (parent.type) {
- case 'AssignmentExpression':
- case 'AssignmentPattern':
- return true;
- case 'ObjectPattern':
- case 'ArrayPattern':
- return isInDestructureAssignment(parent, parentStack);
- }
- return false;
- }
- function isInDestructureAssignment(parent, parentStack) {
- if (parent &&
- (parent.type === 'ObjectProperty' || parent.type === 'ArrayPattern')) {
- let i = parentStack.length;
- while (i--) {
- const p = parentStack[i];
- if (p.type === 'AssignmentExpression') {
- return true;
- }
- else if (p.type !== 'ObjectProperty' && !p.type.endsWith('Pattern')) {
- break;
- }
- }
- }
- return false;
- }
- function walkFunctionParams(node, onIdent) {
- for (const p of node.params) {
- for (const id of extractIdentifiers(p)) {
- onIdent(id);
- }
- }
- }
- function walkBlockDeclarations(block, onIdent) {
- for (const stmt of block.body) {
- if (stmt.type === 'VariableDeclaration') {
- if (stmt.declare)
- continue;
- for (const decl of stmt.declarations) {
- for (const id of extractIdentifiers(decl.id)) {
- onIdent(id);
- }
- }
- }
- else if (stmt.type === 'FunctionDeclaration' ||
- stmt.type === 'ClassDeclaration') {
- if (stmt.declare || !stmt.id)
- continue;
- onIdent(stmt.id);
- }
- }
- }
- function extractIdentifiers(param, nodes = []) {
- switch (param.type) {
- case 'Identifier':
- nodes.push(param);
- break;
- case 'MemberExpression':
- let object = param;
- while (object.type === 'MemberExpression') {
- object = object.object;
- }
- nodes.push(object);
- break;
- case 'ObjectPattern':
- for (const prop of param.properties) {
- if (prop.type === 'RestElement') {
- extractIdentifiers(prop.argument, nodes);
- }
- else {
- extractIdentifiers(prop.value, nodes);
- }
- }
- break;
- case 'ArrayPattern':
- param.elements.forEach(element => {
- if (element)
- extractIdentifiers(element, nodes);
- });
- break;
- case 'RestElement':
- extractIdentifiers(param.argument, nodes);
- break;
- case 'AssignmentPattern':
- extractIdentifiers(param.left, nodes);
- break;
- }
- return nodes;
- }
- function markScopeIdentifier(node, child, knownIds) {
- const { name } = child;
- if (node.scopeIds && node.scopeIds.has(name)) {
- return;
- }
- if (name in knownIds) {
- knownIds[name]++;
- }
- else {
- knownIds[name] = 1;
- }
- (node.scopeIds || (node.scopeIds = new Set())).add(name);
- }
- const isFunctionType = (node) => {
- return /Function(?:Expression|Declaration)$|Method$/.test(node.type);
- };
- const isStaticProperty = (node) => node &&
- (node.type === 'ObjectProperty' || node.type === 'ObjectMethod') &&
- !node.computed;
- const isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;
- // these keywords should not appear inside expressions, but operators like
- // typeof, instanceof and in are allowed
- const prohibitedKeywordRE = new RegExp('\\b' +
- ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
- 'super,throw,while,yield,delete,export,import,return,switch,default,' +
- 'extends,finally,continue,debugger,function,arguments,typeof,void')
- .split(',')
- .join('\\b|\\b') +
- '\\b');
- // strip strings in expressions
- const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
- /**
- * Validate a non-prefixed expression.
- * This is only called when using the in-browser runtime compiler since it
- * doesn't prefix expressions.
- */
- function validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {
- const exp = node.content;
- // empty expressions are validated per-directive since some directives
- // do allow empty expressions.
- if (!exp.trim()) {
- return;
- }
- try {
- new Function(asRawStatements
- ? ` ${exp} `
- : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`);
- }
- catch (e) {
- let message = e.message;
- const keywordMatch = exp
- .replace(stripStringRE, '')
- .match(prohibitedKeywordRE);
- if (keywordMatch) {
- message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`;
- }
- context.onError(createCompilerError(43 /* X_INVALID_EXPRESSION */, node.loc, undefined, message));
- }
- }
- const transformExpression = (node, context) => {
- if (node.type === 5 /* INTERPOLATION */) {
- node.content = processExpression(node.content, context);
- }
- else if (node.type === 1 /* ELEMENT */) {
- // handle directives on element
- for (let i = 0; i < node.props.length; i++) {
- const dir = node.props[i];
- // do not process for v-on & v-for since they are special handled
- if (dir.type === 7 /* DIRECTIVE */ && dir.name !== 'for') {
- const exp = dir.exp;
- const arg = dir.arg;
- // do not process exp if this is v-on:arg - we need special handling
- // for wrapping inline statements.
- if (exp &&
- exp.type === 4 /* SIMPLE_EXPRESSION */ &&
- !(dir.name === 'on' && arg)) {
- dir.exp = processExpression(exp, context,
- // slot args must be processed as function params
- dir.name === 'slot');
- }
- if (arg && arg.type === 4 /* SIMPLE_EXPRESSION */ && !arg.isStatic) {
- dir.arg = processExpression(arg, context);
- }
- }
- }
- }
- };
- // Important: since this function uses Node.js only dependencies, it should
- // always be used with a leading !true check so that it can be
- // tree-shaken from the browser build.
- function processExpression(node, context,
- // some expressions like v-slot props & v-for aliases should be parsed as
- // function params
- asParams = false,
- // v-on handler values may contain multiple statements
- asRawStatements = false) {
- {
- if ((process.env.NODE_ENV !== 'production')) {
- // simple in-browser validation (same logic in 2.x)
- validateBrowserExpression(node, context, asParams, asRawStatements);
- }
- return node;
- }
- }
- const transformIf = createStructuralDirectiveTransform(/^(if|else|else-if)$/, (node, dir, context) => {
- return processIf(node, dir, context, (ifNode, branch, isRoot) => {
- // #1587: We need to dynamically increment the key based on the current
- // node's sibling nodes, since chained v-if/else branches are
- // rendered at the same depth
- const siblings = context.parent.children;
- let i = siblings.indexOf(ifNode);
- let key = 0;
- while (i-- >= 0) {
- const sibling = siblings[i];
- if (sibling && sibling.type === 9 /* IF */) {
- key += sibling.branches.length;
- }
- }
- // Exit callback. Complete the codegenNode when all children have been
- // transformed.
- return () => {
- if (isRoot) {
- ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);
- }
- else {
- // attach this branch's codegen node to the v-if root.
- const parentCondition = getParentCondition(ifNode.codegenNode);
- parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);
- }
- };
- });
- });
- // target-agnostic transform used for both Client and SSR
- function processIf(node, dir, context, processCodegen) {
- if (dir.name !== 'else' &&
- (!dir.exp || !dir.exp.content.trim())) {
- const loc = dir.exp ? dir.exp.loc : node.loc;
- context.onError(createCompilerError(27 /* X_V_IF_NO_EXPRESSION */, dir.loc));
- dir.exp = createSimpleExpression(`true`, false, loc);
- }
- if ((process.env.NODE_ENV !== 'production') && true && dir.exp) {
- validateBrowserExpression(dir.exp, context);
- }
- if (dir.name === 'if') {
- const branch = createIfBranch(node, dir);
- const ifNode = {
- type: 9 /* IF */,
- loc: node.loc,
- branches: [branch]
- };
- context.replaceNode(ifNode);
- if (processCodegen) {
- return processCodegen(ifNode, branch, true);
- }
- }
- else {
- // locate the adjacent v-if
- const siblings = context.parent.children;
- const comments = [];
- let i = siblings.indexOf(node);
- while (i-- >= -1) {
- const sibling = siblings[i];
- if ((process.env.NODE_ENV !== 'production') && sibling && sibling.type === 3 /* COMMENT */) {
- context.removeNode(sibling);
- comments.unshift(sibling);
- continue;
- }
- if (sibling &&
- sibling.type === 2 /* TEXT */ &&
- !sibling.content.trim().length) {
- context.removeNode(sibling);
- continue;
- }
- if (sibling && sibling.type === 9 /* IF */) {
- // move the node to the if node's branches
- context.removeNode();
- const branch = createIfBranch(node, dir);
- if ((process.env.NODE_ENV !== 'production') &&
- comments.length &&
- // #3619 ignore comments if the v-if is direct child of <transition>
- !(context.parent &&
- context.parent.type === 1 /* ELEMENT */ &&
- isBuiltInType(context.parent.tag, 'transition'))) {
- branch.children = [...comments, ...branch.children];
- }
- // check if user is forcing same key on different branches
- if ((process.env.NODE_ENV !== 'production') || !true) {
- const key = branch.userKey;
- if (key) {
- sibling.branches.forEach(({ userKey }) => {
- if (isSameKey(userKey, key)) {
- context.onError(createCompilerError(28 /* X_V_IF_SAME_KEY */, branch.userKey.loc));
- }
- });
- }
- }
- sibling.branches.push(branch);
- const onExit = processCodegen && processCodegen(sibling, branch, false);
- // since the branch was removed, it will not be traversed.
- // make sure to traverse here.
- traverseNode(branch, context);
- // call on exit
- if (onExit)
- onExit();
- // make sure to reset currentNode after traversal to indicate this
- // node has been removed.
- context.currentNode = null;
- }
- else {
- context.onError(createCompilerError(29 /* X_V_ELSE_NO_ADJACENT_IF */, node.loc));
- }
- break;
- }
- }
- }
- function createIfBranch(node, dir) {
- return {
- type: 10 /* IF_BRANCH */,
- loc: node.loc,
- condition: dir.name === 'else' ? undefined : dir.exp,
- children: node.tagType === 3 /* TEMPLATE */ && !findDir(node, 'for')
- ? node.children
- : [node],
- userKey: findProp(node, `key`)
- };
- }
- function createCodegenNodeForBranch(branch, keyIndex, context) {
- if (branch.condition) {
- return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context),
- // make sure to pass in asBlock: true so that the comment node call
- // closes the current block.
- createCallExpression(context.helper(CREATE_COMMENT), [
- (process.env.NODE_ENV !== 'production') ? '"v-if"' : '""',
- 'true'
- ]));
- }
- else {
- return createChildrenCodegenNode(branch, keyIndex, context);
- }
- }
- function createChildrenCodegenNode(branch, keyIndex, context) {
- const { helper } = context;
- const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2 /* CAN_HOIST */));
- const { children } = branch;
- const firstChild = children[0];
- const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1 /* ELEMENT */;
- if (needFragmentWrapper) {
- if (children.length === 1 && firstChild.type === 11 /* FOR */) {
- // optimize away nested fragments when child is a ForNode
- const vnodeCall = firstChild.codegenNode;
- injectProp(vnodeCall, keyProperty, context);
- return vnodeCall;
- }
- else {
- let patchFlag = 64 /* STABLE_FRAGMENT */;
- let patchFlagText = PatchFlagNames[64 /* STABLE_FRAGMENT */];
- // check if the fragment actually contains a single valid child with
- // the rest being comments
- if ((process.env.NODE_ENV !== 'production') &&
- children.filter(c => c.type !== 3 /* COMMENT */).length === 1) {
- patchFlag |= 2048 /* DEV_ROOT_FRAGMENT */;
- patchFlagText += `, ${PatchFlagNames[2048 /* DEV_ROOT_FRAGMENT */]}`;
- }
- return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${patchFlagText} */` : ``), undefined, undefined, true, false, false /* isComponent */, branch.loc);
- }
- }
- else {
- const ret = firstChild.codegenNode;
- const vnodeCall = getMemoedVNodeCall(ret);
- // Change createVNode to createBlock.
- if (vnodeCall.type === 13 /* VNODE_CALL */) {
- makeBlock(vnodeCall, context);
- }
- // inject branch key
- injectProp(vnodeCall, keyProperty, context);
- return ret;
- }
- }
- function isSameKey(a, b) {
- if (!a || a.type !== b.type) {
- return false;
- }
- if (a.type === 6 /* ATTRIBUTE */) {
- if (a.value.content !== b.value.content) {
- return false;
- }
- }
- else {
- // directive
- const exp = a.exp;
- const branchExp = b.exp;
- if (exp.type !== branchExp.type) {
- return false;
- }
- if (exp.type !== 4 /* SIMPLE_EXPRESSION */ ||
- exp.isStatic !== branchExp.isStatic ||
- exp.content !== branchExp.content) {
- return false;
- }
- }
- return true;
- }
- function getParentCondition(node) {
- while (true) {
- if (node.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
- if (node.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
- node = node.alternate;
- }
- else {
- return node;
- }
- }
- else if (node.type === 20 /* JS_CACHE_EXPRESSION */) {
- node = node.value;
- }
- }
- }
- const transformFor = createStructuralDirectiveTransform('for', (node, dir, context) => {
- const { helper, removeHelper } = context;
- return processFor(node, dir, context, forNode => {
- // create the loop render function expression now, and add the
- // iterator on exit after all children have been traversed
- const renderExp = createCallExpression(helper(RENDER_LIST), [
- forNode.source
- ]);
- const memo = findDir(node, 'memo');
- const keyProp = findProp(node, `key`);
- const keyExp = keyProp &&
- (keyProp.type === 6 /* ATTRIBUTE */
- ? createSimpleExpression(keyProp.value.content, true)
- : keyProp.exp);
- const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;
- const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&
- forNode.source.constType > 0 /* NOT_CONSTANT */;
- const fragmentFlag = isStableFragment
- ? 64 /* STABLE_FRAGMENT */
- : keyProp
- ? 128 /* KEYED_FRAGMENT */
- : 256 /* UNKEYED_FRAGMENT */;
- forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, renderExp, fragmentFlag +
- ((process.env.NODE_ENV !== 'production') ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``), undefined, undefined, true /* isBlock */, !isStableFragment /* disableTracking */, false /* isComponent */, node.loc);
- return () => {
- // finish the codegen now that all children have been traversed
- let childBlock;
- const isTemplate = isTemplateNode(node);
- const { children } = forNode;
- // check <template v-for> key placement
- if (((process.env.NODE_ENV !== 'production') || !true) && isTemplate) {
- node.children.some(c => {
- if (c.type === 1 /* ELEMENT */) {
- const key = findProp(c, 'key');
- if (key) {
- context.onError(createCompilerError(32 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */, key.loc));
- return true;
- }
- }
- });
- }
- const needFragmentWrapper = children.length !== 1 || children[0].type !== 1 /* ELEMENT */;
- const slotOutlet = isSlotOutlet(node)
- ? node
- : isTemplate &&
- node.children.length === 1 &&
- isSlotOutlet(node.children[0])
- ? node.children[0] // api-extractor somehow fails to infer this
- : null;
- if (slotOutlet) {
- // <slot v-for="..."> or <template v-for="..."><slot/></template>
- childBlock = slotOutlet.codegenNode;
- if (isTemplate && keyProperty) {
- // <template v-for="..." :key="..."><slot/></template>
- // we need to inject the key to the renderSlot() call.
- // the props for renderSlot is passed as the 3rd argument.
- injectProp(childBlock, keyProperty, context);
- }
- }
- else if (needFragmentWrapper) {
- // <template v-for="..."> with text or multi-elements
- // should generate a fragment block for each loop
- childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, 64 /* STABLE_FRAGMENT */ +
- ((process.env.NODE_ENV !== 'production')
- ? ` /* ${PatchFlagNames[64 /* STABLE_FRAGMENT */]} */`
- : ``), undefined, undefined, true, undefined, false /* isComponent */);
- }
- else {
- // Normal element v-for. Directly use the child's codegenNode
- // but mark it as a block.
- childBlock = children[0]
- .codegenNode;
- if (isTemplate && keyProperty) {
- injectProp(childBlock, keyProperty, context);
- }
- if (childBlock.isBlock !== !isStableFragment) {
- if (childBlock.isBlock) {
- // switch from block to vnode
- removeHelper(OPEN_BLOCK);
- removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
- }
- else {
- // switch from vnode to block
- removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));
- }
- }
- childBlock.isBlock = !isStableFragment;
- if (childBlock.isBlock) {
- helper(OPEN_BLOCK);
- helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));
- }
- else {
- helper(getVNodeHelper(context.inSSR, childBlock.isComponent));
- }
- }
- if (memo) {
- const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [
- createSimpleExpression(`_cached`)
- ]));
- loop.body = createBlockStatement([
- createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
- createCompoundExpression([
- `if (_cached`,
- ...(keyExp ? [` && _cached.key === `, keyExp] : []),
- ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`
- ]),
- createCompoundExpression([`const _item = `, childBlock]),
- createSimpleExpression(`_item.memo = _memo`),
- createSimpleExpression(`return _item`)
- ]);
- renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached++)));
- }
- else {
- renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true /* force newline */));
- }
- };
- });
- });
- // target-agnostic transform used for both Client and SSR
- function processFor(node, dir, context, processCodegen) {
- if (!dir.exp) {
- context.onError(createCompilerError(30 /* X_V_FOR_NO_EXPRESSION */, dir.loc));
- return;
- }
- const parseResult = parseForExpression(
- // can only be simple expression because vFor transform is applied
- // before expression transform.
- dir.exp, context);
- if (!parseResult) {
- context.onError(createCompilerError(31 /* X_V_FOR_MALFORMED_EXPRESSION */, dir.loc));
- return;
- }
- const { addIdentifiers, removeIdentifiers, scopes } = context;
- const { source, value, key, index } = parseResult;
- const forNode = {
- type: 11 /* FOR */,
- loc: dir.loc,
- source,
- valueAlias: value,
- keyAlias: key,
- objectIndexAlias: index,
- parseResult,
- children: isTemplateNode(node) ? node.children : [node]
- };
- context.replaceNode(forNode);
- // bookkeeping
- scopes.vFor++;
- const onExit = processCodegen && processCodegen(forNode);
- return () => {
- scopes.vFor--;
- if (onExit)
- onExit();
- };
- }
- const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
- // This regex doesn't cover the case if key or index aliases have destructuring,
- // but those do not make sense in the first place, so this works in practice.
- const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
- const stripParensRE = /^\(|\)$/g;
- function parseForExpression(input, context) {
- const loc = input.loc;
- const exp = input.content;
- const inMatch = exp.match(forAliasRE);
- if (!inMatch)
- return;
- const [, LHS, RHS] = inMatch;
- const result = {
- source: createAliasExpression(loc, RHS.trim(), exp.indexOf(RHS, LHS.length)),
- value: undefined,
- key: undefined,
- index: undefined
- };
- if ((process.env.NODE_ENV !== 'production') && true) {
- validateBrowserExpression(result.source, context);
- }
- let valueContent = LHS.trim().replace(stripParensRE, '').trim();
- const trimmedOffset = LHS.indexOf(valueContent);
- const iteratorMatch = valueContent.match(forIteratorRE);
- if (iteratorMatch) {
- valueContent = valueContent.replace(forIteratorRE, '').trim();
- const keyContent = iteratorMatch[1].trim();
- let keyOffset;
- if (keyContent) {
- keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
- result.key = createAliasExpression(loc, keyContent, keyOffset);
- if ((process.env.NODE_ENV !== 'production') && true) {
- validateBrowserExpression(result.key, context, true);
- }
- }
- if (iteratorMatch[2]) {
- const indexContent = iteratorMatch[2].trim();
- if (indexContent) {
- result.index = createAliasExpression(loc, indexContent, exp.indexOf(indexContent, result.key
- ? keyOffset + keyContent.length
- : trimmedOffset + valueContent.length));
- if ((process.env.NODE_ENV !== 'production') && true) {
- validateBrowserExpression(result.index, context, true);
- }
- }
- }
- }
- if (valueContent) {
- result.value = createAliasExpression(loc, valueContent, trimmedOffset);
- if ((process.env.NODE_ENV !== 'production') && true) {
- validateBrowserExpression(result.value, context, true);
- }
- }
- return result;
- }
- function createAliasExpression(range, content, offset) {
- return createSimpleExpression(content, false, getInnerRange(range, offset, content.length));
- }
- function createForLoopParams({ value, key, index }, memoArgs = []) {
- return createParamsList([value, key, index, ...memoArgs]);
- }
- function createParamsList(args) {
- let i = args.length;
- while (i--) {
- if (args[i])
- break;
- }
- return args
- .slice(0, i + 1)
- .map((arg, i) => arg || createSimpleExpression(`_`.repeat(i + 1), false));
- }
- const defaultFallback = createSimpleExpression(`undefined`, false);
- // A NodeTransform that:
- // 1. Tracks scope identifiers for scoped slots so that they don't get prefixed
- // by transformExpression. This is only applied in non-browser builds with
- // { prefixIdentifiers: true }.
- // 2. Track v-slot depths so that we know a slot is inside another slot.
- // Note the exit callback is executed before buildSlots() on the same node,
- // so only nested slots see positive numbers.
- const trackSlotScopes = (node, context) => {
- if (node.type === 1 /* ELEMENT */ &&
- (node.tagType === 1 /* COMPONENT */ ||
- node.tagType === 3 /* TEMPLATE */)) {
- // We are only checking non-empty v-slot here
- // since we only care about slots that introduce scope variables.
- const vSlot = findDir(node, 'slot');
- if (vSlot) {
- context.scopes.vSlot++;
- return () => {
- context.scopes.vSlot--;
- };
- }
- }
- };
- // A NodeTransform that tracks scope identifiers for scoped slots with v-for.
- // This transform is only applied in non-browser builds with { prefixIdentifiers: true }
- const trackVForSlotScopes = (node, context) => {
- let vFor;
- if (isTemplateNode(node) &&
- node.props.some(isVSlot) &&
- (vFor = findDir(node, 'for'))) {
- const result = (vFor.parseResult = parseForExpression(vFor.exp, context));
- if (result) {
- const { value, key, index } = result;
- const { addIdentifiers, removeIdentifiers } = context;
- value && addIdentifiers(value);
- key && addIdentifiers(key);
- index && addIdentifiers(index);
- return () => {
- value && removeIdentifiers(value);
- key && removeIdentifiers(key);
- index && removeIdentifiers(index);
- };
- }
- }
- };
- const buildClientSlotFn = (props, children, loc) => createFunctionExpression(props, children, false /* newline */, true /* isSlot */, children.length ? children[0].loc : loc);
- // Instead of being a DirectiveTransform, v-slot processing is called during
- // transformElement to build the slots object for a component.
- function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
- context.helper(WITH_CTX);
- const { children, loc } = node;
- const slotsProperties = [];
- const dynamicSlots = [];
- // If the slot is inside a v-for or another v-slot, force it to be dynamic
- // since it likely uses a scope variable.
- let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;
- // 1. Check for slot with slotProps on component itself.
- // <Comp v-slot="{ prop }"/>
- const onComponentSlot = findDir(node, 'slot', true);
- if (onComponentSlot) {
- const { arg, exp } = onComponentSlot;
- if (arg && !isStaticExp(arg)) {
- hasDynamicSlots = true;
- }
- slotsProperties.push(createObjectProperty(arg || createSimpleExpression('default', true), buildSlotFn(exp, children, loc)));
- }
- // 2. Iterate through children and check for template slots
- // <template v-slot:foo="{ prop }">
- let hasTemplateSlots = false;
- let hasNamedDefaultSlot = false;
- const implicitDefaultChildren = [];
- const seenSlotNames = new Set();
- for (let i = 0; i < children.length; i++) {
- const slotElement = children[i];
- let slotDir;
- if (!isTemplateNode(slotElement) ||
- !(slotDir = findDir(slotElement, 'slot', true))) {
- // not a <template v-slot>, skip.
- if (slotElement.type !== 3 /* COMMENT */) {
- implicitDefaultChildren.push(slotElement);
- }
- continue;
- }
- if (onComponentSlot) {
- // already has on-component slot - this is incorrect usage.
- context.onError(createCompilerError(36 /* X_V_SLOT_MIXED_SLOT_USAGE */, slotDir.loc));
- break;
- }
- hasTemplateSlots = true;
- const { children: slotChildren, loc: slotLoc } = slotElement;
- const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;
- // check if name is dynamic.
- let staticSlotName;
- if (isStaticExp(slotName)) {
- staticSlotName = slotName ? slotName.content : `default`;
- }
- else {
- hasDynamicSlots = true;
- }
- const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
- // check if this slot is conditional (v-if/v-for)
- let vIf;
- let vElse;
- let vFor;
- if ((vIf = findDir(slotElement, 'if'))) {
- hasDynamicSlots = true;
- dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback));
- }
- else if ((vElse = findDir(slotElement, /^else(-if)?$/, true /* allowEmpty */))) {
- // find adjacent v-if
- let j = i;
- let prev;
- while (j--) {
- prev = children[j];
- if (prev.type !== 3 /* COMMENT */) {
- break;
- }
- }
- if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {
- // remove node
- children.splice(i, 1);
- i--;
- // attach this slot to previous conditional
- let conditional = dynamicSlots[dynamicSlots.length - 1];
- while (conditional.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {
- conditional = conditional.alternate;
- }
- conditional.alternate = vElse.exp
- ? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback)
- : buildDynamicSlot(slotName, slotFunction);
- }
- else {
- context.onError(createCompilerError(29 /* X_V_ELSE_NO_ADJACENT_IF */, vElse.loc));
- }
- }
- else if ((vFor = findDir(slotElement, 'for'))) {
- hasDynamicSlots = true;
- const parseResult = vFor.parseResult ||
- parseForExpression(vFor.exp, context);
- if (parseResult) {
- // Render the dynamic slots as an array and add it to the createSlot()
- // args. The runtime knows how to handle it appropriately.
- dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [
- parseResult.source,
- createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true /* force newline */)
- ]));
- }
- else {
- context.onError(createCompilerError(31 /* X_V_FOR_MALFORMED_EXPRESSION */, vFor.loc));
- }
- }
- else {
- // check duplicate static names
- if (staticSlotName) {
- if (seenSlotNames.has(staticSlotName)) {
- context.onError(createCompilerError(37 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */, dirLoc));
- continue;
- }
- seenSlotNames.add(staticSlotName);
- if (staticSlotName === 'default') {
- hasNamedDefaultSlot = true;
- }
- }
- slotsProperties.push(createObjectProperty(slotName, slotFunction));
- }
- }
- if (!onComponentSlot) {
- const buildDefaultSlotProperty = (props, children) => {
- const fn = buildSlotFn(props, children, loc);
- if (context.compatConfig) {
- fn.isNonScopedSlot = true;
- }
- return createObjectProperty(`default`, fn);
- };
- if (!hasTemplateSlots) {
- // implicit default slot (on component)
- slotsProperties.push(buildDefaultSlotProperty(undefined, children));
- }
- else if (implicitDefaultChildren.length &&
- // #3766
- // with whitespace: 'preserve', whitespaces between slots will end up in
- // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
- implicitDefaultChildren.some(node => isNonWhitespaceContent(node))) {
- // implicit default slot (mixed with named slots)
- if (hasNamedDefaultSlot) {
- context.onError(createCompilerError(38 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */, implicitDefaultChildren[0].loc));
- }
- else {
- slotsProperties.push(buildDefaultSlotProperty(undefined, implicitDefaultChildren));
- }
- }
- }
- const slotFlag = hasDynamicSlots
- ? 2 /* DYNAMIC */
- : hasForwardedSlots(node.children)
- ? 3 /* FORWARDED */
- : 1 /* STABLE */;
- let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`,
- // 2 = compiled but dynamic = can skip normalization, but must run diff
- // 1 = compiled and static = can skip normalization AND diff as optimized
- createSimpleExpression(slotFlag + ((process.env.NODE_ENV !== 'production') ? ` /* ${slotFlagsText[slotFlag]} */` : ``), false))), loc);
- if (dynamicSlots.length) {
- slots = createCallExpression(context.helper(CREATE_SLOTS), [
- slots,
- createArrayExpression(dynamicSlots)
- ]);
- }
- return {
- slots,
- hasDynamicSlots
- };
- }
- function buildDynamicSlot(name, fn) {
- return createObjectExpression([
- createObjectProperty(`name`, name),
- createObjectProperty(`fn`, fn)
- ]);
- }
- function hasForwardedSlots(children) {
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- switch (child.type) {
- case 1 /* ELEMENT */:
- if (child.tagType === 2 /* SLOT */ ||
- hasForwardedSlots(child.children)) {
- return true;
- }
- break;
- case 9 /* IF */:
- if (hasForwardedSlots(child.branches))
- return true;
- break;
- case 10 /* IF_BRANCH */:
- case 11 /* FOR */:
- if (hasForwardedSlots(child.children))
- return true;
- break;
- }
- }
- return false;
- }
- function isNonWhitespaceContent(node) {
- if (node.type !== 2 /* TEXT */ && node.type !== 12 /* TEXT_CALL */)
- return true;
- return node.type === 2 /* TEXT */
- ? !!node.content.trim()
- : isNonWhitespaceContent(node.content);
- }
- // some directive transforms (e.g. v-model) may return a symbol for runtime
- // import, which should be used instead of a resolveDirective call.
- const directiveImportMap = new WeakMap();
- // generate a JavaScript AST for this element's codegen
- const transformElement = (node, context) => {
- // perform the work on exit, after all child expressions have been
- // processed and merged.
- return function postTransformElement() {
- node = context.currentNode;
- if (!(node.type === 1 /* ELEMENT */ &&
- (node.tagType === 0 /* ELEMENT */ ||
- node.tagType === 1 /* COMPONENT */))) {
- return;
- }
- const { tag, props } = node;
- const isComponent = node.tagType === 1 /* COMPONENT */;
- // The goal of the transform is to create a codegenNode implementing the
- // VNodeCall interface.
- let vnodeTag = isComponent
- ? resolveComponentType(node, context)
- : `"${tag}"`;
- const isDynamicComponent = isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;
- let vnodeProps;
- let vnodeChildren;
- let vnodePatchFlag;
- let patchFlag = 0;
- let vnodeDynamicProps;
- let dynamicPropNames;
- let vnodeDirectives;
- let shouldUseBlock =
- // dynamic component may resolve to plain elements
- isDynamicComponent ||
- vnodeTag === TELEPORT ||
- vnodeTag === SUSPENSE ||
- (!isComponent &&
- // <svg> and <foreignObject> must be forced into blocks so that block
- // updates inside get proper isSVG flag at runtime. (#639, #643)
- // This is technically web-specific, but splitting the logic out of core
- // leads to too much unnecessary complexity.
- (tag === 'svg' ||
- tag === 'foreignObject' ||
- // #938: elements with dynamic keys should be forced into blocks
- findProp(node, 'key', true)));
- // props
- if (props.length > 0) {
- const propsBuildResult = buildProps(node, context);
- vnodeProps = propsBuildResult.props;
- patchFlag = propsBuildResult.patchFlag;
- dynamicPropNames = propsBuildResult.dynamicPropNames;
- const directives = propsBuildResult.directives;
- vnodeDirectives =
- directives && directives.length
- ? createArrayExpression(directives.map(dir => buildDirectiveArgs(dir, context)))
- : undefined;
- }
- // children
- if (node.children.length > 0) {
- if (vnodeTag === KEEP_ALIVE) {
- // Although a built-in component, we compile KeepAlive with raw children
- // instead of slot functions so that it can be used inside Transition
- // or other Transition-wrapping HOCs.
- // To ensure correct updates with block optimizations, we need to:
- // 1. Force keep-alive into a block. This avoids its children being
- // collected by a parent block.
- shouldUseBlock = true;
- // 2. Force keep-alive to always be updated, since it uses raw children.
- patchFlag |= 1024 /* DYNAMIC_SLOTS */;
- if ((process.env.NODE_ENV !== 'production') && node.children.length > 1) {
- context.onError(createCompilerError(44 /* X_KEEP_ALIVE_INVALID_CHILDREN */, {
- start: node.children[0].loc.start,
- end: node.children[node.children.length - 1].loc.end,
- source: ''
- }));
- }
- }
- const shouldBuildAsSlots = isComponent &&
- // Teleport is not a real component and has dedicated runtime handling
- vnodeTag !== TELEPORT &&
- // explained above.
- vnodeTag !== KEEP_ALIVE;
- if (shouldBuildAsSlots) {
- const { slots, hasDynamicSlots } = buildSlots(node, context);
- vnodeChildren = slots;
- if (hasDynamicSlots) {
- patchFlag |= 1024 /* DYNAMIC_SLOTS */;
- }
- }
- else if (node.children.length === 1 && vnodeTag !== TELEPORT) {
- const child = node.children[0];
- const type = child.type;
- // check for dynamic text children
- const hasDynamicTextChild = type === 5 /* INTERPOLATION */ ||
- type === 8 /* COMPOUND_EXPRESSION */;
- if (hasDynamicTextChild &&
- getConstantType(child, context) === 0 /* NOT_CONSTANT */) {
- patchFlag |= 1 /* TEXT */;
- }
- // pass directly if the only child is a text node
- // (plain / interpolation / expression)
- if (hasDynamicTextChild || type === 2 /* TEXT */) {
- vnodeChildren = child;
- }
- else {
- vnodeChildren = node.children;
- }
- }
- else {
- vnodeChildren = node.children;
- }
- }
- // patchFlag & dynamicPropNames
- if (patchFlag !== 0) {
- if ((process.env.NODE_ENV !== 'production')) {
- if (patchFlag < 0) {
- // special flags (negative and mutually exclusive)
- vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
- }
- else {
- // bitwise flags
- const flagNames = Object.keys(PatchFlagNames)
- .map(Number)
- .filter(n => n > 0 && patchFlag & n)
- .map(n => PatchFlagNames[n])
- .join(`, `);
- vnodePatchFlag = patchFlag + ` /* ${flagNames} */`;
- }
- }
- else {
- vnodePatchFlag = String(patchFlag);
- }
- if (dynamicPropNames && dynamicPropNames.length) {
- vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);
- }
- }
- node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, vnodePatchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false /* disableTracking */, isComponent, node.loc);
- };
- };
- function resolveComponentType(node, context, ssr = false) {
- let { tag } = node;
- // 1. dynamic component
- const isExplicitDynamic = isComponentTag(tag);
- const isProp = findProp(node, 'is');
- if (isProp) {
- if (isExplicitDynamic ||
- (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))) {
- const exp = isProp.type === 6 /* ATTRIBUTE */
- ? isProp.value && createSimpleExpression(isProp.value.content, true)
- : isProp.exp;
- if (exp) {
- return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
- exp
- ]);
- }
- }
- else if (isProp.type === 6 /* ATTRIBUTE */ &&
- isProp.value.content.startsWith('vue:')) {
- // <button is="vue:xxx">
- // if not <component>, only is value that starts with "vue:" will be
- // treated as component by the parse phase and reach here, unless it's
- // compat mode where all is values are considered components
- tag = isProp.value.content.slice(4);
- }
- }
- // 1.5 v-is (TODO: Deprecate)
- const isDir = !isExplicitDynamic && findDir(node, 'is');
- if (isDir && isDir.exp) {
- return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
- isDir.exp
- ]);
- }
- // 2. built-in components (Teleport, Transition, KeepAlive, Suspense...)
- const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);
- if (builtIn) {
- // built-ins are simply fallthroughs / have special handling during ssr
- // so we don't need to import their runtime equivalents
- if (!ssr)
- context.helper(builtIn);
- return builtIn;
- }
- // 5. user component (resolve)
- context.helper(RESOLVE_COMPONENT);
- context.components.add(tag);
- return toValidAssetId(tag, `component`);
- }
- function buildProps(node, context, props = node.props, ssr = false) {
- const { tag, loc: elementLoc } = node;
- const isComponent = node.tagType === 1 /* COMPONENT */;
- let properties = [];
- const mergeArgs = [];
- const runtimeDirectives = [];
- // patchFlag analysis
- let patchFlag = 0;
- let hasRef = false;
- let hasClassBinding = false;
- let hasStyleBinding = false;
- let hasHydrationEventBinding = false;
- let hasDynamicKeys = false;
- let hasVnodeHook = false;
- const dynamicPropNames = [];
- const analyzePatchFlag = ({ key, value }) => {
- if (isStaticExp(key)) {
- const name = key.content;
- const isEventHandler = isOn(name);
- if (!isComponent &&
- isEventHandler &&
- // omit the flag for click handlers because hydration gives click
- // dedicated fast path.
- name.toLowerCase() !== 'onclick' &&
- // omit v-model handlers
- name !== 'onUpdate:modelValue' &&
- // omit onVnodeXXX hooks
- !isReservedProp(name)) {
- hasHydrationEventBinding = true;
- }
- if (isEventHandler && isReservedProp(name)) {
- hasVnodeHook = true;
- }
- if (value.type === 20 /* JS_CACHE_EXPRESSION */ ||
- ((value.type === 4 /* SIMPLE_EXPRESSION */ ||
- value.type === 8 /* COMPOUND_EXPRESSION */) &&
- getConstantType(value, context) > 0)) {
- // skip if the prop is a cached handler or has constant value
- return;
- }
- if (name === 'ref') {
- hasRef = true;
- }
- else if (name === 'class') {
- hasClassBinding = true;
- }
- else if (name === 'style') {
- hasStyleBinding = true;
- }
- else if (name !== 'key' && !dynamicPropNames.includes(name)) {
- dynamicPropNames.push(name);
- }
- // treat the dynamic class and style binding of the component as dynamic props
- if (isComponent &&
- (name === 'class' || name === 'style') &&
- !dynamicPropNames.includes(name)) {
- dynamicPropNames.push(name);
- }
- }
- else {
- hasDynamicKeys = true;
- }
- };
- for (let i = 0; i < props.length; i++) {
- // static attribute
- const prop = props[i];
- if (prop.type === 6 /* ATTRIBUTE */) {
- const { loc, name, value } = prop;
- let isStatic = true;
- if (name === 'ref') {
- hasRef = true;
- }
- // skip is on <component>, or is="vue:xxx"
- if (name === 'is' &&
- (isComponentTag(tag) ||
- (value && value.content.startsWith('vue:')) ||
- (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context)))) {
- continue;
- }
- properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), createSimpleExpression(value ? value.content : '', isStatic, value ? value.loc : loc)));
- }
- else {
- // directives
- const { name, arg, exp, loc } = prop;
- const isVBind = name === 'bind';
- const isVOn = name === 'on';
- // skip v-slot - it is handled by its dedicated transform.
- if (name === 'slot') {
- if (!isComponent) {
- context.onError(createCompilerError(39 /* X_V_SLOT_MISPLACED */, loc));
- }
- continue;
- }
- // skip v-once/v-memo - they are handled by dedicated transforms.
- if (name === 'once' || name === 'memo') {
- continue;
- }
- // skip v-is and :is on <component>
- if (name === 'is' ||
- (isVBind &&
- isBindKey(arg, 'is') &&
- (isComponentTag(tag) ||
- (isCompatEnabled("COMPILER_IS_ON_ELEMENT" /* COMPILER_IS_ON_ELEMENT */, context))))) {
- continue;
- }
- // skip v-on in SSR compilation
- if (isVOn && ssr) {
- continue;
- }
- // special case for v-bind and v-on with no argument
- if (!arg && (isVBind || isVOn)) {
- hasDynamicKeys = true;
- if (exp) {
- if (properties.length) {
- mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
- properties = [];
- }
- if (isVBind) {
- {
- // 2.x v-bind object order compat
- if ((process.env.NODE_ENV !== 'production')) {
- const hasOverridableKeys = mergeArgs.some(arg => {
- if (arg.type === 15 /* JS_OBJECT_EXPRESSION */) {
- return arg.properties.some(({ key }) => {
- if (key.type !== 4 /* SIMPLE_EXPRESSION */ ||
- !key.isStatic) {
- return true;
- }
- return (key.content !== 'class' &&
- key.content !== 'style' &&
- !isOn(key.content));
- });
- }
- else {
- // dynamic expression
- return true;
- }
- });
- if (hasOverridableKeys) {
- checkCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */, context, loc);
- }
- }
- if (isCompatEnabled("COMPILER_V_BIND_OBJECT_ORDER" /* COMPILER_V_BIND_OBJECT_ORDER */, context)) {
- mergeArgs.unshift(exp);
- continue;
- }
- }
- mergeArgs.push(exp);
- }
- else {
- // v-on="obj" -> toHandlers(obj)
- mergeArgs.push({
- type: 14 /* JS_CALL_EXPRESSION */,
- loc,
- callee: context.helper(TO_HANDLERS),
- arguments: [exp]
- });
- }
- }
- else {
- context.onError(createCompilerError(isVBind
- ? 33 /* X_V_BIND_NO_EXPRESSION */
- : 34 /* X_V_ON_NO_EXPRESSION */, loc));
- }
- continue;
- }
- const directiveTransform = context.directiveTransforms[name];
- if (directiveTransform) {
- // has built-in directive transform.
- const { props, needRuntime } = directiveTransform(prop, node, context);
- !ssr && props.forEach(analyzePatchFlag);
- properties.push(...props);
- if (needRuntime) {
- runtimeDirectives.push(prop);
- if (isSymbol(needRuntime)) {
- directiveImportMap.set(prop, needRuntime);
- }
- }
- }
- else {
- // no built-in transform, this is a user custom directive.
- runtimeDirectives.push(prop);
- }
- }
- if (prop.type === 6 /* ATTRIBUTE */ &&
- prop.name === 'ref' &&
- context.scopes.vFor > 0 &&
- checkCompatEnabled("COMPILER_V_FOR_REF" /* COMPILER_V_FOR_REF */, context, prop.loc)) {
- properties.push(createObjectProperty(createSimpleExpression('refInFor', true), createSimpleExpression('true', false)));
- }
- }
- let propsExpression = undefined;
- // has v-bind="object" or v-on="object", wrap with mergeProps
- if (mergeArgs.length) {
- if (properties.length) {
- mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));
- }
- if (mergeArgs.length > 1) {
- propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);
- }
- else {
- // single v-bind with nothing else - no need for a mergeProps call
- propsExpression = mergeArgs[0];
- }
- }
- else if (properties.length) {
- propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);
- }
- // patchFlag analysis
- if (hasDynamicKeys) {
- patchFlag |= 16 /* FULL_PROPS */;
- }
- else {
- if (hasClassBinding && !isComponent) {
- patchFlag |= 2 /* CLASS */;
- }
- if (hasStyleBinding && !isComponent) {
- patchFlag |= 4 /* STYLE */;
- }
- if (dynamicPropNames.length) {
- patchFlag |= 8 /* PROPS */;
- }
- if (hasHydrationEventBinding) {
- patchFlag |= 32 /* HYDRATE_EVENTS */;
- }
- }
- if ((patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) &&
- (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {
- patchFlag |= 512 /* NEED_PATCH */;
- }
- // pre-normalize props, SSR is skipped for now
- if (!context.inSSR && propsExpression) {
- switch (propsExpression.type) {
- case 15 /* JS_OBJECT_EXPRESSION */:
- // means that there is no v-bind,
- // but still need to deal with dynamic key binding
- let classKeyIndex = -1;
- let styleKeyIndex = -1;
- let hasDynamicKey = false;
- for (let i = 0; i < propsExpression.properties.length; i++) {
- const key = propsExpression.properties[i].key;
- if (isStaticExp(key)) {
- if (key.content === 'class') {
- classKeyIndex = i;
- }
- else if (key.content === 'style') {
- styleKeyIndex = i;
- }
- }
- else if (!key.isHandlerKey) {
- hasDynamicKey = true;
- }
- }
- const classProp = propsExpression.properties[classKeyIndex];
- const styleProp = propsExpression.properties[styleKeyIndex];
- // no dynamic key
- if (!hasDynamicKey) {
- if (classProp && !isStaticExp(classProp.value)) {
- classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);
- }
- if (styleProp &&
- !isStaticExp(styleProp.value) &&
- // the static style is compiled into an object,
- // so use `hasStyleBinding` to ensure that it is a dynamic style binding
- (hasStyleBinding ||
- // v-bind:style and style both exist,
- // v-bind:style with static literal object
- styleProp.value.type === 17 /* JS_ARRAY_EXPRESSION */)) {
- styleProp.value = createCallExpression(context.helper(NORMALIZE_STYLE), [styleProp.value]);
- }
- }
- else {
- // dynamic key binding, wrap with `normalizeProps`
- propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);
- }
- break;
- case 14 /* JS_CALL_EXPRESSION */:
- // mergeProps call, do nothing
- break;
- default:
- // single v-bind
- propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [
- createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [
- propsExpression
- ])
- ]);
- break;
- }
- }
- return {
- props: propsExpression,
- directives: runtimeDirectives,
- patchFlag,
- dynamicPropNames
- };
- }
- // Dedupe props in an object literal.
- // Literal duplicated attributes would have been warned during the parse phase,
- // however, it's possible to encounter duplicated `onXXX` handlers with different
- // modifiers. We also need to merge static and dynamic class / style attributes.
- // - onXXX handlers / style: merge into array
- // - class: merge into single expression with concatenation
- function dedupeProperties(properties) {
- const knownProps = new Map();
- const deduped = [];
- for (let i = 0; i < properties.length; i++) {
- const prop = properties[i];
- // dynamic keys are always allowed
- if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {
- deduped.push(prop);
- continue;
- }
- const name = prop.key.content;
- const existing = knownProps.get(name);
- if (existing) {
- if (name === 'style' || name === 'class' || name.startsWith('on')) {
- mergeAsArray(existing, prop);
- }
- // unexpected duplicate, should have emitted error during parse
- }
- else {
- knownProps.set(name, prop);
- deduped.push(prop);
- }
- }
- return deduped;
- }
- function mergeAsArray(existing, incoming) {
- if (existing.value.type === 17 /* JS_ARRAY_EXPRESSION */) {
- existing.value.elements.push(incoming.value);
- }
- else {
- existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);
- }
- }
- function buildDirectiveArgs(dir, context) {
- const dirArgs = [];
- const runtime = directiveImportMap.get(dir);
- if (runtime) {
- // built-in directive with runtime
- dirArgs.push(context.helperString(runtime));
- }
- else {
- {
- // inject statement for resolving directive
- context.helper(RESOLVE_DIRECTIVE);
- context.directives.add(dir.name);
- dirArgs.push(toValidAssetId(dir.name, `directive`));
- }
- }
- const { loc } = dir;
- if (dir.exp)
- dirArgs.push(dir.exp);
- if (dir.arg) {
- if (!dir.exp) {
- dirArgs.push(`void 0`);
- }
- dirArgs.push(dir.arg);
- }
- if (Object.keys(dir.modifiers).length) {
- if (!dir.arg) {
- if (!dir.exp) {
- dirArgs.push(`void 0`);
- }
- dirArgs.push(`void 0`);
- }
- const trueExpression = createSimpleExpression(`true`, false, loc);
- dirArgs.push(createObjectExpression(dir.modifiers.map(modifier => createObjectProperty(modifier, trueExpression)), loc));
- }
- return createArrayExpression(dirArgs, dir.loc);
- }
- function stringifyDynamicPropNames(props) {
- let propsNamesString = `[`;
- for (let i = 0, l = props.length; i < l; i++) {
- propsNamesString += JSON.stringify(props[i]);
- if (i < l - 1)
- propsNamesString += ', ';
- }
- return propsNamesString + `]`;
- }
- function isComponentTag(tag) {
- return tag[0].toLowerCase() + tag.slice(1) === 'component';
- }
- (process.env.NODE_ENV !== 'production')
- ? Object.freeze({})
- : {};
- (process.env.NODE_ENV !== 'production') ? Object.freeze([]) : [];
- const cacheStringFunction = (fn) => {
- const cache = Object.create(null);
- return ((str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- });
- };
- const camelizeRE = /-(\w)/g;
- /**
- * @private
- */
- const camelize = cacheStringFunction((str) => {
- return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));
- });
- const transformSlotOutlet = (node, context) => {
- if (isSlotOutlet(node)) {
- const { children, loc } = node;
- const { slotName, slotProps } = processSlotOutlet(node, context);
- const slotArgs = [
- context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,
- slotName
- ];
- if (slotProps) {
- slotArgs.push(slotProps);
- }
- if (children.length) {
- if (!slotProps) {
- slotArgs.push(`{}`);
- }
- slotArgs.push(createFunctionExpression([], children, false, false, loc));
- }
- if (context.scopeId && !context.slotted) {
- if (!slotProps) {
- slotArgs.push(`{}`);
- }
- if (!children.length) {
- slotArgs.push(`undefined`);
- }
- slotArgs.push(`true`);
- }
- node.codegenNode = createCallExpression(context.helper(RENDER_SLOT), slotArgs, loc);
- }
- };
- function processSlotOutlet(node, context) {
- let slotName = `"default"`;
- let slotProps = undefined;
- const nonNameProps = [];
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 6 /* ATTRIBUTE */) {
- if (p.value) {
- if (p.name === 'name') {
- slotName = JSON.stringify(p.value.content);
- }
- else {
- p.name = camelize(p.name);
- nonNameProps.push(p);
- }
- }
- }
- else {
- if (p.name === 'bind' && isBindKey(p.arg, 'name')) {
- if (p.exp)
- slotName = p.exp;
- }
- else {
- if (p.name === 'bind' && p.arg && isStaticExp(p.arg)) {
- p.arg.content = camelize(p.arg.content);
- }
- nonNameProps.push(p);
- }
- }
- }
- if (nonNameProps.length > 0) {
- const { props, directives } = buildProps(node, context, nonNameProps);
- slotProps = props;
- if (directives.length) {
- context.onError(createCompilerError(35 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
- }
- }
- return {
- slotName,
- slotProps
- };
- }
- const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^\s*function(?:\s+[\w$]+)?\s*\(/;
- const transformOn = (dir, node, context, augmentor) => {
- const { loc, modifiers, arg } = dir;
- if (!dir.exp && !modifiers.length) {
- context.onError(createCompilerError(34 /* X_V_ON_NO_EXPRESSION */, loc));
- }
- let eventName;
- if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
- if (arg.isStatic) {
- const rawName = arg.content;
- // for all event listeners, auto convert it to camelCase. See issue #2249
- eventName = createSimpleExpression(toHandlerKey(camelize$1(rawName)), true, arg.loc);
- }
- else {
- // #2388
- eventName = createCompoundExpression([
- `${context.helperString(TO_HANDLER_KEY)}(`,
- arg,
- `)`
- ]);
- }
- }
- else {
- // already a compound expression.
- eventName = arg;
- eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);
- eventName.children.push(`)`);
- }
- // handler processing
- let exp = dir.exp;
- if (exp && !exp.content.trim()) {
- exp = undefined;
- }
- let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
- if (exp) {
- const isMemberExp = isMemberExpression(exp.content);
- const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
- const hasMultipleStatements = exp.content.includes(`;`);
- if ((process.env.NODE_ENV !== 'production') && true) {
- validateBrowserExpression(exp, context, false, hasMultipleStatements);
- }
- if (isInlineStatement || (shouldCache && isMemberExp)) {
- // wrap inline statement in a function expression
- exp = createCompoundExpression([
- `${isInlineStatement
- ? `$event`
- : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,
- exp,
- hasMultipleStatements ? `}` : `)`
- ]);
- }
- }
- let ret = {
- props: [
- createObjectProperty(eventName, exp || createSimpleExpression(`() => {}`, false, loc))
- ]
- };
- // apply extended compiler augmentor
- if (augmentor) {
- ret = augmentor(ret);
- }
- if (shouldCache) {
- // cache handlers so that it's always the same handler being passed down.
- // this avoids unnecessary re-renders when users use inline handlers on
- // components.
- ret.props[0].value = context.cache(ret.props[0].value);
- }
- // mark the key as handler for props normalization check
- ret.props.forEach(p => (p.key.isHandlerKey = true));
- return ret;
- };
- // v-bind without arg is handled directly in ./transformElements.ts due to it affecting
- // codegen for the entire props object. This transform here is only for v-bind
- // *with* args.
- const transformBind = (dir, _node, context) => {
- const { exp, modifiers, loc } = dir;
- const arg = dir.arg;
- if (arg.type !== 4 /* SIMPLE_EXPRESSION */) {
- arg.children.unshift(`(`);
- arg.children.push(`) || ""`);
- }
- else if (!arg.isStatic) {
- arg.content = `${arg.content} || ""`;
- }
- // .sync is replaced by v-model:arg
- if (modifiers.includes('camel')) {
- if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
- if (arg.isStatic) {
- arg.content = camelize$1(arg.content);
- }
- else {
- arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;
- }
- }
- else {
- arg.children.unshift(`${context.helperString(CAMELIZE)}(`);
- arg.children.push(`)`);
- }
- }
- if (!context.inSSR) {
- if (modifiers.includes('prop')) {
- injectPrefix(arg, '.');
- }
- if (modifiers.includes('attr')) {
- injectPrefix(arg, '^');
- }
- }
- if (!exp ||
- (exp.type === 4 /* SIMPLE_EXPRESSION */ && !exp.content.trim())) {
- context.onError(createCompilerError(33 /* X_V_BIND_NO_EXPRESSION */, loc));
- return {
- props: [createObjectProperty(arg, createSimpleExpression('', true, loc))]
- };
- }
- return {
- props: [createObjectProperty(arg, exp)]
- };
- };
- const injectPrefix = (arg, prefix) => {
- if (arg.type === 4 /* SIMPLE_EXPRESSION */) {
- if (arg.isStatic) {
- arg.content = prefix + arg.content;
- }
- else {
- arg.content = `\`${prefix}\${${arg.content}}\``;
- }
- }
- else {
- arg.children.unshift(`'${prefix}' + (`);
- arg.children.push(`)`);
- }
- };
- // Merge adjacent text nodes and expressions into a single expression
- // e.g. <div>abc {{ d }} {{ e }}</div> should have a single expression node as child.
- const transformText = (node, context) => {
- if (node.type === 0 /* ROOT */ ||
- node.type === 1 /* ELEMENT */ ||
- node.type === 11 /* FOR */ ||
- node.type === 10 /* IF_BRANCH */) {
- // perform the transform on node exit so that all expressions have already
- // been processed.
- return () => {
- const children = node.children;
- let currentContainer = undefined;
- let hasText = false;
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- if (isText(child)) {
- hasText = true;
- for (let j = i + 1; j < children.length; j++) {
- const next = children[j];
- if (isText(next)) {
- if (!currentContainer) {
- currentContainer = children[i] = {
- type: 8 /* COMPOUND_EXPRESSION */,
- loc: child.loc,
- children: [child]
- };
- }
- // merge adjacent text node into current
- currentContainer.children.push(` + `, next);
- children.splice(j, 1);
- j--;
- }
- else {
- currentContainer = undefined;
- break;
- }
- }
- }
- }
- if (!hasText ||
- // if this is a plain element with a single text child, leave it
- // as-is since the runtime has dedicated fast path for this by directly
- // setting textContent of the element.
- // for component root it's always normalized anyway.
- (children.length === 1 &&
- (node.type === 0 /* ROOT */ ||
- (node.type === 1 /* ELEMENT */ &&
- node.tagType === 0 /* ELEMENT */ &&
- // #3756
- // custom directives can potentially add DOM elements arbitrarily,
- // we need to avoid setting textContent of the element at runtime
- // to avoid accidentally overwriting the DOM elements added
- // by the user through custom directives.
- !node.props.find(p => p.type === 7 /* DIRECTIVE */ &&
- !context.directiveTransforms[p.name]) &&
- // in compat mode, <template> tags with no special directives
- // will be rendered as a fragment so its children must be
- // converted into vnodes.
- !(node.tag === 'template'))))) {
- return;
- }
- // pre-convert text nodes into createTextVNode(text) calls to avoid
- // runtime normalization.
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- if (isText(child) || child.type === 8 /* COMPOUND_EXPRESSION */) {
- const callArgs = [];
- // createTextVNode defaults to single whitespace, so if it is a
- // single space the code could be an empty call to save bytes.
- if (child.type !== 2 /* TEXT */ || child.content !== ' ') {
- callArgs.push(child);
- }
- // mark dynamic text with flag so it gets patched inside a block
- if (!context.ssr &&
- getConstantType(child, context) === 0 /* NOT_CONSTANT */) {
- callArgs.push(1 /* TEXT */ +
- ((process.env.NODE_ENV !== 'production') ? ` /* ${PatchFlagNames[1 /* TEXT */]} */` : ``));
- }
- children[i] = {
- type: 12 /* TEXT_CALL */,
- content: child,
- loc: child.loc,
- codegenNode: createCallExpression(context.helper(CREATE_TEXT), callArgs)
- };
- }
- }
- };
- }
- };
- const seen = new WeakSet();
- const transformOnce = (node, context) => {
- if (node.type === 1 /* ELEMENT */ && findDir(node, 'once', true)) {
- if (seen.has(node) || context.inVOnce) {
- return;
- }
- seen.add(node);
- context.inVOnce = true;
- context.helper(SET_BLOCK_TRACKING);
- return () => {
- context.inVOnce = false;
- const cur = context.currentNode;
- if (cur.codegenNode) {
- cur.codegenNode = context.cache(cur.codegenNode, true /* isVNode */);
- }
- };
- }
- };
- const transformModel = (dir, node, context) => {
- const { exp, arg } = dir;
- if (!exp) {
- context.onError(createCompilerError(40 /* X_V_MODEL_NO_EXPRESSION */, dir.loc));
- return createTransformProps();
- }
- const rawExp = exp.loc.source;
- const expString = exp.type === 4 /* SIMPLE_EXPRESSION */ ? exp.content : rawExp;
- const maybeRef = !true /* SETUP_CONST */;
- if (!expString.trim() || (!isMemberExpression(expString) && !maybeRef)) {
- context.onError(createCompilerError(41 /* X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));
- return createTransformProps();
- }
- const propName = arg ? arg : createSimpleExpression('modelValue', true);
- const eventName = arg
- ? isStaticExp(arg)
- ? `onUpdate:${arg.content}`
- : createCompoundExpression(['"onUpdate:" + ', arg])
- : `onUpdate:modelValue`;
- let assignmentExp;
- const eventArg = context.isTS ? `($event: any)` : `$event`;
- {
- assignmentExp = createCompoundExpression([
- `${eventArg} => (`,
- exp,
- ` = $event)`
- ]);
- }
- const props = [
- // modelValue: foo
- createObjectProperty(propName, dir.exp),
- // "onUpdate:modelValue": $event => (foo = $event)
- createObjectProperty(eventName, assignmentExp)
- ];
- // modelModifiers: { foo: true, "bar-baz": true }
- if (dir.modifiers.length && node.tagType === 1 /* COMPONENT */) {
- const modifiers = dir.modifiers
- .map(m => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`)
- .join(`, `);
- const modifiersKey = arg
- ? isStaticExp(arg)
- ? `${arg.content}Modifiers`
- : createCompoundExpression([arg, ' + "Modifiers"'])
- : `modelModifiers`;
- props.push(createObjectProperty(modifiersKey, createSimpleExpression(`{ ${modifiers} }`, false, dir.loc, 2 /* CAN_HOIST */)));
- }
- return createTransformProps(props);
- };
- function createTransformProps(props = []) {
- return { props };
- }
- const validDivisionCharRE = /[\w).+\-_$\]]/;
- const transformFilter = (node, context) => {
- if (!isCompatEnabled("COMPILER_FILTER" /* COMPILER_FILTERS */, context)) {
- return;
- }
- if (node.type === 5 /* INTERPOLATION */) {
- // filter rewrite is applied before expression transform so only
- // simple expressions are possible at this stage
- rewriteFilter(node.content, context);
- }
- if (node.type === 1 /* ELEMENT */) {
- node.props.forEach((prop) => {
- if (prop.type === 7 /* DIRECTIVE */ &&
- prop.name !== 'for' &&
- prop.exp) {
- rewriteFilter(prop.exp, context);
- }
- });
- }
- };
- function rewriteFilter(node, context) {
- if (node.type === 4 /* SIMPLE_EXPRESSION */) {
- parseFilter(node, context);
- }
- else {
- for (let i = 0; i < node.children.length; i++) {
- const child = node.children[i];
- if (typeof child !== 'object')
- continue;
- if (child.type === 4 /* SIMPLE_EXPRESSION */) {
- parseFilter(child, context);
- }
- else if (child.type === 8 /* COMPOUND_EXPRESSION */) {
- rewriteFilter(node, context);
- }
- else if (child.type === 5 /* INTERPOLATION */) {
- rewriteFilter(child.content, context);
- }
- }
- }
- }
- function parseFilter(node, context) {
- const exp = node.content;
- let inSingle = false;
- let inDouble = false;
- let inTemplateString = false;
- let inRegex = false;
- let curly = 0;
- let square = 0;
- let paren = 0;
- let lastFilterIndex = 0;
- let c, prev, i, expression, filters = [];
- for (i = 0; i < exp.length; i++) {
- prev = c;
- c = exp.charCodeAt(i);
- if (inSingle) {
- if (c === 0x27 && prev !== 0x5c)
- inSingle = false;
- }
- else if (inDouble) {
- if (c === 0x22 && prev !== 0x5c)
- inDouble = false;
- }
- else if (inTemplateString) {
- if (c === 0x60 && prev !== 0x5c)
- inTemplateString = false;
- }
- else if (inRegex) {
- if (c === 0x2f && prev !== 0x5c)
- inRegex = false;
- }
- else if (c === 0x7c && // pipe
- exp.charCodeAt(i + 1) !== 0x7c &&
- exp.charCodeAt(i - 1) !== 0x7c &&
- !curly &&
- !square &&
- !paren) {
- if (expression === undefined) {
- // first filter, end of expression
- lastFilterIndex = i + 1;
- expression = exp.slice(0, i).trim();
- }
- else {
- pushFilter();
- }
- }
- else {
- switch (c) {
- case 0x22:
- inDouble = true;
- break; // "
- case 0x27:
- inSingle = true;
- break; // '
- case 0x60:
- inTemplateString = true;
- break; // `
- case 0x28:
- paren++;
- break; // (
- case 0x29:
- paren--;
- break; // )
- case 0x5b:
- square++;
- break; // [
- case 0x5d:
- square--;
- break; // ]
- case 0x7b:
- curly++;
- break; // {
- case 0x7d:
- curly--;
- break; // }
- }
- if (c === 0x2f) {
- // /
- let j = i - 1;
- let p;
- // find first non-whitespace prev char
- for (; j >= 0; j--) {
- p = exp.charAt(j);
- if (p !== ' ')
- break;
- }
- if (!p || !validDivisionCharRE.test(p)) {
- inRegex = true;
- }
- }
- }
- }
- if (expression === undefined) {
- expression = exp.slice(0, i).trim();
- }
- else if (lastFilterIndex !== 0) {
- pushFilter();
- }
- function pushFilter() {
- filters.push(exp.slice(lastFilterIndex, i).trim());
- lastFilterIndex = i + 1;
- }
- if (filters.length) {
- (process.env.NODE_ENV !== 'production') &&
- warnDeprecation("COMPILER_FILTER" /* COMPILER_FILTERS */, context, node.loc);
- for (i = 0; i < filters.length; i++) {
- expression = wrapFilter(expression, filters[i], context);
- }
- node.content = expression;
- }
- }
- function wrapFilter(exp, filter, context) {
- context.helper(RESOLVE_FILTER);
- const i = filter.indexOf('(');
- if (i < 0) {
- context.filters.add(filter);
- return `${toValidAssetId(filter, 'filter')}(${exp})`;
- }
- else {
- const name = filter.slice(0, i);
- const args = filter.slice(i + 1);
- context.filters.add(name);
- return `${toValidAssetId(name, 'filter')}(${exp}${args !== ')' ? ',' + args : args}`;
- }
- }
- const seen$1 = new WeakSet();
- const transformMemo = (node, context) => {
- if (node.type === 1 /* ELEMENT */) {
- const dir = findDir(node, 'memo');
- if (!dir || seen$1.has(node)) {
- return;
- }
- seen$1.add(node);
- return () => {
- const codegenNode = node.codegenNode ||
- context.currentNode.codegenNode;
- if (codegenNode && codegenNode.type === 13 /* VNODE_CALL */) {
- // non-component sub tree should be turned into a block
- if (node.tagType !== 1 /* COMPONENT */) {
- makeBlock(codegenNode, context);
- }
- node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [
- dir.exp,
- createFunctionExpression(undefined, codegenNode),
- `_cache`,
- String(context.cached++)
- ]);
- }
- };
- }
- };
- function getBaseTransformPreset(prefixIdentifiers) {
- return [
- [
- transformOnce,
- transformIf,
- transformMemo,
- transformFor,
- ...([transformFilter] ),
- ...((process.env.NODE_ENV !== 'production')
- ? [transformExpression]
- : []),
- transformSlotOutlet,
- transformElement,
- trackSlotScopes,
- transformText
- ],
- {
- on: transformOn,
- bind: transformBind,
- model: transformModel
- }
- ];
- }
- // we name it `baseCompile` so that higher order compilers like
- // @vue/compiler-dom can export `compile` while re-exporting everything else.
- function baseCompile(template, options = {}) {
- const onError = options.onError || defaultOnError;
- const isModuleMode = options.mode === 'module';
- /* istanbul ignore if */
- {
- if (options.prefixIdentifiers === true) {
- onError(createCompilerError(45 /* X_PREFIX_ID_NOT_SUPPORTED */));
- }
- else if (isModuleMode) {
- onError(createCompilerError(46 /* X_MODULE_MODE_NOT_SUPPORTED */));
- }
- }
- const prefixIdentifiers = !true ;
- if (options.cacheHandlers) {
- onError(createCompilerError(47 /* X_CACHE_HANDLER_NOT_SUPPORTED */));
- }
- if (options.scopeId && !isModuleMode) {
- onError(createCompilerError(48 /* X_SCOPE_ID_NOT_SUPPORTED */));
- }
- const ast = isString(template) ? baseParse(template, options) : template;
- const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
- transform(ast, extend({}, options, {
- prefixIdentifiers,
- nodeTransforms: [
- ...nodeTransforms,
- ...(options.nodeTransforms || []) // user transforms
- ],
- directiveTransforms: extend({}, directiveTransforms, options.directiveTransforms || {} // user transforms
- )
- }));
- return generate(ast, extend({}, options, {
- prefixIdentifiers
- }));
- }
- const noopDirectiveTransform = () => ({ props: [] });
- var compilerCore_esmBundler = {
- __proto__: null,
- BASE_TRANSITION: BASE_TRANSITION,
- CAMELIZE: CAMELIZE,
- CAPITALIZE: CAPITALIZE,
- CREATE_BLOCK: CREATE_BLOCK,
- CREATE_COMMENT: CREATE_COMMENT,
- CREATE_ELEMENT_BLOCK: CREATE_ELEMENT_BLOCK,
- CREATE_ELEMENT_VNODE: CREATE_ELEMENT_VNODE,
- CREATE_SLOTS: CREATE_SLOTS,
- CREATE_STATIC: CREATE_STATIC,
- CREATE_TEXT: CREATE_TEXT,
- CREATE_VNODE: CREATE_VNODE,
- FRAGMENT: FRAGMENT,
- GUARD_REACTIVE_PROPS: GUARD_REACTIVE_PROPS,
- IS_MEMO_SAME: IS_MEMO_SAME,
- IS_REF: IS_REF,
- KEEP_ALIVE: KEEP_ALIVE,
- MERGE_PROPS: MERGE_PROPS,
- NORMALIZE_CLASS: NORMALIZE_CLASS,
- NORMALIZE_PROPS: NORMALIZE_PROPS,
- NORMALIZE_STYLE: NORMALIZE_STYLE,
- OPEN_BLOCK: OPEN_BLOCK,
- POP_SCOPE_ID: POP_SCOPE_ID,
- PUSH_SCOPE_ID: PUSH_SCOPE_ID,
- RENDER_LIST: RENDER_LIST,
- RENDER_SLOT: RENDER_SLOT,
- RESOLVE_COMPONENT: RESOLVE_COMPONENT,
- RESOLVE_DIRECTIVE: RESOLVE_DIRECTIVE,
- RESOLVE_DYNAMIC_COMPONENT: RESOLVE_DYNAMIC_COMPONENT,
- RESOLVE_FILTER: RESOLVE_FILTER,
- SET_BLOCK_TRACKING: SET_BLOCK_TRACKING,
- SUSPENSE: SUSPENSE,
- TELEPORT: TELEPORT,
- TO_DISPLAY_STRING: TO_DISPLAY_STRING,
- TO_HANDLERS: TO_HANDLERS,
- TO_HANDLER_KEY: TO_HANDLER_KEY,
- UNREF: UNREF,
- WITH_CTX: WITH_CTX,
- WITH_DIRECTIVES: WITH_DIRECTIVES,
- WITH_MEMO: WITH_MEMO,
- WITH_SCOPE_ID: WITH_SCOPE_ID,
- advancePositionWithClone: advancePositionWithClone,
- advancePositionWithMutation: advancePositionWithMutation,
- assert: assert,
- baseCompile: baseCompile,
- baseParse: baseParse,
- buildProps: buildProps,
- buildSlots: buildSlots,
- checkCompatEnabled: checkCompatEnabled,
- createArrayExpression: createArrayExpression,
- createAssignmentExpression: createAssignmentExpression,
- createBlockStatement: createBlockStatement,
- createCacheExpression: createCacheExpression,
- createCallExpression: createCallExpression,
- createCompilerError: createCompilerError,
- createCompoundExpression: createCompoundExpression,
- createConditionalExpression: createConditionalExpression,
- createForLoopParams: createForLoopParams,
- createFunctionExpression: createFunctionExpression,
- createIfStatement: createIfStatement,
- createInterpolation: createInterpolation,
- createObjectExpression: createObjectExpression,
- createObjectProperty: createObjectProperty,
- createReturnStatement: createReturnStatement,
- createRoot: createRoot,
- createSequenceExpression: createSequenceExpression,
- createSimpleExpression: createSimpleExpression,
- createStructuralDirectiveTransform: createStructuralDirectiveTransform,
- createTemplateLiteral: createTemplateLiteral,
- createTransformContext: createTransformContext,
- createVNodeCall: createVNodeCall,
- extractIdentifiers: extractIdentifiers,
- findDir: findDir,
- findProp: findProp,
- generate: generate,
- getBaseTransformPreset: getBaseTransformPreset,
- getInnerRange: getInnerRange,
- getMemoedVNodeCall: getMemoedVNodeCall,
- getVNodeBlockHelper: getVNodeBlockHelper,
- getVNodeHelper: getVNodeHelper,
- hasDynamicKeyVBind: hasDynamicKeyVBind,
- hasScopeRef: hasScopeRef,
- helperNameMap: helperNameMap,
- injectProp: injectProp,
- isBindKey: isBindKey,
- isBuiltInType: isBuiltInType,
- isCoreComponent: isCoreComponent,
- isFunctionType: isFunctionType,
- isInDestructureAssignment: isInDestructureAssignment,
- isMemberExpression: isMemberExpression,
- isReferencedIdentifier: isReferencedIdentifier,
- isSimpleIdentifier: isSimpleIdentifier,
- isSlotOutlet: isSlotOutlet,
- isStaticExp: isStaticExp,
- isStaticProperty: isStaticProperty,
- isStaticPropertyKey: isStaticPropertyKey,
- isTemplateNode: isTemplateNode,
- isText: isText,
- isVSlot: isVSlot,
- locStub: locStub,
- makeBlock: makeBlock,
- noopDirectiveTransform: noopDirectiveTransform,
- processExpression: processExpression,
- processFor: processFor,
- processIf: processIf,
- processSlotOutlet: processSlotOutlet,
- registerRuntimeHelpers: registerRuntimeHelpers,
- resolveComponentType: resolveComponentType,
- toValidAssetId: toValidAssetId,
- trackSlotScopes: trackSlotScopes,
- trackVForSlotScopes: trackVForSlotScopes,
- transform: transform,
- transformBind: transformBind,
- transformElement: transformElement,
- transformExpression: transformExpression,
- transformModel: transformModel,
- transformOn: transformOn,
- traverseNode: traverseNode,
- walkBlockDeclarations: walkBlockDeclarations,
- walkFunctionParams: walkFunctionParams,
- walkIdentifiers: walkIdentifiers,
- warnDeprecation: warnDeprecation,
- generateCodeFrame: generateCodeFrame
- };
- var require$$0 = /*@__PURE__*/build.getAugmentedNamespace(compilerCore_esmBundler);
- var require$$1 = /*@__PURE__*/build.getAugmentedNamespace(shared_esmBundler);
- (function (exports) {
- Object.defineProperty(exports, '__esModule', { value: true });
- var compilerCore = require$$0;
- var shared = require$$1;
- const V_MODEL_RADIO = Symbol(`vModelRadio` );
- const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
- const V_MODEL_TEXT = Symbol(`vModelText` );
- const V_MODEL_SELECT = Symbol(`vModelSelect` );
- const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
- const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
- const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
- const V_SHOW = Symbol(`vShow` );
- const TRANSITION = Symbol(`Transition` );
- const TRANSITION_GROUP = Symbol(`TransitionGroup` );
- compilerCore.registerRuntimeHelpers({
- [V_MODEL_RADIO]: `vModelRadio`,
- [V_MODEL_CHECKBOX]: `vModelCheckbox`,
- [V_MODEL_TEXT]: `vModelText`,
- [V_MODEL_SELECT]: `vModelSelect`,
- [V_MODEL_DYNAMIC]: `vModelDynamic`,
- [V_ON_WITH_MODIFIERS]: `withModifiers`,
- [V_ON_WITH_KEYS]: `withKeys`,
- [V_SHOW]: `vShow`,
- [TRANSITION]: `Transition`,
- [TRANSITION_GROUP]: `TransitionGroup`
- });
- var namedCharacterReferences = {
- GT: ">",
- gt: ">",
- LT: "<",
- lt: "<",
- "ac;": "∾",
- "af;": "",
- AMP: "&",
- amp: "&",
- "ap;": "≈",
- "DD;": "ⅅ",
- "dd;": "ⅆ",
- deg: "°",
- "ee;": "ⅇ",
- "eg;": "⪚",
- "el;": "⪙",
- ETH: "Ð",
- eth: "ð",
- "gE;": "≧",
- "ge;": "≥",
- "Gg;": "⋙",
- "gg;": "≫",
- "gl;": "≷",
- "GT;": ">",
- "Gt;": "≫",
- "gt;": ">",
- "ic;": "",
- "ii;": "ⅈ",
- "Im;": "ℑ",
- "in;": "∈",
- "it;": "",
- "lE;": "≦",
- "le;": "≤",
- "lg;": "≶",
- "Ll;": "⋘",
- "ll;": "≪",
- "LT;": "<",
- "Lt;": "≪",
- "lt;": "<",
- "mp;": "∓",
- "Mu;": "Μ",
- "mu;": "μ",
- "ne;": "≠",
- "ni;": "∋",
- not: "¬",
- "Nu;": "Ν",
- "nu;": "ν",
- "Or;": "⩔",
- "or;": "∨",
- "oS;": "Ⓢ",
- "Pi;": "Π",
- "pi;": "π",
- "pm;": "±",
- "Pr;": "⪻",
- "pr;": "≺",
- "Re;": "ℜ",
- REG: "®",
- reg: "®",
- "rx;": "℞",
- "Sc;": "⪼",
- "sc;": "≻",
- shy: "",
- uml: "¨",
- "wp;": "℘",
- "wr;": "≀",
- "Xi;": "Ξ",
- "xi;": "ξ",
- yen: "¥",
- "acd;": "∿",
- "acE;": "∾̳",
- "Acy;": "А",
- "acy;": "а",
- "Afr;": "𝔄",
- "afr;": "𝔞",
- "AMP;": "&",
- "amp;": "&",
- "And;": "⩓",
- "and;": "∧",
- "ang;": "∠",
- "apE;": "⩰",
- "ape;": "≊",
- "ast;": "*",
- Auml: "Ä",
- auml: "ä",
- "Bcy;": "Б",
- "bcy;": "б",
- "Bfr;": "𝔅",
- "bfr;": "𝔟",
- "bne;": "=⃥",
- "bot;": "⊥",
- "Cap;": "⋒",
- "cap;": "∩",
- cent: "¢",
- "Cfr;": "ℭ",
- "cfr;": "𝔠",
- "Chi;": "Χ",
- "chi;": "χ",
- "cir;": "○",
- COPY: "©",
- copy: "©",
- "Cup;": "⋓",
- "cup;": "∪",
- "Dcy;": "Д",
- "dcy;": "д",
- "deg;": "°",
- "Del;": "∇",
- "Dfr;": "𝔇",
- "dfr;": "𝔡",
- "die;": "¨",
- "div;": "÷",
- "Dot;": "¨",
- "dot;": "˙",
- "Ecy;": "Э",
- "ecy;": "э",
- "Efr;": "𝔈",
- "efr;": "𝔢",
- "egs;": "⪖",
- "ell;": "ℓ",
- "els;": "⪕",
- "ENG;": "Ŋ",
- "eng;": "ŋ",
- "Eta;": "Η",
- "eta;": "η",
- "ETH;": "Ð",
- "eth;": "ð",
- Euml: "Ë",
- euml: "ë",
- "Fcy;": "Ф",
- "fcy;": "ф",
- "Ffr;": "𝔉",
- "ffr;": "𝔣",
- "gap;": "⪆",
- "Gcy;": "Г",
- "gcy;": "г",
- "gEl;": "⪌",
- "gel;": "⋛",
- "geq;": "≥",
- "ges;": "⩾",
- "Gfr;": "𝔊",
- "gfr;": "𝔤",
- "ggg;": "⋙",
- "gla;": "⪥",
- "glE;": "⪒",
- "glj;": "⪤",
- "gnE;": "≩",
- "gne;": "⪈",
- "Hat;": "^",
- "Hfr;": "ℌ",
- "hfr;": "𝔥",
- "Icy;": "И",
- "icy;": "и",
- "iff;": "⇔",
- "Ifr;": "ℑ",
- "ifr;": "𝔦",
- "Int;": "∬",
- "int;": "∫",
- Iuml: "Ï",
- iuml: "ï",
- "Jcy;": "Й",
- "jcy;": "й",
- "Jfr;": "𝔍",
- "jfr;": "𝔧",
- "Kcy;": "К",
- "kcy;": "к",
- "Kfr;": "𝔎",
- "kfr;": "𝔨",
- "lap;": "⪅",
- "lat;": "⪫",
- "Lcy;": "Л",
- "lcy;": "л",
- "lEg;": "⪋",
- "leg;": "⋚",
- "leq;": "≤",
- "les;": "⩽",
- "Lfr;": "𝔏",
- "lfr;": "𝔩",
- "lgE;": "⪑",
- "lnE;": "≨",
- "lne;": "⪇",
- "loz;": "◊",
- "lrm;": "",
- "Lsh;": "↰",
- "lsh;": "↰",
- macr: "¯",
- "Map;": "⤅",
- "map;": "↦",
- "Mcy;": "М",
- "mcy;": "м",
- "Mfr;": "𝔐",
- "mfr;": "𝔪",
- "mho;": "℧",
- "mid;": "∣",
- "nap;": "≉",
- nbsp: " ",
- "Ncy;": "Н",
- "ncy;": "н",
- "Nfr;": "𝔑",
- "nfr;": "𝔫",
- "ngE;": "≧̸",
- "nge;": "≱",
- "nGg;": "⋙̸",
- "nGt;": "≫⃒",
- "ngt;": "≯",
- "nis;": "⋼",
- "niv;": "∋",
- "nlE;": "≦̸",
- "nle;": "≰",
- "nLl;": "⋘̸",
- "nLt;": "≪⃒",
- "nlt;": "≮",
- "Not;": "⫬",
- "not;": "¬",
- "npr;": "⊀",
- "nsc;": "⊁",
- "num;": "#",
- "Ocy;": "О",
- "ocy;": "о",
- "Ofr;": "𝔒",
- "ofr;": "𝔬",
- "ogt;": "⧁",
- "ohm;": "Ω",
- "olt;": "⧀",
- "ord;": "⩝",
- ordf: "ª",
- ordm: "º",
- "orv;": "⩛",
- Ouml: "Ö",
- ouml: "ö",
- "par;": "∥",
- para: "¶",
- "Pcy;": "П",
- "pcy;": "п",
- "Pfr;": "𝔓",
- "pfr;": "𝔭",
- "Phi;": "Φ",
- "phi;": "φ",
- "piv;": "ϖ",
- "prE;": "⪳",
- "pre;": "⪯",
- "Psi;": "Ψ",
- "psi;": "ψ",
- "Qfr;": "𝔔",
- "qfr;": "𝔮",
- QUOT: "\"",
- quot: "\"",
- "Rcy;": "Р",
- "rcy;": "р",
- "REG;": "®",
- "reg;": "®",
- "Rfr;": "ℜ",
- "rfr;": "𝔯",
- "Rho;": "Ρ",
- "rho;": "ρ",
- "rlm;": "",
- "Rsh;": "↱",
- "rsh;": "↱",
- "scE;": "⪴",
- "sce;": "⪰",
- "Scy;": "С",
- "scy;": "с",
- sect: "§",
- "Sfr;": "𝔖",
- "sfr;": "𝔰",
- "shy;": "",
- "sim;": "∼",
- "smt;": "⪪",
- "sol;": "/",
- "squ;": "□",
- "Sub;": "⋐",
- "sub;": "⊂",
- "Sum;": "∑",
- "sum;": "∑",
- "Sup;": "⋑",
- "sup;": "⊃",
- sup1: "¹",
- sup2: "²",
- sup3: "³",
- "Tab;": "\t",
- "Tau;": "Τ",
- "tau;": "τ",
- "Tcy;": "Т",
- "tcy;": "т",
- "Tfr;": "𝔗",
- "tfr;": "𝔱",
- "top;": "⊤",
- "Ucy;": "У",
- "ucy;": "у",
- "Ufr;": "𝔘",
- "ufr;": "𝔲",
- "uml;": "¨",
- Uuml: "Ü",
- uuml: "ü",
- "Vcy;": "В",
- "vcy;": "в",
- "Vee;": "⋁",
- "vee;": "∨",
- "Vfr;": "𝔙",
- "vfr;": "𝔳",
- "Wfr;": "𝔚",
- "wfr;": "𝔴",
- "Xfr;": "𝔛",
- "xfr;": "𝔵",
- "Ycy;": "Ы",
- "ycy;": "ы",
- "yen;": "¥",
- "Yfr;": "𝔜",
- "yfr;": "𝔶",
- yuml: "ÿ",
- "Zcy;": "З",
- "zcy;": "з",
- "Zfr;": "ℨ",
- "zfr;": "𝔷",
- "zwj;": "",
- Acirc: "Â",
- acirc: "â",
- acute: "´",
- AElig: "Æ",
- aelig: "æ",
- "andd;": "⩜",
- "andv;": "⩚",
- "ange;": "⦤",
- "Aopf;": "𝔸",
- "aopf;": "𝕒",
- "apid;": "≋",
- "apos;": "'",
- Aring: "Å",
- aring: "å",
- "Ascr;": "𝒜",
- "ascr;": "𝒶",
- "Auml;": "Ä",
- "auml;": "ä",
- "Barv;": "⫧",
- "bbrk;": "⎵",
- "Beta;": "Β",
- "beta;": "β",
- "beth;": "ℶ",
- "bNot;": "⫭",
- "bnot;": "⌐",
- "Bopf;": "𝔹",
- "bopf;": "𝕓",
- "boxH;": "═",
- "boxh;": "─",
- "boxV;": "║",
- "boxv;": "│",
- "Bscr;": "ℬ",
- "bscr;": "𝒷",
- "bsim;": "∽",
- "bsol;": "\\",
- "bull;": "•",
- "bump;": "≎",
- "caps;": "∩︀",
- "Cdot;": "Ċ",
- "cdot;": "ċ",
- cedil: "¸",
- "cent;": "¢",
- "CHcy;": "Ч",
- "chcy;": "ч",
- "circ;": "ˆ",
- "cirE;": "⧃",
- "cire;": "≗",
- "comp;": "∁",
- "cong;": "≅",
- "Copf;": "ℂ",
- "copf;": "𝕔",
- "COPY;": "©",
- "copy;": "©",
- "Cscr;": "𝒞",
- "cscr;": "𝒸",
- "csub;": "⫏",
- "csup;": "⫐",
- "cups;": "∪︀",
- "Darr;": "↡",
- "dArr;": "⇓",
- "darr;": "↓",
- "dash;": "‐",
- "dHar;": "⥥",
- "diam;": "⋄",
- "DJcy;": "Ђ",
- "djcy;": "ђ",
- "Dopf;": "𝔻",
- "dopf;": "𝕕",
- "Dscr;": "𝒟",
- "dscr;": "𝒹",
- "DScy;": "Ѕ",
- "dscy;": "ѕ",
- "dsol;": "⧶",
- "dtri;": "▿",
- "DZcy;": "Џ",
- "dzcy;": "џ",
- "ecir;": "≖",
- Ecirc: "Ê",
- ecirc: "ê",
- "Edot;": "Ė",
- "eDot;": "≑",
- "edot;": "ė",
- "emsp;": " ",
- "ensp;": " ",
- "Eopf;": "𝔼",
- "eopf;": "𝕖",
- "epar;": "⋕",
- "epsi;": "ε",
- "Escr;": "ℰ",
- "escr;": "ℯ",
- "Esim;": "⩳",
- "esim;": "≂",
- "Euml;": "Ë",
- "euml;": "ë",
- "euro;": "€",
- "excl;": "!",
- "flat;": "♭",
- "fnof;": "ƒ",
- "Fopf;": "𝔽",
- "fopf;": "𝕗",
- "fork;": "⋔",
- "Fscr;": "ℱ",
- "fscr;": "𝒻",
- "Gdot;": "Ġ",
- "gdot;": "ġ",
- "geqq;": "≧",
- "gesl;": "⋛︀",
- "GJcy;": "Ѓ",
- "gjcy;": "ѓ",
- "gnap;": "⪊",
- "gneq;": "⪈",
- "Gopf;": "𝔾",
- "gopf;": "𝕘",
- "Gscr;": "𝒢",
- "gscr;": "ℊ",
- "gsim;": "≳",
- "gtcc;": "⪧",
- "gvnE;": "≩︀",
- "half;": "½",
- "hArr;": "⇔",
- "harr;": "↔",
- "hbar;": "ℏ",
- "Hopf;": "ℍ",
- "hopf;": "𝕙",
- "Hscr;": "ℋ",
- "hscr;": "𝒽",
- Icirc: "Î",
- icirc: "î",
- "Idot;": "İ",
- "IEcy;": "Е",
- "iecy;": "е",
- iexcl: "¡",
- "imof;": "⊷",
- "IOcy;": "Ё",
- "iocy;": "ё",
- "Iopf;": "𝕀",
- "iopf;": "𝕚",
- "Iota;": "Ι",
- "iota;": "ι",
- "Iscr;": "ℐ",
- "iscr;": "𝒾",
- "isin;": "∈",
- "Iuml;": "Ï",
- "iuml;": "ï",
- "Jopf;": "𝕁",
- "jopf;": "𝕛",
- "Jscr;": "𝒥",
- "jscr;": "𝒿",
- "KHcy;": "Х",
- "khcy;": "х",
- "KJcy;": "Ќ",
- "kjcy;": "ќ",
- "Kopf;": "𝕂",
- "kopf;": "𝕜",
- "Kscr;": "𝒦",
- "kscr;": "𝓀",
- "Lang;": "⟪",
- "lang;": "⟨",
- laquo: "«",
- "Larr;": "↞",
- "lArr;": "⇐",
- "larr;": "←",
- "late;": "⪭",
- "lcub;": "{",
- "ldca;": "⤶",
- "ldsh;": "↲",
- "leqq;": "≦",
- "lesg;": "⋚︀",
- "lHar;": "⥢",
- "LJcy;": "Љ",
- "ljcy;": "љ",
- "lnap;": "⪉",
- "lneq;": "⪇",
- "Lopf;": "𝕃",
- "lopf;": "𝕝",
- "lozf;": "⧫",
- "lpar;": "(",
- "Lscr;": "ℒ",
- "lscr;": "𝓁",
- "lsim;": "≲",
- "lsqb;": "[",
- "ltcc;": "⪦",
- "ltri;": "◃",
- "lvnE;": "≨︀",
- "macr;": "¯",
- "male;": "♂",
- "malt;": "✠",
- micro: "µ",
- "mlcp;": "⫛",
- "mldr;": "…",
- "Mopf;": "𝕄",
- "mopf;": "𝕞",
- "Mscr;": "ℳ",
- "mscr;": "𝓂",
- "nang;": "∠⃒",
- "napE;": "⩰̸",
- "nbsp;": " ",
- "ncap;": "⩃",
- "ncup;": "⩂",
- "ngeq;": "≱",
- "nges;": "⩾̸",
- "ngtr;": "≯",
- "nGtv;": "≫̸",
- "nisd;": "⋺",
- "NJcy;": "Њ",
- "njcy;": "њ",
- "nldr;": "‥",
- "nleq;": "≰",
- "nles;": "⩽̸",
- "nLtv;": "≪̸",
- "nmid;": "∤",
- "Nopf;": "ℕ",
- "nopf;": "𝕟",
- "npar;": "∦",
- "npre;": "⪯̸",
- "nsce;": "⪰̸",
- "Nscr;": "𝒩",
- "nscr;": "𝓃",
- "nsim;": "≁",
- "nsub;": "⊄",
- "nsup;": "⊅",
- "ntgl;": "≹",
- "ntlg;": "≸",
- "nvap;": "≍⃒",
- "nvge;": "≥⃒",
- "nvgt;": ">⃒",
- "nvle;": "≤⃒",
- "nvlt;": "<⃒",
- "oast;": "⊛",
- "ocir;": "⊚",
- Ocirc: "Ô",
- ocirc: "ô",
- "odiv;": "⨸",
- "odot;": "⊙",
- "ogon;": "˛",
- "oint;": "∮",
- "omid;": "⦶",
- "Oopf;": "𝕆",
- "oopf;": "𝕠",
- "opar;": "⦷",
- "ordf;": "ª",
- "ordm;": "º",
- "oror;": "⩖",
- "Oscr;": "𝒪",
- "oscr;": "ℴ",
- "osol;": "⊘",
- "Ouml;": "Ö",
- "ouml;": "ö",
- "para;": "¶",
- "part;": "∂",
- "perp;": "⊥",
- "phiv;": "ϕ",
- "plus;": "+",
- "Popf;": "ℙ",
- "popf;": "𝕡",
- pound: "£",
- "prap;": "⪷",
- "prec;": "≺",
- "prnE;": "⪵",
- "prod;": "∏",
- "prop;": "∝",
- "Pscr;": "𝒫",
- "pscr;": "𝓅",
- "qint;": "⨌",
- "Qopf;": "ℚ",
- "qopf;": "𝕢",
- "Qscr;": "𝒬",
- "qscr;": "𝓆",
- "QUOT;": "\"",
- "quot;": "\"",
- "race;": "∽̱",
- "Rang;": "⟫",
- "rang;": "⟩",
- raquo: "»",
- "Rarr;": "↠",
- "rArr;": "⇒",
- "rarr;": "→",
- "rcub;": "}",
- "rdca;": "⤷",
- "rdsh;": "↳",
- "real;": "ℜ",
- "rect;": "▭",
- "rHar;": "⥤",
- "rhov;": "ϱ",
- "ring;": "˚",
- "Ropf;": "ℝ",
- "ropf;": "𝕣",
- "rpar;": ")",
- "Rscr;": "ℛ",
- "rscr;": "𝓇",
- "rsqb;": "]",
- "rtri;": "▹",
- "scap;": "⪸",
- "scnE;": "⪶",
- "sdot;": "⋅",
- "sect;": "§",
- "semi;": ";",
- "sext;": "✶",
- "SHcy;": "Ш",
- "shcy;": "ш",
- "sime;": "≃",
- "simg;": "⪞",
- "siml;": "⪝",
- "smid;": "∣",
- "smte;": "⪬",
- "solb;": "⧄",
- "Sopf;": "𝕊",
- "sopf;": "𝕤",
- "spar;": "∥",
- "Sqrt;": "√",
- "squf;": "▪",
- "Sscr;": "𝒮",
- "sscr;": "𝓈",
- "Star;": "⋆",
- "star;": "☆",
- "subE;": "⫅",
- "sube;": "⊆",
- "succ;": "≻",
- "sung;": "♪",
- "sup1;": "¹",
- "sup2;": "²",
- "sup3;": "³",
- "supE;": "⫆",
- "supe;": "⊇",
- szlig: "ß",
- "tbrk;": "⎴",
- "tdot;": "⃛",
- THORN: "Þ",
- thorn: "þ",
- times: "×",
- "tint;": "∭",
- "toea;": "⤨",
- "Topf;": "𝕋",
- "topf;": "𝕥",
- "tosa;": "⤩",
- "trie;": "≜",
- "Tscr;": "𝒯",
- "tscr;": "𝓉",
- "TScy;": "Ц",
- "tscy;": "ц",
- "Uarr;": "↟",
- "uArr;": "⇑",
- "uarr;": "↑",
- Ucirc: "Û",
- ucirc: "û",
- "uHar;": "⥣",
- "Uopf;": "𝕌",
- "uopf;": "𝕦",
- "Upsi;": "ϒ",
- "upsi;": "υ",
- "Uscr;": "𝒰",
- "uscr;": "𝓊",
- "utri;": "▵",
- "Uuml;": "Ü",
- "uuml;": "ü",
- "vArr;": "⇕",
- "varr;": "↕",
- "Vbar;": "⫫",
- "vBar;": "⫨",
- "Vert;": "‖",
- "vert;": "|",
- "Vopf;": "𝕍",
- "vopf;": "𝕧",
- "Vscr;": "𝒱",
- "vscr;": "𝓋",
- "Wopf;": "𝕎",
- "wopf;": "𝕨",
- "Wscr;": "𝒲",
- "wscr;": "𝓌",
- "xcap;": "⋂",
- "xcup;": "⋃",
- "xmap;": "⟼",
- "xnis;": "⋻",
- "Xopf;": "𝕏",
- "xopf;": "𝕩",
- "Xscr;": "𝒳",
- "xscr;": "𝓍",
- "xvee;": "⋁",
- "YAcy;": "Я",
- "yacy;": "я",
- "YIcy;": "Ї",
- "yicy;": "ї",
- "Yopf;": "𝕐",
- "yopf;": "𝕪",
- "Yscr;": "𝒴",
- "yscr;": "𝓎",
- "YUcy;": "Ю",
- "yucy;": "ю",
- "Yuml;": "Ÿ",
- "yuml;": "ÿ",
- "Zdot;": "Ż",
- "zdot;": "ż",
- "Zeta;": "Ζ",
- "zeta;": "ζ",
- "ZHcy;": "Ж",
- "zhcy;": "ж",
- "Zopf;": "ℤ",
- "zopf;": "𝕫",
- "Zscr;": "𝒵",
- "zscr;": "𝓏",
- "zwnj;": "",
- Aacute: "Á",
- aacute: "á",
- "Acirc;": "Â",
- "acirc;": "â",
- "acute;": "´",
- "AElig;": "Æ",
- "aelig;": "æ",
- Agrave: "À",
- agrave: "à",
- "aleph;": "ℵ",
- "Alpha;": "Α",
- "alpha;": "α",
- "Amacr;": "Ā",
- "amacr;": "ā",
- "amalg;": "⨿",
- "angle;": "∠",
- "angrt;": "∟",
- "angst;": "Å",
- "Aogon;": "Ą",
- "aogon;": "ą",
- "Aring;": "Å",
- "aring;": "å",
- "asymp;": "≈",
- Atilde: "Ã",
- atilde: "ã",
- "awint;": "⨑",
- "bcong;": "≌",
- "bdquo;": "„",
- "bepsi;": "϶",
- "blank;": "␣",
- "blk12;": "▒",
- "blk14;": "░",
- "blk34;": "▓",
- "block;": "█",
- "boxDL;": "╗",
- "boxDl;": "╖",
- "boxdL;": "╕",
- "boxdl;": "┐",
- "boxDR;": "╔",
- "boxDr;": "╓",
- "boxdR;": "╒",
- "boxdr;": "┌",
- "boxHD;": "╦",
- "boxHd;": "╤",
- "boxhD;": "╥",
- "boxhd;": "┬",
- "boxHU;": "╩",
- "boxHu;": "╧",
- "boxhU;": "╨",
- "boxhu;": "┴",
- "boxUL;": "╝",
- "boxUl;": "╜",
- "boxuL;": "╛",
- "boxul;": "┘",
- "boxUR;": "╚",
- "boxUr;": "╙",
- "boxuR;": "╘",
- "boxur;": "└",
- "boxVH;": "╬",
- "boxVh;": "╫",
- "boxvH;": "╪",
- "boxvh;": "┼",
- "boxVL;": "╣",
- "boxVl;": "╢",
- "boxvL;": "╡",
- "boxvl;": "┤",
- "boxVR;": "╠",
- "boxVr;": "╟",
- "boxvR;": "╞",
- "boxvr;": "├",
- "Breve;": "˘",
- "breve;": "˘",
- brvbar: "¦",
- "bsemi;": "⁏",
- "bsime;": "⋍",
- "bsolb;": "⧅",
- "bumpE;": "⪮",
- "bumpe;": "≏",
- "caret;": "⁁",
- "caron;": "ˇ",
- "ccaps;": "⩍",
- Ccedil: "Ç",
- ccedil: "ç",
- "Ccirc;": "Ĉ",
- "ccirc;": "ĉ",
- "ccups;": "⩌",
- "cedil;": "¸",
- "check;": "✓",
- "clubs;": "♣",
- "Colon;": "∷",
- "colon;": ":",
- "comma;": ",",
- "crarr;": "↵",
- "Cross;": "⨯",
- "cross;": "✗",
- "csube;": "⫑",
- "csupe;": "⫒",
- "ctdot;": "⋯",
- "cuepr;": "⋞",
- "cuesc;": "⋟",
- "cupor;": "⩅",
- curren: "¤",
- "cuvee;": "⋎",
- "cuwed;": "⋏",
- "cwint;": "∱",
- "Dashv;": "⫤",
- "dashv;": "⊣",
- "dblac;": "˝",
- "ddarr;": "⇊",
- "Delta;": "Δ",
- "delta;": "δ",
- "dharl;": "⇃",
- "dharr;": "⇂",
- "diams;": "♦",
- "disin;": "⋲",
- divide: "÷",
- "doteq;": "≐",
- "dtdot;": "⋱",
- "dtrif;": "▾",
- "duarr;": "⇵",
- "duhar;": "⥯",
- Eacute: "É",
- eacute: "é",
- "Ecirc;": "Ê",
- "ecirc;": "ê",
- "eDDot;": "⩷",
- "efDot;": "≒",
- Egrave: "È",
- egrave: "è",
- "Emacr;": "Ē",
- "emacr;": "ē",
- "empty;": "∅",
- "Eogon;": "Ę",
- "eogon;": "ę",
- "eplus;": "⩱",
- "epsiv;": "ϵ",
- "eqsim;": "≂",
- "Equal;": "⩵",
- "equiv;": "≡",
- "erarr;": "⥱",
- "erDot;": "≓",
- "esdot;": "≐",
- "exist;": "∃",
- "fflig;": "ff",
- "filig;": "fi",
- "fjlig;": "fj",
- "fllig;": "fl",
- "fltns;": "▱",
- "forkv;": "⫙",
- frac12: "½",
- frac14: "¼",
- frac34: "¾",
- "frasl;": "⁄",
- "frown;": "⌢",
- "Gamma;": "Γ",
- "gamma;": "γ",
- "Gcirc;": "Ĝ",
- "gcirc;": "ĝ",
- "gescc;": "⪩",
- "gimel;": "ℷ",
- "gneqq;": "≩",
- "gnsim;": "⋧",
- "grave;": "`",
- "gsime;": "⪎",
- "gsiml;": "⪐",
- "gtcir;": "⩺",
- "gtdot;": "⋗",
- "Hacek;": "ˇ",
- "harrw;": "↭",
- "Hcirc;": "Ĥ",
- "hcirc;": "ĥ",
- "hoarr;": "⇿",
- Iacute: "Í",
- iacute: "í",
- "Icirc;": "Î",
- "icirc;": "î",
- "iexcl;": "¡",
- Igrave: "Ì",
- igrave: "ì",
- "iiint;": "∭",
- "iiota;": "℩",
- "IJlig;": "IJ",
- "ijlig;": "ij",
- "Imacr;": "Ī",
- "imacr;": "ī",
- "image;": "ℑ",
- "imath;": "ı",
- "imped;": "Ƶ",
- "infin;": "∞",
- "Iogon;": "Į",
- "iogon;": "į",
- "iprod;": "⨼",
- iquest: "¿",
- "isinE;": "⋹",
- "isins;": "⋴",
- "isinv;": "∈",
- "Iukcy;": "І",
- "iukcy;": "і",
- "Jcirc;": "Ĵ",
- "jcirc;": "ĵ",
- "jmath;": "ȷ",
- "Jukcy;": "Є",
- "jukcy;": "є",
- "Kappa;": "Κ",
- "kappa;": "κ",
- "lAarr;": "⇚",
- "langd;": "⦑",
- "laquo;": "«",
- "larrb;": "⇤",
- "lates;": "⪭︀",
- "lBarr;": "⤎",
- "lbarr;": "⤌",
- "lbbrk;": "❲",
- "lbrke;": "⦋",
- "lceil;": "⌈",
- "ldquo;": "“",
- "lescc;": "⪨",
- "lhard;": "↽",
- "lharu;": "↼",
- "lhblk;": "▄",
- "llarr;": "⇇",
- "lltri;": "◺",
- "lneqq;": "≨",
- "lnsim;": "⋦",
- "loang;": "⟬",
- "loarr;": "⇽",
- "lobrk;": "⟦",
- "lopar;": "⦅",
- "lrarr;": "⇆",
- "lrhar;": "⇋",
- "lrtri;": "⊿",
- "lsime;": "⪍",
- "lsimg;": "⪏",
- "lsquo;": "‘",
- "ltcir;": "⩹",
- "ltdot;": "⋖",
- "ltrie;": "⊴",
- "ltrif;": "◂",
- "mdash;": "—",
- "mDDot;": "∺",
- "micro;": "µ",
- middot: "·",
- "minus;": "−",
- "mumap;": "⊸",
- "nabla;": "∇",
- "napid;": "≋̸",
- "napos;": "ʼn",
- "natur;": "♮",
- "nbump;": "≎̸",
- "ncong;": "≇",
- "ndash;": "–",
- "neArr;": "⇗",
- "nearr;": "↗",
- "nedot;": "≐̸",
- "nesim;": "≂̸",
- "ngeqq;": "≧̸",
- "ngsim;": "≵",
- "nhArr;": "⇎",
- "nharr;": "↮",
- "nhpar;": "⫲",
- "nlArr;": "⇍",
- "nlarr;": "↚",
- "nleqq;": "≦̸",
- "nless;": "≮",
- "nlsim;": "≴",
- "nltri;": "⋪",
- "notin;": "∉",
- "notni;": "∌",
- "npart;": "∂̸",
- "nprec;": "⊀",
- "nrArr;": "⇏",
- "nrarr;": "↛",
- "nrtri;": "⋫",
- "nsime;": "≄",
- "nsmid;": "∤",
- "nspar;": "∦",
- "nsubE;": "⫅̸",
- "nsube;": "⊈",
- "nsucc;": "⊁",
- "nsupE;": "⫆̸",
- "nsupe;": "⊉",
- Ntilde: "Ñ",
- ntilde: "ñ",
- "numsp;": " ",
- "nvsim;": "∼⃒",
- "nwArr;": "⇖",
- "nwarr;": "↖",
- Oacute: "Ó",
- oacute: "ó",
- "Ocirc;": "Ô",
- "ocirc;": "ô",
- "odash;": "⊝",
- "OElig;": "Œ",
- "oelig;": "œ",
- "ofcir;": "⦿",
- Ograve: "Ò",
- ograve: "ò",
- "ohbar;": "⦵",
- "olarr;": "↺",
- "olcir;": "⦾",
- "oline;": "‾",
- "Omacr;": "Ō",
- "omacr;": "ō",
- "Omega;": "Ω",
- "omega;": "ω",
- "operp;": "⦹",
- "oplus;": "⊕",
- "orarr;": "↻",
- "order;": "ℴ",
- Oslash: "Ø",
- oslash: "ø",
- Otilde: "Õ",
- otilde: "õ",
- "ovbar;": "⌽",
- "parsl;": "⫽",
- "phone;": "☎",
- "plusb;": "⊞",
- "pluse;": "⩲",
- plusmn: "±",
- "pound;": "£",
- "prcue;": "≼",
- "Prime;": "″",
- "prime;": "′",
- "prnap;": "⪹",
- "prsim;": "≾",
- "quest;": "?",
- "rAarr;": "⇛",
- "radic;": "√",
- "rangd;": "⦒",
- "range;": "⦥",
- "raquo;": "»",
- "rarrb;": "⇥",
- "rarrc;": "⤳",
- "rarrw;": "↝",
- "ratio;": "∶",
- "RBarr;": "⤐",
- "rBarr;": "⤏",
- "rbarr;": "⤍",
- "rbbrk;": "❳",
- "rbrke;": "⦌",
- "rceil;": "⌉",
- "rdquo;": "”",
- "reals;": "ℝ",
- "rhard;": "⇁",
- "rharu;": "⇀",
- "rlarr;": "⇄",
- "rlhar;": "⇌",
- "rnmid;": "⫮",
- "roang;": "⟭",
- "roarr;": "⇾",
- "robrk;": "⟧",
- "ropar;": "⦆",
- "rrarr;": "⇉",
- "rsquo;": "’",
- "rtrie;": "⊵",
- "rtrif;": "▸",
- "sbquo;": "‚",
- "sccue;": "≽",
- "Scirc;": "Ŝ",
- "scirc;": "ŝ",
- "scnap;": "⪺",
- "scsim;": "≿",
- "sdotb;": "⊡",
- "sdote;": "⩦",
- "seArr;": "⇘",
- "searr;": "↘",
- "setmn;": "∖",
- "sharp;": "♯",
- "Sigma;": "Σ",
- "sigma;": "σ",
- "simeq;": "≃",
- "simgE;": "⪠",
- "simlE;": "⪟",
- "simne;": "≆",
- "slarr;": "←",
- "smile;": "⌣",
- "smtes;": "⪬︀",
- "sqcap;": "⊓",
- "sqcup;": "⊔",
- "sqsub;": "⊏",
- "sqsup;": "⊐",
- "srarr;": "→",
- "starf;": "★",
- "strns;": "¯",
- "subnE;": "⫋",
- "subne;": "⊊",
- "supnE;": "⫌",
- "supne;": "⊋",
- "swArr;": "⇙",
- "swarr;": "↙",
- "szlig;": "ß",
- "Theta;": "Θ",
- "theta;": "θ",
- "thkap;": "≈",
- "THORN;": "Þ",
- "thorn;": "þ",
- "Tilde;": "∼",
- "tilde;": "˜",
- "times;": "×",
- "TRADE;": "™",
- "trade;": "™",
- "trisb;": "⧍",
- "TSHcy;": "Ћ",
- "tshcy;": "ћ",
- "twixt;": "≬",
- Uacute: "Ú",
- uacute: "ú",
- "Ubrcy;": "Ў",
- "ubrcy;": "ў",
- "Ucirc;": "Û",
- "ucirc;": "û",
- "udarr;": "⇅",
- "udhar;": "⥮",
- Ugrave: "Ù",
- ugrave: "ù",
- "uharl;": "↿",
- "uharr;": "↾",
- "uhblk;": "▀",
- "ultri;": "◸",
- "Umacr;": "Ū",
- "umacr;": "ū",
- "Union;": "⋃",
- "Uogon;": "Ų",
- "uogon;": "ų",
- "uplus;": "⊎",
- "upsih;": "ϒ",
- "UpTee;": "⊥",
- "Uring;": "Ů",
- "uring;": "ů",
- "urtri;": "◹",
- "utdot;": "⋰",
- "utrif;": "▴",
- "uuarr;": "⇈",
- "varpi;": "ϖ",
- "vBarv;": "⫩",
- "VDash;": "⊫",
- "Vdash;": "⊩",
- "vDash;": "⊨",
- "vdash;": "⊢",
- "veeeq;": "≚",
- "vltri;": "⊲",
- "vnsub;": "⊂⃒",
- "vnsup;": "⊃⃒",
- "vprop;": "∝",
- "vrtri;": "⊳",
- "Wcirc;": "Ŵ",
- "wcirc;": "ŵ",
- "Wedge;": "⋀",
- "wedge;": "∧",
- "xcirc;": "◯",
- "xdtri;": "▽",
- "xhArr;": "⟺",
- "xharr;": "⟷",
- "xlArr;": "⟸",
- "xlarr;": "⟵",
- "xodot;": "⨀",
- "xrArr;": "⟹",
- "xrarr;": "⟶",
- "xutri;": "△",
- Yacute: "Ý",
- yacute: "ý",
- "Ycirc;": "Ŷ",
- "ycirc;": "ŷ",
- "Aacute;": "Á",
- "aacute;": "á",
- "Abreve;": "Ă",
- "abreve;": "ă",
- "Agrave;": "À",
- "agrave;": "à",
- "andand;": "⩕",
- "angmsd;": "∡",
- "angsph;": "∢",
- "apacir;": "⩯",
- "approx;": "≈",
- "Assign;": "≔",
- "Atilde;": "Ã",
- "atilde;": "ã",
- "barvee;": "⊽",
- "Barwed;": "⌆",
- "barwed;": "⌅",
- "becaus;": "∵",
- "bernou;": "ℬ",
- "bigcap;": "⋂",
- "bigcup;": "⋃",
- "bigvee;": "⋁",
- "bkarow;": "⤍",
- "bottom;": "⊥",
- "bowtie;": "⋈",
- "boxbox;": "⧉",
- "bprime;": "‵",
- "brvbar;": "¦",
- "bullet;": "•",
- "Bumpeq;": "≎",
- "bumpeq;": "≏",
- "Cacute;": "Ć",
- "cacute;": "ć",
- "capand;": "⩄",
- "capcap;": "⩋",
- "capcup;": "⩇",
- "capdot;": "⩀",
- "Ccaron;": "Č",
- "ccaron;": "č",
- "Ccedil;": "Ç",
- "ccedil;": "ç",
- "circeq;": "≗",
- "cirmid;": "⫯",
- "Colone;": "⩴",
- "colone;": "≔",
- "commat;": "@",
- "compfn;": "∘",
- "Conint;": "∯",
- "conint;": "∮",
- "coprod;": "∐",
- "copysr;": "℗",
- "cularr;": "↶",
- "CupCap;": "≍",
- "cupcap;": "⩆",
- "cupcup;": "⩊",
- "cupdot;": "⊍",
- "curarr;": "↷",
- "curren;": "¤",
- "cylcty;": "⌭",
- "Dagger;": "‡",
- "dagger;": "†",
- "daleth;": "ℸ",
- "Dcaron;": "Ď",
- "dcaron;": "ď",
- "dfisht;": "⥿",
- "divide;": "÷",
- "divonx;": "⋇",
- "dlcorn;": "⌞",
- "dlcrop;": "⌍",
- "dollar;": "$",
- "DotDot;": "⃜",
- "drcorn;": "⌟",
- "drcrop;": "⌌",
- "Dstrok;": "Đ",
- "dstrok;": "đ",
- "Eacute;": "É",
- "eacute;": "é",
- "easter;": "⩮",
- "Ecaron;": "Ě",
- "ecaron;": "ě",
- "ecolon;": "≕",
- "Egrave;": "È",
- "egrave;": "è",
- "egsdot;": "⪘",
- "elsdot;": "⪗",
- "emptyv;": "∅",
- "emsp13;": " ",
- "emsp14;": " ",
- "eparsl;": "⧣",
- "eqcirc;": "≖",
- "equals;": "=",
- "equest;": "≟",
- "Exists;": "∃",
- "female;": "♀",
- "ffilig;": "ffi",
- "ffllig;": "ffl",
- "ForAll;": "∀",
- "forall;": "∀",
- "frac12;": "½",
- "frac13;": "⅓",
- "frac14;": "¼",
- "frac15;": "⅕",
- "frac16;": "⅙",
- "frac18;": "⅛",
- "frac23;": "⅔",
- "frac25;": "⅖",
- "frac34;": "¾",
- "frac35;": "⅗",
- "frac38;": "⅜",
- "frac45;": "⅘",
- "frac56;": "⅚",
- "frac58;": "⅝",
- "frac78;": "⅞",
- "gacute;": "ǵ",
- "Gammad;": "Ϝ",
- "gammad;": "ϝ",
- "Gbreve;": "Ğ",
- "gbreve;": "ğ",
- "Gcedil;": "Ģ",
- "gesdot;": "⪀",
- "gesles;": "⪔",
- "gtlPar;": "⦕",
- "gtrarr;": "⥸",
- "gtrdot;": "⋗",
- "gtrsim;": "≳",
- "hairsp;": " ",
- "hamilt;": "ℋ",
- "HARDcy;": "Ъ",
- "hardcy;": "ъ",
- "hearts;": "♥",
- "hellip;": "…",
- "hercon;": "⊹",
- "homtht;": "∻",
- "horbar;": "―",
- "hslash;": "ℏ",
- "Hstrok;": "Ħ",
- "hstrok;": "ħ",
- "hybull;": "⁃",
- "hyphen;": "‐",
- "Iacute;": "Í",
- "iacute;": "í",
- "Igrave;": "Ì",
- "igrave;": "ì",
- "iiiint;": "⨌",
- "iinfin;": "⧜",
- "incare;": "℅",
- "inodot;": "ı",
- "intcal;": "⊺",
- "iquest;": "¿",
- "isinsv;": "⋳",
- "Itilde;": "Ĩ",
- "itilde;": "ĩ",
- "Jsercy;": "Ј",
- "jsercy;": "ј",
- "kappav;": "ϰ",
- "Kcedil;": "Ķ",
- "kcedil;": "ķ",
- "kgreen;": "ĸ",
- "Lacute;": "Ĺ",
- "lacute;": "ĺ",
- "lagran;": "ℒ",
- "Lambda;": "Λ",
- "lambda;": "λ",
- "langle;": "⟨",
- "larrfs;": "⤝",
- "larrhk;": "↩",
- "larrlp;": "↫",
- "larrpl;": "⤹",
- "larrtl;": "↢",
- "lAtail;": "⤛",
- "latail;": "⤙",
- "lbrace;": "{",
- "lbrack;": "[",
- "Lcaron;": "Ľ",
- "lcaron;": "ľ",
- "Lcedil;": "Ļ",
- "lcedil;": "ļ",
- "ldquor;": "„",
- "lesdot;": "⩿",
- "lesges;": "⪓",
- "lfisht;": "⥼",
- "lfloor;": "⌊",
- "lharul;": "⥪",
- "llhard;": "⥫",
- "Lmidot;": "Ŀ",
- "lmidot;": "ŀ",
- "lmoust;": "⎰",
- "loplus;": "⨭",
- "lowast;": "∗",
- "lowbar;": "_",
- "lparlt;": "⦓",
- "lrhard;": "⥭",
- "lsaquo;": "‹",
- "lsquor;": "‚",
- "Lstrok;": "Ł",
- "lstrok;": "ł",
- "lthree;": "⋋",
- "ltimes;": "⋉",
- "ltlarr;": "⥶",
- "ltrPar;": "⦖",
- "mapsto;": "↦",
- "marker;": "▮",
- "mcomma;": "⨩",
- "midast;": "*",
- "midcir;": "⫰",
- "middot;": "·",
- "minusb;": "⊟",
- "minusd;": "∸",
- "mnplus;": "∓",
- "models;": "⊧",
- "mstpos;": "∾",
- "Nacute;": "Ń",
- "nacute;": "ń",
- "nbumpe;": "≏̸",
- "Ncaron;": "Ň",
- "ncaron;": "ň",
- "Ncedil;": "Ņ",
- "ncedil;": "ņ",
- "nearhk;": "⤤",
- "nequiv;": "≢",
- "nesear;": "⤨",
- "nexist;": "∄",
- "nltrie;": "⋬",
- "notinE;": "⋹̸",
- "nparsl;": "⫽⃥",
- "nprcue;": "⋠",
- "nrarrc;": "⤳̸",
- "nrarrw;": "↝̸",
- "nrtrie;": "⋭",
- "nsccue;": "⋡",
- "nsimeq;": "≄",
- "Ntilde;": "Ñ",
- "ntilde;": "ñ",
- "numero;": "№",
- "nVDash;": "⊯",
- "nVdash;": "⊮",
- "nvDash;": "⊭",
- "nvdash;": "⊬",
- "nvHarr;": "⤄",
- "nvlArr;": "⤂",
- "nvrArr;": "⤃",
- "nwarhk;": "⤣",
- "nwnear;": "⤧",
- "Oacute;": "Ó",
- "oacute;": "ó",
- "Odblac;": "Ő",
- "odblac;": "ő",
- "odsold;": "⦼",
- "Ograve;": "Ò",
- "ograve;": "ò",
- "ominus;": "⊖",
- "origof;": "⊶",
- "Oslash;": "Ø",
- "oslash;": "ø",
- "Otilde;": "Õ",
- "otilde;": "õ",
- "Otimes;": "⨷",
- "otimes;": "⊗",
- "parsim;": "⫳",
- "percnt;": "%",
- "period;": ".",
- "permil;": "‰",
- "phmmat;": "ℳ",
- "planck;": "ℏ",
- "plankv;": "ℏ",
- "plusdo;": "∔",
- "plusdu;": "⨥",
- "plusmn;": "±",
- "preceq;": "⪯",
- "primes;": "ℙ",
- "prnsim;": "⋨",
- "propto;": "∝",
- "prurel;": "⊰",
- "puncsp;": " ",
- "qprime;": "⁗",
- "Racute;": "Ŕ",
- "racute;": "ŕ",
- "rangle;": "⟩",
- "rarrap;": "⥵",
- "rarrfs;": "⤞",
- "rarrhk;": "↪",
- "rarrlp;": "↬",
- "rarrpl;": "⥅",
- "Rarrtl;": "⤖",
- "rarrtl;": "↣",
- "rAtail;": "⤜",
- "ratail;": "⤚",
- "rbrace;": "}",
- "rbrack;": "]",
- "Rcaron;": "Ř",
- "rcaron;": "ř",
- "Rcedil;": "Ŗ",
- "rcedil;": "ŗ",
- "rdquor;": "”",
- "rfisht;": "⥽",
- "rfloor;": "⌋",
- "rharul;": "⥬",
- "rmoust;": "⎱",
- "roplus;": "⨮",
- "rpargt;": "⦔",
- "rsaquo;": "›",
- "rsquor;": "’",
- "rthree;": "⋌",
- "rtimes;": "⋊",
- "Sacute;": "Ś",
- "sacute;": "ś",
- "Scaron;": "Š",
- "scaron;": "š",
- "Scedil;": "Ş",
- "scedil;": "ş",
- "scnsim;": "⋩",
- "searhk;": "⤥",
- "seswar;": "⤩",
- "sfrown;": "⌢",
- "SHCHcy;": "Щ",
- "shchcy;": "щ",
- "sigmaf;": "ς",
- "sigmav;": "ς",
- "simdot;": "⩪",
- "smashp;": "⨳",
- "SOFTcy;": "Ь",
- "softcy;": "ь",
- "solbar;": "⌿",
- "spades;": "♠",
- "sqcaps;": "⊓︀",
- "sqcups;": "⊔︀",
- "sqsube;": "⊑",
- "sqsupe;": "⊒",
- "Square;": "□",
- "square;": "□",
- "squarf;": "▪",
- "ssetmn;": "∖",
- "ssmile;": "⌣",
- "sstarf;": "⋆",
- "subdot;": "⪽",
- "Subset;": "⋐",
- "subset;": "⊂",
- "subsim;": "⫇",
- "subsub;": "⫕",
- "subsup;": "⫓",
- "succeq;": "⪰",
- "supdot;": "⪾",
- "Supset;": "⋑",
- "supset;": "⊃",
- "supsim;": "⫈",
- "supsub;": "⫔",
- "supsup;": "⫖",
- "swarhk;": "⤦",
- "swnwar;": "⤪",
- "target;": "⌖",
- "Tcaron;": "Ť",
- "tcaron;": "ť",
- "Tcedil;": "Ţ",
- "tcedil;": "ţ",
- "telrec;": "⌕",
- "there4;": "∴",
- "thetav;": "ϑ",
- "thinsp;": " ",
- "thksim;": "∼",
- "timesb;": "⊠",
- "timesd;": "⨰",
- "topbot;": "⌶",
- "topcir;": "⫱",
- "tprime;": "‴",
- "tridot;": "◬",
- "Tstrok;": "Ŧ",
- "tstrok;": "ŧ",
- "Uacute;": "Ú",
- "uacute;": "ú",
- "Ubreve;": "Ŭ",
- "ubreve;": "ŭ",
- "Udblac;": "Ű",
- "udblac;": "ű",
- "ufisht;": "⥾",
- "Ugrave;": "Ù",
- "ugrave;": "ù",
- "ulcorn;": "⌜",
- "ulcrop;": "⌏",
- "urcorn;": "⌝",
- "urcrop;": "⌎",
- "Utilde;": "Ũ",
- "utilde;": "ũ",
- "vangrt;": "⦜",
- "varphi;": "ϕ",
- "varrho;": "ϱ",
- "Vdashl;": "⫦",
- "veebar;": "⊻",
- "vellip;": "⋮",
- "Verbar;": "‖",
- "verbar;": "|",
- "vsubnE;": "⫋︀",
- "vsubne;": "⊊︀",
- "vsupnE;": "⫌︀",
- "vsupne;": "⊋︀",
- "Vvdash;": "⊪",
- "wedbar;": "⩟",
- "wedgeq;": "≙",
- "weierp;": "℘",
- "wreath;": "≀",
- "xoplus;": "⨁",
- "xotime;": "⨂",
- "xsqcup;": "⨆",
- "xuplus;": "⨄",
- "xwedge;": "⋀",
- "Yacute;": "Ý",
- "yacute;": "ý",
- "Zacute;": "Ź",
- "zacute;": "ź",
- "Zcaron;": "Ž",
- "zcaron;": "ž",
- "zeetrf;": "ℨ",
- "alefsym;": "ℵ",
- "angrtvb;": "⊾",
- "angzarr;": "⍼",
- "asympeq;": "≍",
- "backsim;": "∽",
- "Because;": "∵",
- "because;": "∵",
- "bemptyv;": "⦰",
- "between;": "≬",
- "bigcirc;": "◯",
- "bigodot;": "⨀",
- "bigstar;": "★",
- "bnequiv;": "≡⃥",
- "boxplus;": "⊞",
- "Cayleys;": "ℭ",
- "Cconint;": "∰",
- "ccupssm;": "⩐",
- "Cedilla;": "¸",
- "cemptyv;": "⦲",
- "cirscir;": "⧂",
- "coloneq;": "≔",
- "congdot;": "⩭",
- "cudarrl;": "⤸",
- "cudarrr;": "⤵",
- "cularrp;": "⤽",
- "curarrm;": "⤼",
- "dbkarow;": "⤏",
- "ddagger;": "‡",
- "ddotseq;": "⩷",
- "demptyv;": "⦱",
- "Diamond;": "⋄",
- "diamond;": "⋄",
- "digamma;": "ϝ",
- "dotplus;": "∔",
- "DownTee;": "⊤",
- "dwangle;": "⦦",
- "Element;": "∈",
- "Epsilon;": "Ε",
- "epsilon;": "ε",
- "eqcolon;": "≕",
- "equivDD;": "⩸",
- "gesdoto;": "⪂",
- "gtquest;": "⩼",
- "gtrless;": "≷",
- "harrcir;": "⥈",
- "Implies;": "⇒",
- "intprod;": "⨼",
- "isindot;": "⋵",
- "larrbfs;": "⤟",
- "larrsim;": "⥳",
- "lbrksld;": "⦏",
- "lbrkslu;": "⦍",
- "ldrdhar;": "⥧",
- "LeftTee;": "⊣",
- "lesdoto;": "⪁",
- "lessdot;": "⋖",
- "lessgtr;": "≶",
- "lesssim;": "≲",
- "lotimes;": "⨴",
- "lozenge;": "◊",
- "ltquest;": "⩻",
- "luruhar;": "⥦",
- "maltese;": "✠",
- "minusdu;": "⨪",
- "napprox;": "≉",
- "natural;": "♮",
- "nearrow;": "↗",
- "NewLine;": "\n",
- "nexists;": "∄",
- "NoBreak;": "",
- "notinva;": "∉",
- "notinvb;": "⋷",
- "notinvc;": "⋶",
- "NotLess;": "≮",
- "notniva;": "∌",
- "notnivb;": "⋾",
- "notnivc;": "⋽",
- "npolint;": "⨔",
- "npreceq;": "⪯̸",
- "nsqsube;": "⋢",
- "nsqsupe;": "⋣",
- "nsubset;": "⊂⃒",
- "nsucceq;": "⪰̸",
- "nsupset;": "⊃⃒",
- "nvinfin;": "⧞",
- "nvltrie;": "⊴⃒",
- "nvrtrie;": "⊵⃒",
- "nwarrow;": "↖",
- "olcross;": "⦻",
- "Omicron;": "Ο",
- "omicron;": "ο",
- "orderof;": "ℴ",
- "orslope;": "⩗",
- "OverBar;": "‾",
- "pertenk;": "‱",
- "planckh;": "ℎ",
- "pluscir;": "⨢",
- "plussim;": "⨦",
- "plustwo;": "⨧",
- "precsim;": "≾",
- "Product;": "∏",
- "quatint;": "⨖",
- "questeq;": "≟",
- "rarrbfs;": "⤠",
- "rarrsim;": "⥴",
- "rbrksld;": "⦎",
- "rbrkslu;": "⦐",
- "rdldhar;": "⥩",
- "realine;": "ℛ",
- "rotimes;": "⨵",
- "ruluhar;": "⥨",
- "searrow;": "↘",
- "simplus;": "⨤",
- "simrarr;": "⥲",
- "subedot;": "⫃",
- "submult;": "⫁",
- "subplus;": "⪿",
- "subrarr;": "⥹",
- "succsim;": "≿",
- "supdsub;": "⫘",
- "supedot;": "⫄",
- "suphsol;": "⟉",
- "suphsub;": "⫗",
- "suplarr;": "⥻",
- "supmult;": "⫂",
- "supplus;": "⫀",
- "swarrow;": "↙",
- "topfork;": "⫚",
- "triplus;": "⨹",
- "tritime;": "⨻",
- "UpArrow;": "↑",
- "Uparrow;": "⇑",
- "uparrow;": "↑",
- "Upsilon;": "Υ",
- "upsilon;": "υ",
- "uwangle;": "⦧",
- "vzigzag;": "⦚",
- "zigrarr;": "⇝",
- "andslope;": "⩘",
- "angmsdaa;": "⦨",
- "angmsdab;": "⦩",
- "angmsdac;": "⦪",
- "angmsdad;": "⦫",
- "angmsdae;": "⦬",
- "angmsdaf;": "⦭",
- "angmsdag;": "⦮",
- "angmsdah;": "⦯",
- "angrtvbd;": "⦝",
- "approxeq;": "≊",
- "awconint;": "∳",
- "backcong;": "≌",
- "barwedge;": "⌅",
- "bbrktbrk;": "⎶",
- "bigoplus;": "⨁",
- "bigsqcup;": "⨆",
- "biguplus;": "⨄",
- "bigwedge;": "⋀",
- "boxminus;": "⊟",
- "boxtimes;": "⊠",
- "bsolhsub;": "⟈",
- "capbrcup;": "⩉",
- "circledR;": "®",
- "circledS;": "Ⓢ",
- "cirfnint;": "⨐",
- "clubsuit;": "♣",
- "cupbrcap;": "⩈",
- "curlyvee;": "⋎",
- "cwconint;": "∲",
- "DDotrahd;": "⤑",
- "doteqdot;": "≑",
- "DotEqual;": "≐",
- "dotminus;": "∸",
- "drbkarow;": "⤐",
- "dzigrarr;": "⟿",
- "elinters;": "⏧",
- "emptyset;": "∅",
- "eqvparsl;": "⧥",
- "fpartint;": "⨍",
- "geqslant;": "⩾",
- "gesdotol;": "⪄",
- "gnapprox;": "⪊",
- "hksearow;": "⤥",
- "hkswarow;": "⤦",
- "imagline;": "ℐ",
- "imagpart;": "ℑ",
- "infintie;": "⧝",
- "integers;": "ℤ",
- "Integral;": "∫",
- "intercal;": "⊺",
- "intlarhk;": "⨗",
- "laemptyv;": "⦴",
- "ldrushar;": "⥋",
- "leqslant;": "⩽",
- "lesdotor;": "⪃",
- "LessLess;": "⪡",
- "llcorner;": "⌞",
- "lnapprox;": "⪉",
- "lrcorner;": "⌟",
- "lurdshar;": "⥊",
- "mapstoup;": "↥",
- "multimap;": "⊸",
- "naturals;": "ℕ",
- "ncongdot;": "⩭̸",
- "NotEqual;": "≠",
- "notindot;": "⋵̸",
- "NotTilde;": "≁",
- "otimesas;": "⨶",
- "parallel;": "∥",
- "PartialD;": "∂",
- "plusacir;": "⨣",
- "pointint;": "⨕",
- "Precedes;": "≺",
- "precneqq;": "⪵",
- "precnsim;": "⋨",
- "profalar;": "⌮",
- "profline;": "⌒",
- "profsurf;": "⌓",
- "raemptyv;": "⦳",
- "realpart;": "ℜ",
- "RightTee;": "⊢",
- "rppolint;": "⨒",
- "rtriltri;": "⧎",
- "scpolint;": "⨓",
- "setminus;": "∖",
- "shortmid;": "∣",
- "smeparsl;": "⧤",
- "sqsubset;": "⊏",
- "sqsupset;": "⊐",
- "subseteq;": "⊆",
- "Succeeds;": "≻",
- "succneqq;": "⪶",
- "succnsim;": "⋩",
- "SuchThat;": "∋",
- "Superset;": "⊃",
- "supseteq;": "⊇",
- "thetasym;": "ϑ",
- "thicksim;": "∼",
- "timesbar;": "⨱",
- "triangle;": "▵",
- "triminus;": "⨺",
- "trpezium;": "⏢",
- "Uarrocir;": "⥉",
- "ulcorner;": "⌜",
- "UnderBar;": "_",
- "urcorner;": "⌝",
- "varkappa;": "ϰ",
- "varsigma;": "ς",
- "vartheta;": "ϑ",
- "backprime;": "‵",
- "backsimeq;": "⋍",
- "Backslash;": "∖",
- "bigotimes;": "⨂",
- "CenterDot;": "·",
- "centerdot;": "·",
- "checkmark;": "✓",
- "CircleDot;": "⊙",
- "complexes;": "ℂ",
- "Congruent;": "≡",
- "Coproduct;": "∐",
- "dotsquare;": "⊡",
- "DoubleDot;": "¨",
- "DownArrow;": "↓",
- "Downarrow;": "⇓",
- "downarrow;": "↓",
- "DownBreve;": "̑",
- "gtrapprox;": "⪆",
- "gtreqless;": "⋛",
- "gvertneqq;": "≩︀",
- "heartsuit;": "♥",
- "HumpEqual;": "≏",
- "LeftArrow;": "←",
- "Leftarrow;": "⇐",
- "leftarrow;": "←",
- "LeftFloor;": "⌊",
- "lesseqgtr;": "⋚",
- "LessTilde;": "≲",
- "lvertneqq;": "≨︀",
- "Mellintrf;": "ℳ",
- "MinusPlus;": "∓",
- "ngeqslant;": "⩾̸",
- "nleqslant;": "⩽̸",
- "NotCupCap;": "≭",
- "NotExists;": "∄",
- "NotSubset;": "⊂⃒",
- "nparallel;": "∦",
- "nshortmid;": "∤",
- "nsubseteq;": "⊈",
- "nsupseteq;": "⊉",
- "OverBrace;": "⏞",
- "pitchfork;": "⋔",
- "PlusMinus;": "±",
- "rationals;": "ℚ",
- "spadesuit;": "♠",
- "subseteqq;": "⫅",
- "subsetneq;": "⊊",
- "supseteqq;": "⫆",
- "supsetneq;": "⊋",
- "Therefore;": "∴",
- "therefore;": "∴",
- "ThinSpace;": " ",
- "triangleq;": "≜",
- "TripleDot;": "⃛",
- "UnionPlus;": "⊎",
- "varpropto;": "∝",
- "Bernoullis;": "ℬ",
- "circledast;": "⊛",
- "CirclePlus;": "⊕",
- "complement;": "∁",
- "curlywedge;": "⋏",
- "eqslantgtr;": "⪖",
- "EqualTilde;": "≂",
- "Fouriertrf;": "ℱ",
- "gtreqqless;": "⪌",
- "ImaginaryI;": "ⅈ",
- "Laplacetrf;": "ℒ",
- "LeftVector;": "↼",
- "lessapprox;": "⪅",
- "lesseqqgtr;": "⪋",
- "Lleftarrow;": "⇚",
- "lmoustache;": "⎰",
- "longmapsto;": "⟼",
- "mapstodown;": "↧",
- "mapstoleft;": "↤",
- "nLeftarrow;": "⇍",
- "nleftarrow;": "↚",
- "NotElement;": "∉",
- "NotGreater;": "≯",
- "nsubseteqq;": "⫅̸",
- "nsupseteqq;": "⫆̸",
- "precapprox;": "⪷",
- "Proportion;": "∷",
- "RightArrow;": "→",
- "Rightarrow;": "⇒",
- "rightarrow;": "→",
- "RightFloor;": "⌋",
- "rmoustache;": "⎱",
- "sqsubseteq;": "⊑",
- "sqsupseteq;": "⊒",
- "subsetneqq;": "⫋",
- "succapprox;": "⪸",
- "supsetneqq;": "⫌",
- "ThickSpace;": " ",
- "TildeEqual;": "≃",
- "TildeTilde;": "≈",
- "UnderBrace;": "⏟",
- "UpArrowBar;": "⤒",
- "UpTeeArrow;": "↥",
- "upuparrows;": "⇈",
- "varepsilon;": "ϵ",
- "varnothing;": "∅",
- "backepsilon;": "϶",
- "blacksquare;": "▪",
- "circledcirc;": "⊚",
- "circleddash;": "⊝",
- "CircleMinus;": "⊖",
- "CircleTimes;": "⊗",
- "curlyeqprec;": "⋞",
- "curlyeqsucc;": "⋟",
- "diamondsuit;": "♦",
- "eqslantless;": "⪕",
- "Equilibrium;": "⇌",
- "expectation;": "ℰ",
- "GreaterLess;": "≷",
- "LeftCeiling;": "⌈",
- "LessGreater;": "≶",
- "MediumSpace;": " ",
- "NotLessLess;": "≪̸",
- "NotPrecedes;": "⊀",
- "NotSucceeds;": "⊁",
- "NotSuperset;": "⊃⃒",
- "nRightarrow;": "⇏",
- "nrightarrow;": "↛",
- "OverBracket;": "⎴",
- "preccurlyeq;": "≼",
- "precnapprox;": "⪹",
- "quaternions;": "ℍ",
- "RightVector;": "⇀",
- "Rrightarrow;": "⇛",
- "RuleDelayed;": "⧴",
- "SmallCircle;": "∘",
- "SquareUnion;": "⊔",
- "straightphi;": "ϕ",
- "SubsetEqual;": "⊆",
- "succcurlyeq;": "≽",
- "succnapprox;": "⪺",
- "thickapprox;": "≈",
- "UpDownArrow;": "↕",
- "Updownarrow;": "⇕",
- "updownarrow;": "↕",
- "VerticalBar;": "∣",
- "blacklozenge;": "⧫",
- "DownArrowBar;": "⤓",
- "DownTeeArrow;": "↧",
- "ExponentialE;": "ⅇ",
- "exponentiale;": "ⅇ",
- "GreaterEqual;": "≥",
- "GreaterTilde;": "≳",
- "HilbertSpace;": "ℋ",
- "HumpDownHump;": "≎",
- "Intersection;": "⋂",
- "LeftArrowBar;": "⇤",
- "LeftTeeArrow;": "↤",
- "LeftTriangle;": "⊲",
- "LeftUpVector;": "↿",
- "NotCongruent;": "≢",
- "NotHumpEqual;": "≏̸",
- "NotLessEqual;": "≰",
- "NotLessTilde;": "≴",
- "Proportional;": "∝",
- "RightCeiling;": "⌉",
- "risingdotseq;": "≓",
- "RoundImplies;": "⥰",
- "ShortUpArrow;": "↑",
- "SquareSubset;": "⊏",
- "triangledown;": "▿",
- "triangleleft;": "◃",
- "UnderBracket;": "⎵",
- "varsubsetneq;": "⊊︀",
- "varsupsetneq;": "⊋︀",
- "VerticalLine;": "|",
- "ApplyFunction;": "",
- "bigtriangleup;": "△",
- "blacktriangle;": "▴",
- "DifferentialD;": "ⅆ",
- "divideontimes;": "⋇",
- "DoubleLeftTee;": "⫤",
- "DoubleUpArrow;": "⇑",
- "fallingdotseq;": "≒",
- "hookleftarrow;": "↩",
- "leftarrowtail;": "↢",
- "leftharpoonup;": "↼",
- "LeftTeeVector;": "⥚",
- "LeftVectorBar;": "⥒",
- "LessFullEqual;": "≦",
- "LongLeftArrow;": "⟵",
- "Longleftarrow;": "⟸",
- "longleftarrow;": "⟵",
- "looparrowleft;": "↫",
- "measuredangle;": "∡",
- "NotEqualTilde;": "≂̸",
- "NotTildeEqual;": "≄",
- "NotTildeTilde;": "≉",
- "ntriangleleft;": "⋪",
- "Poincareplane;": "ℌ",
- "PrecedesEqual;": "⪯",
- "PrecedesTilde;": "≾",
- "RightArrowBar;": "⇥",
- "RightTeeArrow;": "↦",
- "RightTriangle;": "⊳",
- "RightUpVector;": "↾",
- "shortparallel;": "∥",
- "smallsetminus;": "∖",
- "SucceedsEqual;": "⪰",
- "SucceedsTilde;": "≿",
- "SupersetEqual;": "⊇",
- "triangleright;": "▹",
- "UpEquilibrium;": "⥮",
- "upharpoonleft;": "↿",
- "varsubsetneqq;": "⫋︀",
- "varsupsetneqq;": "⫌︀",
- "VerticalTilde;": "≀",
- "VeryThinSpace;": " ",
- "curvearrowleft;": "↶",
- "DiacriticalDot;": "˙",
- "doublebarwedge;": "⌆",
- "DoubleRightTee;": "⊨",
- "downdownarrows;": "⇊",
- "DownLeftVector;": "↽",
- "GreaterGreater;": "⪢",
- "hookrightarrow;": "↪",
- "HorizontalLine;": "─",
- "InvisibleComma;": "",
- "InvisibleTimes;": "",
- "LeftDownVector;": "⇃",
- "leftleftarrows;": "⇇",
- "LeftRightArrow;": "↔",
- "Leftrightarrow;": "⇔",
- "leftrightarrow;": "↔",
- "leftthreetimes;": "⋋",
- "LessSlantEqual;": "⩽",
- "LongRightArrow;": "⟶",
- "Longrightarrow;": "⟹",
- "longrightarrow;": "⟶",
- "looparrowright;": "↬",
- "LowerLeftArrow;": "↙",
- "NestedLessLess;": "≪",
- "NotGreaterLess;": "≹",
- "NotLessGreater;": "≸",
- "NotSubsetEqual;": "⊈",
- "NotVerticalBar;": "∤",
- "nshortparallel;": "∦",
- "ntriangleright;": "⋫",
- "OpenCurlyQuote;": "‘",
- "ReverseElement;": "∋",
- "rightarrowtail;": "↣",
- "rightharpoonup;": "⇀",
- "RightTeeVector;": "⥛",
- "RightVectorBar;": "⥓",
- "ShortDownArrow;": "↓",
- "ShortLeftArrow;": "←",
- "SquareSuperset;": "⊐",
- "TildeFullEqual;": "≅",
- "trianglelefteq;": "⊴",
- "upharpoonright;": "↾",
- "UpperLeftArrow;": "↖",
- "ZeroWidthSpace;": "",
- "bigtriangledown;": "▽",
- "circlearrowleft;": "↺",
- "CloseCurlyQuote;": "’",
- "ContourIntegral;": "∮",
- "curvearrowright;": "↷",
- "DoubleDownArrow;": "⇓",
- "DoubleLeftArrow;": "⇐",
- "downharpoonleft;": "⇃",
- "DownRightVector;": "⇁",
- "leftharpoondown;": "↽",
- "leftrightarrows;": "⇆",
- "LeftRightVector;": "⥎",
- "LeftTriangleBar;": "⧏",
- "LeftUpTeeVector;": "⥠",
- "LeftUpVectorBar;": "⥘",
- "LowerRightArrow;": "↘",
- "nLeftrightarrow;": "⇎",
- "nleftrightarrow;": "↮",
- "NotGreaterEqual;": "≱",
- "NotGreaterTilde;": "≵",
- "NotHumpDownHump;": "≎̸",
- "NotLeftTriangle;": "⋪",
- "NotSquareSubset;": "⊏̸",
- "ntrianglelefteq;": "⋬",
- "OverParenthesis;": "⏜",
- "RightDownVector;": "⇂",
- "rightleftarrows;": "⇄",
- "rightsquigarrow;": "↝",
- "rightthreetimes;": "⋌",
- "ShortRightArrow;": "→",
- "straightepsilon;": "ϵ",
- "trianglerighteq;": "⊵",
- "UpperRightArrow;": "↗",
- "vartriangleleft;": "⊲",
- "circlearrowright;": "↻",
- "DiacriticalAcute;": "´",
- "DiacriticalGrave;": "`",
- "DiacriticalTilde;": "˜",
- "DoubleRightArrow;": "⇒",
- "DownArrowUpArrow;": "⇵",
- "downharpoonright;": "⇂",
- "EmptySmallSquare;": "◻",
- "GreaterEqualLess;": "⋛",
- "GreaterFullEqual;": "≧",
- "LeftAngleBracket;": "⟨",
- "LeftUpDownVector;": "⥑",
- "LessEqualGreater;": "⋚",
- "NonBreakingSpace;": " ",
- "NotPrecedesEqual;": "⪯̸",
- "NotRightTriangle;": "⋫",
- "NotSucceedsEqual;": "⪰̸",
- "NotSucceedsTilde;": "≿̸",
- "NotSupersetEqual;": "⊉",
- "ntrianglerighteq;": "⋭",
- "rightharpoondown;": "⇁",
- "rightrightarrows;": "⇉",
- "RightTriangleBar;": "⧐",
- "RightUpTeeVector;": "⥜",
- "RightUpVectorBar;": "⥔",
- "twoheadleftarrow;": "↞",
- "UnderParenthesis;": "⏝",
- "UpArrowDownArrow;": "⇅",
- "vartriangleright;": "⊳",
- "blacktriangledown;": "▾",
- "blacktriangleleft;": "◂",
- "DoubleUpDownArrow;": "⇕",
- "DoubleVerticalBar;": "∥",
- "DownLeftTeeVector;": "⥞",
- "DownLeftVectorBar;": "⥖",
- "FilledSmallSquare;": "◼",
- "GreaterSlantEqual;": "⩾",
- "LeftDoubleBracket;": "⟦",
- "LeftDownTeeVector;": "⥡",
- "LeftDownVectorBar;": "⥙",
- "leftrightharpoons;": "⇋",
- "LeftTriangleEqual;": "⊴",
- "NegativeThinSpace;": "",
- "NotGreaterGreater;": "≫̸",
- "NotLessSlantEqual;": "⩽̸",
- "NotNestedLessLess;": "⪡̸",
- "NotReverseElement;": "∌",
- "NotSquareSuperset;": "⊐̸",
- "NotTildeFullEqual;": "≇",
- "RightAngleBracket;": "⟩",
- "rightleftharpoons;": "⇌",
- "RightUpDownVector;": "⥏",
- "SquareSubsetEqual;": "⊑",
- "twoheadrightarrow;": "↠",
- "VerticalSeparator;": "❘",
- "blacktriangleright;": "▸",
- "DownRightTeeVector;": "⥟",
- "DownRightVectorBar;": "⥗",
- "LongLeftRightArrow;": "⟷",
- "Longleftrightarrow;": "⟺",
- "longleftrightarrow;": "⟷",
- "NegativeThickSpace;": "",
- "NotLeftTriangleBar;": "⧏̸",
- "PrecedesSlantEqual;": "≼",
- "ReverseEquilibrium;": "⇋",
- "RightDoubleBracket;": "⟧",
- "RightDownTeeVector;": "⥝",
- "RightDownVectorBar;": "⥕",
- "RightTriangleEqual;": "⊵",
- "SquareIntersection;": "⊓",
- "SucceedsSlantEqual;": "≽",
- "DoubleLongLeftArrow;": "⟸",
- "DownLeftRightVector;": "⥐",
- "LeftArrowRightArrow;": "⇆",
- "leftrightsquigarrow;": "↭",
- "NegativeMediumSpace;": "",
- "NotGreaterFullEqual;": "≧̸",
- "NotRightTriangleBar;": "⧐̸",
- "RightArrowLeftArrow;": "⇄",
- "SquareSupersetEqual;": "⊒",
- "CapitalDifferentialD;": "ⅅ",
- "DoubleLeftRightArrow;": "⇔",
- "DoubleLongRightArrow;": "⟹",
- "EmptyVerySmallSquare;": "▫",
- "NestedGreaterGreater;": "≫",
- "NotDoubleVerticalBar;": "∦",
- "NotGreaterSlantEqual;": "⩾̸",
- "NotLeftTriangleEqual;": "⋬",
- "NotSquareSubsetEqual;": "⋢",
- "OpenCurlyDoubleQuote;": "“",
- "ReverseUpEquilibrium;": "⥯",
- "CloseCurlyDoubleQuote;": "”",
- "DoubleContourIntegral;": "∯",
- "FilledVerySmallSquare;": "▪",
- "NegativeVeryThinSpace;": "",
- "NotPrecedesSlantEqual;": "⋠",
- "NotRightTriangleEqual;": "⋭",
- "NotSucceedsSlantEqual;": "⋡",
- "DiacriticalDoubleAcute;": "˝",
- "NotSquareSupersetEqual;": "⋣",
- "NotNestedGreaterGreater;": "⪢̸",
- "ClockwiseContourIntegral;": "∲",
- "DoubleLongLeftRightArrow;": "⟺",
- "CounterClockwiseContourIntegral;": "∳"
- };
- // lazy compute this to make this file tree-shakable for browser
- let maxCRNameLength;
- const decodeHtml = (rawText, asAttr) => {
- let offset = 0;
- const end = rawText.length;
- let decodedText = '';
- function advance(length) {
- offset += length;
- rawText = rawText.slice(length);
- }
- while (offset < end) {
- const head = /&(?:#x?)?/i.exec(rawText);
- if (!head || offset + head.index >= end) {
- const remaining = end - offset;
- decodedText += rawText.slice(0, remaining);
- advance(remaining);
- break;
- }
- // Advance to the "&".
- decodedText += rawText.slice(0, head.index);
- advance(head.index);
- if (head[0] === '&') {
- // Named character reference.
- let name = '';
- let value = undefined;
- if (/[0-9a-z]/i.test(rawText[1])) {
- if (!maxCRNameLength) {
- maxCRNameLength = Object.keys(namedCharacterReferences).reduce((max, name) => Math.max(max, name.length), 0);
- }
- for (let length = maxCRNameLength; !value && length > 0; --length) {
- name = rawText.substr(1, length);
- value = namedCharacterReferences[name];
- }
- if (value) {
- const semi = name.endsWith(';');
- if (asAttr &&
- !semi &&
- /[=a-z0-9]/i.test(rawText[name.length + 1] || '')) {
- decodedText += '&' + name;
- advance(1 + name.length);
- }
- else {
- decodedText += value;
- advance(1 + name.length);
- }
- }
- else {
- decodedText += '&' + name;
- advance(1 + name.length);
- }
- }
- else {
- decodedText += '&';
- advance(1);
- }
- }
- else {
- // Numeric character reference.
- const hex = head[0] === '&#x';
- const pattern = hex ? /^&#x([0-9a-f]+);?/i : /^&#([0-9]+);?/;
- const body = pattern.exec(rawText);
- if (!body) {
- decodedText += head[0];
- advance(head[0].length);
- }
- else {
- // https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
- let cp = Number.parseInt(body[1], hex ? 16 : 10);
- if (cp === 0) {
- cp = 0xfffd;
- }
- else if (cp > 0x10ffff) {
- cp = 0xfffd;
- }
- else if (cp >= 0xd800 && cp <= 0xdfff) {
- cp = 0xfffd;
- }
- else if ((cp >= 0xfdd0 && cp <= 0xfdef) || (cp & 0xfffe) === 0xfffe) ;
- else if ((cp >= 0x01 && cp <= 0x08) ||
- cp === 0x0b ||
- (cp >= 0x0d && cp <= 0x1f) ||
- (cp >= 0x7f && cp <= 0x9f)) {
- cp = CCR_REPLACEMENTS[cp] || cp;
- }
- decodedText += String.fromCodePoint(cp);
- advance(body[0].length);
- }
- }
- }
- return decodedText;
- };
- // https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
- const CCR_REPLACEMENTS = {
- 0x80: 0x20ac,
- 0x82: 0x201a,
- 0x83: 0x0192,
- 0x84: 0x201e,
- 0x85: 0x2026,
- 0x86: 0x2020,
- 0x87: 0x2021,
- 0x88: 0x02c6,
- 0x89: 0x2030,
- 0x8a: 0x0160,
- 0x8b: 0x2039,
- 0x8c: 0x0152,
- 0x8e: 0x017d,
- 0x91: 0x2018,
- 0x92: 0x2019,
- 0x93: 0x201c,
- 0x94: 0x201d,
- 0x95: 0x2022,
- 0x96: 0x2013,
- 0x97: 0x2014,
- 0x98: 0x02dc,
- 0x99: 0x2122,
- 0x9a: 0x0161,
- 0x9b: 0x203a,
- 0x9c: 0x0153,
- 0x9e: 0x017e,
- 0x9f: 0x0178
- };
- const isRawTextContainer = /*#__PURE__*/ shared.makeMap('style,iframe,script,noscript', true);
- const parserOptions = {
- isVoidTag: shared.isVoidTag,
- isNativeTag: tag => shared.isHTMLTag(tag) || shared.isSVGTag(tag),
- isPreTag: tag => tag === 'pre',
- decodeEntities: decodeHtml,
- isBuiltInComponent: (tag) => {
- if (compilerCore.isBuiltInType(tag, `Transition`)) {
- return TRANSITION;
- }
- else if (compilerCore.isBuiltInType(tag, `TransitionGroup`)) {
- return TRANSITION_GROUP;
- }
- },
- // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
- getNamespace(tag, parent) {
- let ns = parent ? parent.ns : 0 /* HTML */;
- if (parent && ns === 2 /* MATH_ML */) {
- if (parent.tag === 'annotation-xml') {
- if (tag === 'svg') {
- return 1 /* SVG */;
- }
- if (parent.props.some(a => a.type === 6 /* ATTRIBUTE */ &&
- a.name === 'encoding' &&
- a.value != null &&
- (a.value.content === 'text/html' ||
- a.value.content === 'application/xhtml+xml'))) {
- ns = 0 /* HTML */;
- }
- }
- else if (/^m(?:[ions]|text)$/.test(parent.tag) &&
- tag !== 'mglyph' &&
- tag !== 'malignmark') {
- ns = 0 /* HTML */;
- }
- }
- else if (parent && ns === 1 /* SVG */) {
- if (parent.tag === 'foreignObject' ||
- parent.tag === 'desc' ||
- parent.tag === 'title') {
- ns = 0 /* HTML */;
- }
- }
- if (ns === 0 /* HTML */) {
- if (tag === 'svg') {
- return 1 /* SVG */;
- }
- if (tag === 'math') {
- return 2 /* MATH_ML */;
- }
- }
- return ns;
- },
- // https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments
- getTextMode({ tag, ns }) {
- if (ns === 0 /* HTML */) {
- if (tag === 'textarea' || tag === 'title') {
- return 1 /* RCDATA */;
- }
- if (isRawTextContainer(tag)) {
- return 2 /* RAWTEXT */;
- }
- }
- return 0 /* DATA */;
- }
- };
- // Parse inline CSS strings for static style attributes into an object.
- // This is a NodeTransform since it works on the static `style` attribute and
- // converts it into a dynamic equivalent:
- // style="color: red" -> :style='{ "color": "red" }'
- // It is then processed by `transformElement` and included in the generated
- // props.
- const transformStyle = node => {
- if (node.type === 1 /* ELEMENT */) {
- node.props.forEach((p, i) => {
- if (p.type === 6 /* ATTRIBUTE */ && p.name === 'style' && p.value) {
- // replace p with an expression node
- node.props[i] = {
- type: 7 /* DIRECTIVE */,
- name: `bind`,
- arg: compilerCore.createSimpleExpression(`style`, true, p.loc),
- exp: parseInlineCSS(p.value.content, p.loc),
- modifiers: [],
- loc: p.loc
- };
- }
- });
- }
- };
- const parseInlineCSS = (cssText, loc) => {
- const normalized = shared.parseStringStyle(cssText);
- return compilerCore.createSimpleExpression(JSON.stringify(normalized), false, loc, 3 /* CAN_STRINGIFY */);
- };
- function createDOMCompilerError(code, loc) {
- return compilerCore.createCompilerError(code, loc, DOMErrorMessages );
- }
- const DOMErrorMessages = {
- [49 /* X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,
- [50 /* X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,
- [51 /* X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,
- [52 /* X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,
- [53 /* X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
- [54 /* X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,
- [55 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
- [56 /* X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
- [57 /* X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,
- [58 /* X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,
- [59 /* X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
- };
- const transformVHtml = (dir, node, context) => {
- const { exp, loc } = dir;
- if (!exp) {
- context.onError(createDOMCompilerError(49 /* X_V_HTML_NO_EXPRESSION */, loc));
- }
- if (node.children.length) {
- context.onError(createDOMCompilerError(50 /* X_V_HTML_WITH_CHILDREN */, loc));
- node.children.length = 0;
- }
- return {
- props: [
- compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`innerHTML`, true, loc), exp || compilerCore.createSimpleExpression('', true))
- ]
- };
- };
- const transformVText = (dir, node, context) => {
- const { exp, loc } = dir;
- if (!exp) {
- context.onError(createDOMCompilerError(51 /* X_V_TEXT_NO_EXPRESSION */, loc));
- }
- if (node.children.length) {
- context.onError(createDOMCompilerError(52 /* X_V_TEXT_WITH_CHILDREN */, loc));
- node.children.length = 0;
- }
- return {
- props: [
- compilerCore.createObjectProperty(compilerCore.createSimpleExpression(`textContent`, true), exp
- ? compilerCore.createCallExpression(context.helperString(compilerCore.TO_DISPLAY_STRING), [exp], loc)
- : compilerCore.createSimpleExpression('', true))
- ]
- };
- };
- const transformModel = (dir, node, context) => {
- const baseResult = compilerCore.transformModel(dir, node, context);
- // base transform has errors OR component v-model (only need props)
- if (!baseResult.props.length || node.tagType === 1 /* COMPONENT */) {
- return baseResult;
- }
- if (dir.arg) {
- context.onError(createDOMCompilerError(54 /* X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));
- }
- function checkDuplicatedValue() {
- const value = compilerCore.findProp(node, 'value');
- if (value) {
- context.onError(createDOMCompilerError(56 /* X_V_MODEL_UNNECESSARY_VALUE */, value.loc));
- }
- }
- const { tag } = node;
- const isCustomElement = context.isCustomElement(tag);
- if (tag === 'input' ||
- tag === 'textarea' ||
- tag === 'select' ||
- isCustomElement) {
- let directiveToUse = V_MODEL_TEXT;
- let isInvalidType = false;
- if (tag === 'input' || isCustomElement) {
- const type = compilerCore.findProp(node, `type`);
- if (type) {
- if (type.type === 7 /* DIRECTIVE */) {
- // :type="foo"
- directiveToUse = V_MODEL_DYNAMIC;
- }
- else if (type.value) {
- switch (type.value.content) {
- case 'radio':
- directiveToUse = V_MODEL_RADIO;
- break;
- case 'checkbox':
- directiveToUse = V_MODEL_CHECKBOX;
- break;
- case 'file':
- isInvalidType = true;
- context.onError(createDOMCompilerError(55 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));
- break;
- default:
- // text type
- checkDuplicatedValue();
- break;
- }
- }
- }
- else if (compilerCore.hasDynamicKeyVBind(node)) {
- // element has bindings with dynamic keys, which can possibly contain
- // "type".
- directiveToUse = V_MODEL_DYNAMIC;
- }
- else {
- // text type
- checkDuplicatedValue();
- }
- }
- else if (tag === 'select') {
- directiveToUse = V_MODEL_SELECT;
- }
- else {
- // textarea
- checkDuplicatedValue();
- }
- // inject runtime directive
- // by returning the helper symbol via needRuntime
- // the import will replaced a resolveDirective call.
- if (!isInvalidType) {
- baseResult.needRuntime = context.helper(directiveToUse);
- }
- }
- else {
- context.onError(createDOMCompilerError(53 /* X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));
- }
- // native vmodel doesn't need the `modelValue` props since they are also
- // passed to the runtime as `binding.value`. removing it reduces code size.
- baseResult.props = baseResult.props.filter(p => !(p.key.type === 4 /* SIMPLE_EXPRESSION */ &&
- p.key.content === 'modelValue'));
- return baseResult;
- };
- const isEventOptionModifier = /*#__PURE__*/ shared.makeMap(`passive,once,capture`);
- const isNonKeyModifier = /*#__PURE__*/ shared.makeMap(
- // event propagation management
- `stop,prevent,self,` +
- // system modifiers + exact
- `ctrl,shift,alt,meta,exact,` +
- // mouse
- `middle`);
- // left & right could be mouse or key modifiers based on event type
- const maybeKeyModifier = /*#__PURE__*/ shared.makeMap('left,right');
- const isKeyboardEvent = /*#__PURE__*/ shared.makeMap(`onkeyup,onkeydown,onkeypress`, true);
- const resolveModifiers = (key, modifiers, context, loc) => {
- const keyModifiers = [];
- const nonKeyModifiers = [];
- const eventOptionModifiers = [];
- for (let i = 0; i < modifiers.length; i++) {
- const modifier = modifiers[i];
- if (modifier === 'native' &&
- compilerCore.checkCompatEnabled("COMPILER_V_ON_NATIVE" /* COMPILER_V_ON_NATIVE */, context, loc)) {
- eventOptionModifiers.push(modifier);
- }
- else if (isEventOptionModifier(modifier)) {
- // eventOptionModifiers: modifiers for addEventListener() options,
- // e.g. .passive & .capture
- eventOptionModifiers.push(modifier);
- }
- else {
- // runtimeModifiers: modifiers that needs runtime guards
- if (maybeKeyModifier(modifier)) {
- if (compilerCore.isStaticExp(key)) {
- if (isKeyboardEvent(key.content)) {
- keyModifiers.push(modifier);
- }
- else {
- nonKeyModifiers.push(modifier);
- }
- }
- else {
- keyModifiers.push(modifier);
- nonKeyModifiers.push(modifier);
- }
- }
- else {
- if (isNonKeyModifier(modifier)) {
- nonKeyModifiers.push(modifier);
- }
- else {
- keyModifiers.push(modifier);
- }
- }
- }
- }
- return {
- keyModifiers,
- nonKeyModifiers,
- eventOptionModifiers
- };
- };
- const transformClick = (key, event) => {
- const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === 'onclick';
- return isStaticClick
- ? compilerCore.createSimpleExpression(event, true)
- : key.type !== 4 /* SIMPLE_EXPRESSION */
- ? compilerCore.createCompoundExpression([
- `(`,
- key,
- `) === "onClick" ? "${event}" : (`,
- key,
- `)`
- ])
- : key;
- };
- const transformOn = (dir, node, context) => {
- return compilerCore.transformOn(dir, node, context, baseResult => {
- const { modifiers } = dir;
- if (!modifiers.length)
- return baseResult;
- let { key, value: handlerExp } = baseResult.props[0];
- const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
- // normalize click.right and click.middle since they don't actually fire
- if (nonKeyModifiers.includes('right')) {
- key = transformClick(key, `onContextmenu`);
- }
- if (nonKeyModifiers.includes('middle')) {
- key = transformClick(key, `onMouseup`);
- }
- if (nonKeyModifiers.length) {
- handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
- handlerExp,
- JSON.stringify(nonKeyModifiers)
- ]);
- }
- if (keyModifiers.length &&
- // if event name is dynamic, always wrap with keys guard
- (!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content))) {
- handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
- handlerExp,
- JSON.stringify(keyModifiers)
- ]);
- }
- if (eventOptionModifiers.length) {
- const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join('');
- key = compilerCore.isStaticExp(key)
- ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true)
- : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
- }
- return {
- props: [compilerCore.createObjectProperty(key, handlerExp)]
- };
- });
- };
- const transformShow = (dir, node, context) => {
- const { exp, loc } = dir;
- if (!exp) {
- context.onError(createDOMCompilerError(57 /* X_V_SHOW_NO_EXPRESSION */, loc));
- }
- return {
- props: [],
- needRuntime: context.helper(V_SHOW)
- };
- };
- const warnTransitionChildren = (node, context) => {
- if (node.type === 1 /* ELEMENT */ &&
- node.tagType === 1 /* COMPONENT */) {
- const component = context.isBuiltInComponent(node.tag);
- if (component === TRANSITION) {
- return () => {
- if (node.children.length && hasMultipleChildren(node)) {
- context.onError(createDOMCompilerError(58 /* X_TRANSITION_INVALID_CHILDREN */, {
- start: node.children[0].loc.start,
- end: node.children[node.children.length - 1].loc.end,
- source: ''
- }));
- }
- };
- }
- }
- };
- function hasMultipleChildren(node) {
- // #1352 filter out potential comment nodes.
- const children = (node.children = node.children.filter(c => c.type !== 3 /* COMMENT */));
- const child = children[0];
- return (children.length !== 1 ||
- child.type === 11 /* FOR */ ||
- (child.type === 9 /* IF */ && child.branches.some(hasMultipleChildren)));
- }
- /**
- * This module is Node-only.
- */
- /**
- * Turn eligible hoisted static trees into stringified static nodes, e.g.
- *
- * ```js
- * const _hoisted_1 = createStaticVNode(`<div class="foo">bar</div>`)
- * ```
- *
- * A single static vnode can contain stringified content for **multiple**
- * consecutive nodes (element and plain text), called a "chunk".
- * `@vue/runtime-dom` will create the content via innerHTML in a hidden
- * container element and insert all the nodes in place. The call must also
- * provide the number of nodes contained in the chunk so that during hydration
- * we can know how many nodes the static vnode should adopt.
- *
- * The optimization scans a children list that contains hoisted nodes, and
- * tries to find the largest chunk of consecutive hoisted nodes before running
- * into a non-hoisted node or the end of the list. A chunk is then converted
- * into a single static vnode and replaces the hoisted expression of the first
- * node in the chunk. Other nodes in the chunk are considered "merged" and
- * therefore removed from both the hoist list and the children array.
- *
- * This optimization is only performed in Node.js.
- */
- const stringifyStatic = (children, context, parent) => {
- // bail stringification for slot content
- if (context.scopes.vSlot > 0) {
- return;
- }
- let nc = 0; // current node count
- let ec = 0; // current element with binding count
- const currentChunk = [];
- const stringifyCurrentChunk = (currentIndex) => {
- if (nc >= 20 /* NODE_COUNT */ ||
- ec >= 5 /* ELEMENT_WITH_BINDING_COUNT */) {
- // combine all currently eligible nodes into a single static vnode call
- const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [
- JSON.stringify(currentChunk.map(node => stringifyNode(node, context)).join('')),
- // the 2nd argument indicates the number of DOM nodes this static vnode
- // will insert / hydrate
- String(currentChunk.length)
- ]);
- // replace the first node's hoisted expression with the static vnode call
- replaceHoist(currentChunk[0], staticCall, context);
- if (currentChunk.length > 1) {
- for (let i = 1; i < currentChunk.length; i++) {
- // for the merged nodes, set their hoisted expression to null
- replaceHoist(currentChunk[i], null, context);
- }
- // also remove merged nodes from children
- const deleteCount = currentChunk.length - 1;
- children.splice(currentIndex - currentChunk.length + 1, deleteCount);
- return deleteCount;
- }
- }
- return 0;
- };
- let i = 0;
- for (; i < children.length; i++) {
- const child = children[i];
- const hoisted = getHoistedNode(child);
- if (hoisted) {
- // presence of hoisted means child must be a stringifiable node
- const node = child;
- const result = analyzeNode(node);
- if (result) {
- // node is stringifiable, record state
- nc += result[0];
- ec += result[1];
- currentChunk.push(node);
- continue;
- }
- }
- // we only reach here if we ran into a node that is not stringifiable
- // check if currently analyzed nodes meet criteria for stringification.
- // adjust iteration index
- i -= stringifyCurrentChunk(i);
- // reset state
- nc = 0;
- ec = 0;
- currentChunk.length = 0;
- }
- // in case the last node was also stringifiable
- stringifyCurrentChunk(i);
- };
- const getHoistedNode = (node) => ((node.type === 1 /* ELEMENT */ && node.tagType === 0 /* ELEMENT */) ||
- node.type == 12 /* TEXT_CALL */) &&
- node.codegenNode &&
- node.codegenNode.type === 4 /* SIMPLE_EXPRESSION */ &&
- node.codegenNode.hoisted;
- const dataAriaRE = /^(data|aria)-/;
- const isStringifiableAttr = (name, ns) => {
- return ((ns === 0 /* HTML */
- ? shared.isKnownHtmlAttr(name)
- : ns === 1 /* SVG */
- ? shared.isKnownSvgAttr(name)
- : false) || dataAriaRE.test(name));
- };
- const replaceHoist = (node, replacement, context) => {
- const hoistToReplace = node.codegenNode.hoisted;
- context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement;
- };
- const isNonStringifiable = /*#__PURE__*/ shared.makeMap(`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`);
- /**
- * for a hoisted node, analyze it and return:
- * - false: bailed (contains runtime constant)
- * - [nc, ec] where
- * - nc is the number of nodes inside
- * - ec is the number of element with bindings inside
- */
- function analyzeNode(node) {
- if (node.type === 1 /* ELEMENT */ && isNonStringifiable(node.tag)) {
- return false;
- }
- if (node.type === 12 /* TEXT_CALL */) {
- return [1, 0];
- }
- let nc = 1; // node count
- let ec = node.props.length > 0 ? 1 : 0; // element w/ binding count
- let bailed = false;
- const bail = () => {
- bailed = true;
- return false;
- };
- // TODO: check for cases where using innerHTML will result in different
- // output compared to imperative node insertions.
- // probably only need to check for most common case
- // i.e. non-phrasing-content tags inside `<p>`
- function walk(node) {
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- // bail on non-attr bindings
- if (p.type === 6 /* ATTRIBUTE */ &&
- !isStringifiableAttr(p.name, node.ns)) {
- return bail();
- }
- if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind') {
- // bail on non-attr bindings
- if (p.arg &&
- (p.arg.type === 8 /* COMPOUND_EXPRESSION */ ||
- (p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns)))) {
- return bail();
- }
- }
- }
- for (let i = 0; i < node.children.length; i++) {
- nc++;
- const child = node.children[i];
- if (child.type === 1 /* ELEMENT */) {
- if (child.props.length > 0) {
- ec++;
- }
- walk(child);
- if (bailed) {
- return false;
- }
- }
- }
- return true;
- }
- return walk(node) ? [nc, ec] : false;
- }
- function stringifyNode(node, context) {
- if (shared.isString(node)) {
- return node;
- }
- if (shared.isSymbol(node)) {
- return ``;
- }
- switch (node.type) {
- case 1 /* ELEMENT */:
- return stringifyElement(node, context);
- case 2 /* TEXT */:
- return shared.escapeHtml(node.content);
- case 3 /* COMMENT */:
- return `<!--${shared.escapeHtml(node.content)}-->`;
- case 5 /* INTERPOLATION */:
- return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content)));
- case 8 /* COMPOUND_EXPRESSION */:
- return shared.escapeHtml(evaluateConstant(node));
- case 12 /* TEXT_CALL */:
- return stringifyNode(node.content, context);
- default:
- // static trees will not contain if/for nodes
- return '';
- }
- }
- function stringifyElement(node, context) {
- let res = `<${node.tag}`;
- for (let i = 0; i < node.props.length; i++) {
- const p = node.props[i];
- if (p.type === 6 /* ATTRIBUTE */) {
- res += ` ${p.name}`;
- if (p.value) {
- res += `="${shared.escapeHtml(p.value.content)}"`;
- }
- }
- else if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind') {
- // constant v-bind, e.g. :foo="1"
- let evaluated = evaluateConstant(p.exp);
- if (evaluated != null) {
- const arg = p.arg && p.arg.content;
- if (arg === 'class') {
- evaluated = shared.normalizeClass(evaluated);
- }
- else if (arg === 'style') {
- evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated));
- }
- res += ` ${p.arg.content}="${shared.escapeHtml(evaluated)}"`;
- }
- }
- }
- if (context.scopeId) {
- res += ` ${context.scopeId}`;
- }
- res += `>`;
- for (let i = 0; i < node.children.length; i++) {
- res += stringifyNode(node.children[i], context);
- }
- if (!shared.isVoidTag(node.tag)) {
- res += `</${node.tag}>`;
- }
- return res;
- }
- // __UNSAFE__
- // Reason: eval.
- // It's technically safe to eval because only constant expressions are possible
- // here, e.g. `{{ 1 }}` or `{{ 'foo' }}`
- // in addition, constant exps bail on presence of parens so you can't even
- // run JSFuck in here. But we mark it unsafe for security review purposes.
- // (see compiler-core/src/transformExpressions)
- function evaluateConstant(exp) {
- if (exp.type === 4 /* SIMPLE_EXPRESSION */) {
- return new Function(`return ${exp.content}`)();
- }
- else {
- // compound
- let res = ``;
- exp.children.forEach(c => {
- if (shared.isString(c) || shared.isSymbol(c)) {
- return;
- }
- if (c.type === 2 /* TEXT */) {
- res += c.content;
- }
- else if (c.type === 5 /* INTERPOLATION */) {
- res += shared.toDisplayString(evaluateConstant(c.content));
- }
- else {
- res += evaluateConstant(c);
- }
- });
- return res;
- }
- }
- const ignoreSideEffectTags = (node, context) => {
- if (node.type === 1 /* ELEMENT */ &&
- node.tagType === 0 /* ELEMENT */ &&
- (node.tag === 'script' || node.tag === 'style')) {
- context.onError(createDOMCompilerError(59 /* X_IGNORED_SIDE_EFFECT_TAG */, node.loc));
- context.removeNode();
- }
- };
- const DOMNodeTransforms = [
- transformStyle,
- ...([warnTransitionChildren] )
- ];
- const DOMDirectiveTransforms = {
- cloak: compilerCore.noopDirectiveTransform,
- html: transformVHtml,
- text: transformVText,
- model: transformModel,
- on: transformOn,
- show: transformShow
- };
- function compile(template, options = {}) {
- return compilerCore.baseCompile(template, shared.extend({}, parserOptions, options, {
- nodeTransforms: [
- // ignore <script> and <tag>
- // this is not put inside DOMNodeTransforms because that list is used
- // by compiler-ssr to generate vnode fallback branches
- ignoreSideEffectTags,
- ...DOMNodeTransforms,
- ...(options.nodeTransforms || [])
- ],
- directiveTransforms: shared.extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
- transformHoist: stringifyStatic
- }));
- }
- function parse(template, options = {}) {
- return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
- }
- Object.keys(compilerCore).forEach(function (k) {
- if (k !== 'default') exports[k] = compilerCore[k];
- });
- exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
- exports.DOMNodeTransforms = DOMNodeTransforms;
- exports.TRANSITION = TRANSITION;
- exports.TRANSITION_GROUP = TRANSITION_GROUP;
- exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
- exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
- exports.V_MODEL_RADIO = V_MODEL_RADIO;
- exports.V_MODEL_SELECT = V_MODEL_SELECT;
- exports.V_MODEL_TEXT = V_MODEL_TEXT;
- exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
- exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
- exports.V_SHOW = V_SHOW;
- exports.compile = compile;
- exports.createDOMCompilerError = createDOMCompilerError;
- exports.parse = parse;
- exports.parserOptions = parserOptions;
- exports.transformStyle = transformStyle;
- }(compilerDom_cjs$2));
- var compilerDom_cjs = /*@__PURE__*/build.getDefaultExportFromCjs(compilerDom_cjs$2);
- var compilerDom_cjs$1 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), compilerDom_cjs$2, {
- 'default': compilerDom_cjs
- });
- exports.compilerDom_cjs = compilerDom_cjs$1;
- //# sourceMappingURL=dep-b541373d.js.map
|