Skip to main content
Module

x/rambda/files/index.d.ts

Faster and smaller alternative to Ramda
Latest
File
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384
export type RambdaTypes = "Object" | "Number" | "Boolean" | "String" | "Null" | "Array" | "RegExp" | "NaN" | "Function" | "Undefined" | "Async" | "Promise" | "Symbol" | "Set" | "Error" | "Map" | "WeakMap" | "Generator" | "GeneratorFunction" | "BigInt" | "ArrayBuffer" | "Date"
type LastArrayElement<ValueType extends readonly unknown[]> = ValueType extends readonly [infer ElementType] ? ElementType : ValueType extends readonly [infer _, ...infer Tail] ? LastArrayElement<Tail> : ValueType extends ReadonlyArray<infer ElementType> ? ElementType : never;type FirstArrayElement<ValueType extends readonly unknown[]> = ValueType extends readonly [infer ElementType] ? ElementType : ValueType extends readonly [...infer Head, infer _] ? FirstArrayElement<Head> : ValueType extends ReadonlyArray<infer ElementType> ? ElementType : never;
export function reduceStopper<T>(input: T) : Texport type IndexedIterator<T, U> = (x: T, i: number) => U;export type Iterator<T, U> = (x: T) => U;export type ObjectIterator<T, U> = (x: T, prop: string, inputObj: Dictionary<T>) => U;type Ord = number | string | boolean | Date;type Ordering = -1 | 0 | 1;type Path = string | (number | string)[];export type RamdaPath = (number | string)[];type Predicate<T> = (x: T) => boolean;export type IndexedPredicate<T> = (x: T, i: number) => boolean;export type ObjectPredicate<T> = (x: T, prop: string, inputObj: Dictionary<T>) => boolean;type CondPair<T extends any[], R> = [(...val: T) => boolean, (...val: T) => R]type Prop<T, P extends keyof never> = P extends keyof Exclude<T, undefined> ? T extends undefined ? undefined : T[Extract<P, keyof T>] : undefined;type ValueOfRecord<R> = R extends Record<any, infer T> ? T : never;interface KeyValuePair<K, V> extends Array<K | V> { 0: K; 1: V;}export type Functor<A> = { map: <B>(fn: (a: A) => B) => Functor<B>; [key: string]: any };export type Lens<S, A> = (functorFactory: (a: A) => Functor<A>) => (s: S) => Functor<S>;
export type ObjPred<T = unknown> = (value: any, key: unknown extends T ? string : keyof T) => boolean;
type Arity1Fn = (x: any) => any;type Arity2Fn = (x: any, y: any) => any;
type Pred = (...x: any[]) => boolean;
export interface Dictionary<T> {[index: string]: T}type Partial<T> = { [P in keyof T]?: T[P]};
type _TupleOf<T, N extends number, R extends unknown[]> = R['length'] extends N ? R : _TupleOf<T, N, [T, ...R]>;export type Tuple<T, N extends number> = N extends N ? (number extends N ? T[] : _TupleOf<T, N, []>) : never;
type Evolvable<E extends Evolver> = {[P in keyof E]?: Evolved<E[P]>};
type Evolver<T extends Evolvable<any> = any> = { [key in keyof Partial<T>]: ((value: T[key]) => T[key]) | (T[key] extends Evolvable<any> ? Evolver<T[key]> : never);};
type Evolve<O extends Evolvable<E>, E extends Evolver> = { [P in keyof O]: P extends keyof E ? EvolveValue<O[P], E[P]> : O[P];};
type Evolved<A> = A extends (value: infer V) => any ? V : A extends Evolver ? Evolvable<A> : never;type EvolveNestedValue<O, E extends Evolver> = O extends object ? O extends Evolvable<E> ? Evolve<O, E> : never : never;type EvolveValue<V, E> = E extends (value: V) => any ? ReturnType<E> : E extends Evolver ? EvolveNestedValue<V, E> : never;interface AssocPartialOne<K extends keyof any> { <T>(val: T): <U>(obj: U) => Record<K, T> & U; <T, U>(val: T, obj: U): Record<K, T> & U;}type AtLeastOneFunctionsFlowFromRightToLeft<TArgs extends any[], TResult> = | [(...args: any) => TResult, ...Array<(args: any) => any>, (...args: TArgs) => any] | [(...args: TArgs) => TResult];type AnyFunction = (...args: any[]) => unknown;type AnyConstructor = new (...args: any[]) => unknown;
type RegExpReplacerFn = | ((m: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, p2: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, p2: string, p3: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, p2: string, p3: string, p4: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, p6: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, p6: string, p7: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, p6: string, p7: string, p8: string, offset: number, s: string, groups?: Record<string, string>) => string) | ((m: string, p1: string, p2: string, p3: string, p4: string, p5: string, p6: string, p7: string, p8: string, p9: string, offset: number, s: string, groups?: Record<string, string>) => string)type RegExpReplacer = string | RegExpReplacerFn
/** `TSuper`, when `TSuper` is a supertype of `T`; otherwise `never`. */type IsFirstSubtypeOfSecond<First, Second> = (First extends Second ? Second : never);
// RAMBDAX INTERFACES// ============================================type Func<T> = (input: any) => T;type VoidInputFunc<T> = () => T;type Fn<In, Out> = (x: In) => Out;type SortObjectPredicate<T> = (aProp: string, bProp: string, aValue: T, bValue: T) => number;
type IdentityFunction<T> = (x: T) => T;
interface Filter<T> { (list: T[]): T[]; (obj: Dictionary<T>): Dictionary<T>;}
type ArgumentTypes<T> = T extends (...args: infer U) => infer R ? U : never;type isfn<T> = (x: any, y: any) => T;
interface Switchem<T> { is: isfn<Switchem<T>>; default: IdentityFunction<T>;}
interface Schema { [key: string]: any;}
interface SchemaAsync { [key: string]: Promise<boolean>;}
export interface IsValid { input: object; schema: Schema;}
export interface IsValidAsync { input: object; schema: Schema | SchemaAsync;}
type ProduceRules<Output,K extends keyof Output, Input> = { [P in K]: (input: Input) => Output[P];};type ProduceAsyncRules<Output,K extends keyof Output, Input> = { [P in K]: (input: Input) => Promise<Output[P]>;};type ProduceAsyncRule<Input> = (input: Input) => Promise<any>;type Async<T> = (x: any) => Promise<T>;type AsyncIterable<T, K> = (x: T) => Promise<K>;type AsyncIterableIndexed<T, K> = (x: T, i: number) => Promise<K>;type AsyncPredicate<T> = (x: T) => Promise<boolean>;type AsyncPredicateIndexed<T> = (x: T, i: number) => Promise<boolean>;type AsyncWithProp<T> = (x: any, prop?: string) => Promise<T>;
type ApplyDiffUpdate = {op:'update', path: string, value: any};type ApplyDiffAdd = {op:'add', path: string, value: any};type ApplyDiffRemove = {op:'remove', path: string};type ApplyDiffRule = ApplyDiffUpdate | ApplyDiffAdd | ApplyDiffRemove;
// API_MARKER
/*Method: add
Explanation:
It adds `a` and `b`.
Example:
```R.add(2, 3) // => 5```
Categories: Number
Notes: It doesn't work with strings, as the inputs are parsed to numbers before calculation.
*/// @SINGLE_MARKERexport function add(a: number, b: number): number;export function add(a: number): (b: number) => number;
/*Method: adjust
Explanation:
It replaces `index` in array `list` with the result of `replaceFn(list[i])`.
Example:
```const result = R.adjust( 0, a => a + 1, [0, 100]) // => [1, 100]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function adjust<T>(index: number, replaceFn: (x: T) => T, list: T[]): T[];export function adjust<T>(index: number, replaceFn: (x: T) => T): (list: T[]) => T[];
/*Method: all
Explanation: It returns `true`, if all members of array `list` returns `true`, when applied as argument to `predicate` function.
Example:
```const list = [ 0, 1, 2, 3, 4 ]const predicate = x => x > -1
const result = R.all(predicate, list)// => true```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function all<T>(predicate: (x: T) => boolean, list: T[]): boolean;export function all<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
/*Method: allPass
Explanation: It returns `true`, if all functions of `predicates` return `true`, when `input` is their argument.
Example:
```const input = { a : 1, b : 2,}const predicates = [ x => x.a === 1, x => x.b === 2,]const result = R.allPass(predicates)(input) // => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function allPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;export function allPass<T>(predicates: ((...inputs: T[]) => boolean)[]): (...inputs: T[]) => boolean;
/*Method: always
Explanation: It returns function that always returns `x`.
Example:
```const fn = R.always(7)
const result = fn()// => 7```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function always<T>(x: T): (...args: unknown[]) => T;
/*Method: and
Explanation: Logical AND
Example:
```R.and(true, true); // => trueR.and(false, true); // => falseR.and(true, 'foo'); // => 'foo'```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function and<T, U>(x: T, y: U): T | U;export function and<T>(x: T): <U>(y: U) => T | U;
/*Method: or
Explanation: Logical OR
Example:
```R.or(false, true); // => trueR.or(false, false); // => falseR.or(false, 'foo'); // => 'foo'```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function or<T, U>(a: T, b: U): T | U;export function or<T>(a: T): <U>(b: U) => T | U;
/*Method: any
Explanation: It returns `true`, if at least one member of `list` returns true, when passed to a `predicate` function.
Example:
```const list = [1, 2, 3]const predicate = x => x * x > 8R.any(fn, list)// => true```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function any<T>(predicate: (x: T) => boolean, list: T[]): boolean;export function any<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
/*Method: anyPass
Explanation: It accepts list of `predicates` and returns a function. This function with its `input` will return `true`, if any of `predicates` returns `true` for this `input`.
Example:
```const isBig = x => x > 20const isOdd = x => x % 2 === 1const input = 11
const fn = R.anyPass( [isBig, isOdd])
const result = fn(input) // => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function anyPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;export function anyPass<T>(predicates: ((...inputs: T[]) => boolean)[]): (...inputs: T[]) => boolean;
/*Method: append
Explanation: It adds element `x` at the end of `iterable`.
Example:
```const x = 'foo'
const result = R.append(x, ['bar', 'baz'])// => ['bar', 'baz', 'foo']```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function append<T>(xToAppend: T, iterable: T[]): T[];export function append<T, U>(xToAppend: T, iterable: IsFirstSubtypeOfSecond<T, U>[]) : U[];export function append<T>(xToAppend: T): <U>(iterable: IsFirstSubtypeOfSecond<T, U>[]) => U[];export function append<T>(xToAppend: T): (iterable: T[]) => T[];
/*Method: applySpec
Explanation:
Example:
```const fn = R.applySpec({ sum: R.add, nested: { mul: R.multiply }})const result = fn(2, 4) // => { sum: 6, nested: { mul: 8 } }```
Categories: Logic
Notes: The currying in this function works best with functions with 4 arguments or less. (arity of 4)
*/// @SINGLE_MARKERexport function applySpec<Spec extends Record<string, AnyFunction>>( spec: Spec): ( ...args: Parameters<ValueOfRecord<Spec>>) => { [Key in keyof Spec]: ReturnType<Spec[Key]> };export function applySpec<T>(spec: any): (...args: unknown[]) => T;
/*Method: assoc
Explanation: It makes a shallow clone of `obj` with setting or overriding the property `prop` with `newValue`.
Example:
```R.assoc('c', 3, {a: 1, b: 2})// => {a: 1, b: 2, c: 3}```
Categories: Object
Notes: This copies and flattens prototype propertiesonto the new object as well. All non-primitive properties are copied byreference.
*/// @SINGLE_MARKERexport function assoc<T, U, K extends string>(prop: K, val: T, obj: U): Record<K, T> & Omit<U, K>;export function assoc<T, K extends string>(prop: K, val: T): <U>(obj: U) => Record<K, T> & Omit<U, K>;export function assoc<K extends string>(prop: K): AssocPartialOne<K>;
/*Method: assocPath
Explanation: It makes a shallow clone of `obj` with setting or overriding with `newValue` the property found with `path`.
Example:
```const path = 'b.c'const newValue = 2const obj = { a: 1 }
R.assocPath(path, newValue, Record<string, unknown>)// => { a : 1, b : { c : 2 }}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function assocPath<Output>(path: Path, newValue: any, obj: object): Output;export function assocPath<Output>(path: Path, newValue: any): (obj: object) => Output;export function assocPath<Output>(path: Path): (newValue: any) => (obj: object) => Output;
/*Method: both
Explanation: It returns a function with `input` argument.
This function will return `true`, if both `firstCondition` and `secondCondition` return `true` when `input` is passed as their argument.
Example:
```const firstCondition = x => x > 10const secondCondition = x => x < 20const fn = R.both(firstCondition, secondCondition)
const result = [fn(15), fn(30)]// => [true, false]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function both(pred1: Pred, pred2: Pred): Pred;export function both<T>(pred1: Predicate<T>, pred2: Predicate<T>): Predicate<T>;export function both<T>(pred1: Predicate<T>): (pred2: Predicate<T>) => Predicate<T>;export function both(pred1: Pred): (pred2: Pred) => Pred;
/*Method: chain
Explanation: The method is also known as `flatMap`.
Example:
```const duplicate = n => [ n, n ]const list = [ 1, 2, 3 ]
const result = chain(duplicate, list)// => [ 1, 1, 2, 2, 3, 3 ]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function chain<T, U>(fn: (n: T) => U[], list: T[]): U[];export function chain<T, U>(fn: (n: T) => U[]): (list: T[]) => U[];
/*Method: clamp
Explanation: Restrict a number `input` to be within `min` and `max` limits.
If `input` is bigger than `max`, then the result is `max`.
If `input` is smaller than `min`, then the result is `min`.
Example:
```const result = [ R.clamp(0, 10, 5), R.clamp(0, 10, -1), R.clamp(0, 10, 11)]// => [5, 0, 10]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function clamp(min: number, max: number, input: number): number;export function clamp(min: number, max: number): (input: number) => number;
/*Method: clone
Explanation: It creates a deep copy of the `input`, which may contain (nested) Arrays and Objects, Numbers, Strings, Booleans and Dates.
Example:
```const objects = [{a: 1}, {b: 2}];const objectsClone = R.clone(objects);
const result = [ R.equals(objects, objectsClone), R.equals(objects[0], objectsClone[0]),] // => [ true, true ]```
Categories: Object
Notes: It doesn't work with very specific types, such as MongoDB's ObjectId.
*/// @SINGLE_MARKERexport function clone<T>(input: T): T;export function clone<T>(input: T[]): T[];
/*Method: complement
Explanation: It returns `inverted` version of `origin` function that accept `input` as argument.
The return value of `inverted` is the negative boolean value of `origin(input)`.
Example:
```const origin = x => x > 5const inverted = complement(origin)
const result = [ origin(7), inverted(7)] => [ true, false ]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function complement<T extends any[]>(predicate: (...args: T) => unknown): (...args: T) => boolean;
/*Method: compose
Explanation: It performs right-to-left function composition.
Example:
```const result = R.compose( R.map(x => x * 2), R.filter(x => x > 2))([1, 2, 3, 4])
// => [6, 8]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>( ...func: [ fnLast: (a: any) => TResult, ...func: Array<(a: any) => any>, f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1 ]): (...args: TArgs) => TResult;export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>( f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R7;export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7>( f7: (a: R6) => R7, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R7;export function compose<TArgs extends any[], R1, R2, R3, R4, R5, R6>( f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R6;export function compose<TArgs extends any[], R1, R2, R3, R4, R5>( f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R5;export function compose<TArgs extends any[], R1, R2, R3, R4>( f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R4;export function compose<TArgs extends any[], R1, R2, R3>( f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R3;export function compose<TArgs extends any[], R1, R2>( f2: (a: R1) => R2, f1: (...args: TArgs) => R1): (...args: TArgs) => R2;export function compose<TArgs extends any[], R1>( f1: (...args: TArgs) => R1): (...args: TArgs) => R1;
/*Method: concat
Explanation: It returns a new string or array, which is the result of merging `x` and `y`.
Example:
```R.concat([1, 2])([3, 4]) // => [1, 2, 3, 4]R.concat('foo', 'bar') // => 'foobar'```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function concat<T>(x: T[], y: T[]): T[];export function concat<T>(x: T[]): (y: T[]) => T[];export function concat(x: string, y: string): string;export function concat(x: string): (y: string) => string;
/*Method: cond
Explanation: It takes list with `conditions` and returns a new function `fn` that expects `input` as argument.
This function will start evaluating the `conditions` in order to find the first winner(order of conditions matter).
The winner is this condition, which left side returns `true` when `input` is its argument. Then the evaluation of the right side of the winner will be the final result.
If no winner is found, then `fn` returns `undefined`.
Example:
```const fn = R.cond([ [ x => x > 25, R.always('more than 25') ], [ x => x > 15, R.always('more than 15') ], [ R.T, x => `${x} is nothing special` ],])
const result = [ fn(30), fn(20), fn(10),] // => ['more than 25', 'more than 15', '10 is nothing special']```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function cond<T extends any[], R>(conditions: Array<CondPair<T, R>>): (...args: T) => R;
/*Method: converge
Explanation: Accepts a converging function and a list of branching functions and returns a new function. When invoked, this new function is applied to some arguments, each branching function is applied to those same arguments. The results of each branching function are passed as arguments to the converging function to produce the return value.
Example:
```const result = R.converge(R.multiply)([ R.add(1), R.add(3) ])(2)// => 15```
Categories: Logic
Notes: Explanation is taken from `Ramda` documentation
*/// @SINGLE_MARKERexport function converge(after: ((...a: any[]) => any), fns: ((...x: any[]) => any)[]): (...y: any[]) => any;
/*Method: curry
Explanation: It expects a function as input and returns its curried version.
Example:
```const fn = (a, b, c) => a + b + cconst curried = R.curry(fn)const sum = curried(1,2)
const result = sum(3) // => 6```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function curry(fn: AnyFunction): (...a: any[]) => any;
/*Method: curryN
Explanation: It returns a curried equivalent of the provided function, with the specified arity.
Example:
```
```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function curryN(length: number, fn: AnyFunction): (...a: any[]) => any;
/*Method: dec
Explanation: It decrements a number.
Example:
```const result = R.dec(2) // => 1```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function dec(x: number): number;
/*Method: defaultTo
Explanation:It returns `defaultValue`, if all of `inputArguments` are `undefined`, `null` or `NaN`.
Else, it returns the first truthy `inputArguments` instance(from left to right).
Example:
```R.defaultTo('foo', 'bar') // => 'bar'R.defaultTo('foo', undefined) // => 'foo'
// Important - emtpy string is not falsy value(same as Ramda)R.defaultTo('foo', '') // => 'foo'```
Categories: Logic
Notes: Rambda's **defaultTo** accept indefinite number of arguments when non curried, i.e. `R.defaultTo(2, foo, bar, baz)`.
*/// @SINGLE_MARKERexport function defaultTo<T>(defaultValue: T, input: T | null | undefined): T;export function defaultTo<T>(defaultValue: T): (input: T | null | undefined) => T;
/*Method: difference
Explanation: It returns the uniq set of all elements in the first list `a` not contained in the second list `b`.
`R.equals` is used to determine equality.
Example:
```const a = [ 1, 2, 3, 4 ]const b = [ 3, 4, 5, 6 ]
const result = R.difference(a, b)// => [ 1, 2 ]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function difference<T>(a: T[], b: T[]): T[];export function difference<T>(a: T[]): (b: T[]) => T[];
/*Method: dissoc
Explanation: It returns a new object that does not contain property `prop`.
Example:
```R.dissoc('b', {a: 1, b: 2, c: 3})// => {a: 1, c: 3}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function dissoc<T extends object, K extends keyof T>(prop: K, obj: T): Omit<T, K>;export function dissoc<K extends string | number>(prop: K): <T extends object>(obj: T) => Omit<T, K>;
/*Method: divide
Explanation:
Example:
```R.divide(71, 100) // => 0.71```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function divide(x: number, y: number): number;export function divide(x: number): (y: number) => number;
/*Method: drop
Explanation: It returns `howMany` items dropped from beginning of list or string `input`.
Example:
```R.drop(2, ['foo', 'bar', 'baz']) // => ['baz']R.drop(2, 'foobar') // => 'obar'```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function drop<T>(howMany: number, input: T[]): T[];export function drop(howMany: number, input: string): string;export function drop<T>(howMany: number): { <T>(input: T[]): T[]; (input: string): string;};
/*Method: dropLast
Explanation: It returns `howMany` items dropped from the end of list or string `input`.
Example:
```R.dropLast(2, ['foo', 'bar', 'baz']) // => ['foo']R.dropLast(2, 'foobar') // => 'foob'```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function dropLast<T>(howMany: number, input: T[]): T[];export function dropLast(howMany: number, input: string): string;export function dropLast<T>(howMany: number): { <T>(input: T[]): T[]; (input: string): string;};
/*Method: either
Explanation: It returns a new `predicate` function from `firstPredicate` and `secondPredicate` inputs.
This `predicate` function will return `true`, if any of the two input predicates return `true`.
Example:
```const firstPredicate = x => x > 10const secondPredicate = x => x % 2 === 0const predicate = R.either(firstPredicate, secondPredicate)
const result = [ predicate(15), predicate(8), predicate(7),]// => [true, true, false]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function either(firstPredicate: Pred, secondPredicate: Pred): Pred;export function either<T>(firstPredicate: Predicate<T>, secondPredicate: Predicate<T>): Predicate<T>;export function either<T>(firstPredicate: Predicate<T>): (secondPredicate: Predicate<T>) => Predicate<T>;export function either(firstPredicate: Pred): (secondPredicate: Pred) => Pred;
/*Method: endsWith
Explanation: When iterable is a string, then it behaves as `String.prototype.endsWith`.When iterable is a list, then it uses R.equals to determine if the target list ends in the same way as the given target.
Example:
```const str = 'foo-bar'const list = [{a:1}, {a:2}, {a:3}]
const result = [ R.endsWith('bar', str), R.endsWith([{a:1}, {a:2}], list)]// => [true, true]```
Categories: String, List
Notes:
*/// @SINGLE_MARKERexport function endsWith<T extends string>(question: T, str: string): boolean;export function endsWith<T extends string>(question: T): (str: string) => boolean;export function endsWith<T>(question: T[], list: T[]): boolean;export function endsWith<T>(question: T[]): (list: T[]) => boolean;
/*Method: equals
Explanation: It deeply compares `x` and `y` and returns `true` if they are equal.
Example:
```R.equals( [1, {a:2}, [{b: 3}]], [1, {a:2}, [{b: 3}]]) // => true```
Categories: Logic
Notes: It doesn't handle cyclical data structures and functions
*/// @SINGLE_MARKERexport function equals<T>(x: T, y: T): boolean;export function equals<T>(x: T): (y: T) => boolean;
/*Method: F
Explanation:
Example:
```F() // => false```
Categories:
Notes:
*/// @SINGLE_MARKERexport function F(): boolean;
/*Method: filter
Explanation: It filters list or object `input` using a `predicate` function.
Example:
```const list = [3, 4, 3, 2]const listPredicate = x => x > 2
const object = {abc: 'fo', xyz: 'bar', baz: 'foo'}const objectPredicate = (x, prop) => x.length + prop.length > 5
const result = [ R.filter(listPredicate, list), R.filter(objectPredicate, object)]// => [ [3, 4], { xyz: 'bar', baz: 'foo'} ]```
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function filter<T>(predicate: Predicate<T>): (input: T[]) => T[];export function filter<T>(predicate: Predicate<T>, input: T[]): T[];export function filter<T, U>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;export function filter<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;
/*Method: find
Explanation: It returns the first element of `list` that satisfy the `predicate`.
If there is no such element, it returns `undefined`.
Example:
```const predicate = x => R.type(x.foo) === 'Number'const list = [{foo: 'bar'}, {foo: 1}]
const result = R.find(predicate, list)// => {foo: 1}```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function find<T>(predicate: (x: T) => boolean, list: T[]): T | undefined;export function find<T>(predicate: (x: T) => boolean): (list: T[]) => T | undefined;
/*Method: findIndex
Explanation: It returns the index of the first element of `list` satisfying the `predicate` function.
If there is no such element, then `-1` is returned.
Example:
```const predicate = x => R.type(x.foo) === 'Number'const list = [{foo: 'bar'}, {foo: 1}]
const result = R.findIndex(predicate, list)// => 1```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function findIndex<T>(predicate: (x: T) => boolean, list: T[]): number;export function findIndex<T>(predicate: (x: T) => boolean): (list: T[]) => number;
/*Method: findLast
Explanation: It returns the last element of `list` satisfying the `predicate` function.
If there is no such element, then `undefined` is returned.
Example:
```const predicate = x => R.type(x.foo) === 'Number'const list = [{foo: 0}, {foo: 1}]
const result = R.findLast(predicate, list)// => {foo: 1}```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function findLast<T>(fn: (x: T) => boolean, list: T[]): T | undefined;export function findLast<T>(fn: (x: T) => boolean): (list: T[]) => T | undefined;
/*Method: findLastIndex
Explanation: It returns the index of the last element of `list` satisfying the `predicate` function.
If there is no such element, then `-1` is returned.
Example:
```const predicate = x => R.type(x.foo) === 'Number'const list = [{foo: 0}, {foo: 1}]
const result = R.findLastIndex(predicate, list)// => 1```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function findLastIndex<T>(predicate: (x: T) => boolean, list: T[]): number;export function findLastIndex<T>(predicate: (x: T) => boolean): (list: T[]) => number;
/*Method: flatten
Explanation: It deeply flattens an array.
Example:
```const result = R.flatten([ 1, 2, [3, 30, [300]], [4]])// => [ 1, 2, 3, 30, 300, 4 ]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function flatten<T>(list: any[]): T[];
/*Method: flip
Explanation: It returns function which calls `fn` with exchanged first and second argument.
Example:
```const subtractFlip = R.flip(R.subtract)
const result = [ subtractFlip(1,7), R.subtract(1, 6)] // => [6, -6]```
Categories: Logic
Notes: Rambda's **flip** will throw if the arity of the input function is greater or equal to 5.
*/// @SINGLE_MARKERexport function flip<T, U, TResult>(fn: (arg0: T, arg1: U) => TResult): (arg1: U, arg0?: T) => TResult;
/*Method: forEach
Explanation: It applies `iterable` function over all members of `list` and returns `list`.
Example:
```const sideEffect = {}const result = R.forEach( x => sideEffect[`foo${x}`] = x)([1, 2])
sideEffect // => {foo1: 1, foo2: 2}result // => [1, 2]```
Categories: List, Object
Notes: It works with objects, unlike `Ramda`.
*/// @SINGLE_MARKERexport function forEach<T>(fn: Iterator<T, void>, list: T[]): T[];export function forEach<T>(fn: Iterator<T, void>): (list: T[]) => T[];export function forEach<T>(fn: ObjectIterator<T, void>, list: Dictionary<T>): Dictionary<T>;export function forEach<T, U>(fn: ObjectIterator<T, void>): (list: Dictionary<T>) => Dictionary<T>;
/*Method: fromPairs
Explanation: It transforms a `listOfPairs` to an object.
Example:
```const listOfPairs = [ [ 'a', 1 ], [ 'b', 2 ], [ 'c', [ 3, 4 ] ] ]const expected = { a : 1, b : 2, c : [ 3, 4 ],}
const result = R.fromPairs(listOfPairs)// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function fromPairs<V>(listOfPairs: ([number, V])[]): { [index: number]: V };export function fromPairs<V>(listOfPairs: ([string, V])[]): { [index: string]: V };
/*Method: groupBy
Explanation: It splits `list` according to a provided `groupFn` function and returns an object.
Example:
```const list = [ 'a', 'b', 'aa', 'bb' ]const groupFn = x => x.length
const result = R.groupBy(groupFn, list)// => { '1': ['a', 'b'], '2': ['aa', 'bb'] }```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function groupBy<T>(groupFn: (x: T) => string, list: T[]): { [index: string]: T[] };export function groupBy<T>(groupFn: (x: T) => string): (list: T[]) => { [index: string]: T[] };export function groupBy<T, U>(groupFn: (x: T) => string, list: T[]): U;export function groupBy<T, U>(groupFn: (x: T) => string): (list: T[]) => U;
/*Method: groupWith
Explanation: It returns separated version of list or string `input`, where separation is done with equality `compareFn` function.
Example:
```const compareFn = (x, y) => x === yconst list = [1, 2, 2, 1, 1, 2]
const result = R.groupWith(isConsecutive, list)// => [[1], [2,2], [1,1], [2]]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function groupWith<T>(compareFn: (x: T, y: T) => boolean): (input: T[]) => (T[])[];export function groupWith<T>(compareFn: (x: T, y: T) => boolean, input: T[]): (T[])[];export function groupWith<T>(compareFn: (x: T, y: T) => boolean, input: string): string[];
/*Method: has
Explanation: It returns `true` if `obj` has property `prop`.
Example:
```const obj = {a: 1}
const result = [ R.has('a', Record<string, unknown>), R.has('b', Record<string, unknown>)]// => [true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function has<T>(prop: string, obj: T): boolean;export function has(prop: string): <T>(obj: T) => boolean;
/*Method: hasPath
Explanation: It will return true, if `input` object has truthy `path`(calculated with `R.path`).
Example:
```const path = 'a.b'const pathAsArray = ['a', 'b']const obj = {a: {b: []}}
const result = [ R.hasPath(path, Record<string, unknown>), R.hasPath(pathAsArray, Record<string, unknown>), R.hasPath('a.c', Record<string, unknown>),]// => [true, true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function hasPath<T>( path: string | string[], input: object): boolean;export function hasPath<T>( path: string | string[]): (input: object) => boolean;
/*Method: head
Explanation: It returns the first element of list or string `input`.
Example:
```const result = [ R.head([1, 2, 3]), R.head('foo') ]// => [1, 'f']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function head(str: string): string;export function head(str: ''): undefined;export function head<T>(list: never[]): undefined;export function head<T extends unknown[]>(array: T): FirstArrayElement<T>export function head<T extends readonly unknown[]>(array: T): FirstArrayElement<T>
/*Method: identical
Explanation: It returns `true` if its arguments `a` and `b` are identical.
Otherwise, it returns `false`.
Example:
```const objA = {a: 1};const objB = {a: 1};R.identical(objA, objA); // => trueR.identical(objA, objB); // => falseR.identical(1, 1); // => trueR.identical(1, '1'); // => falseR.identical([], []); // => falseR.identical(0, -0); // => falseR.identical(NaN, NaN); // => true```
Categories: Logic
Notes: Values are identical if they reference the same memory. `NaN` is identical to `NaN`; `0` and `-0` are not identical.
*/// @SINGLE_MARKERexport function identical<T>(x: T, y: T): boolean;export function identical<T>(x: T): (y: T) => boolean;
/*Method: identity
Explanation: It just passes back the supplied `input` argument.
Example:
```R.identity(7) // => 7```
Categories:
Notes: Logic
*/// @SINGLE_MARKERexport function identity<T>(input: T): T;
/*Method: ifElse
Explanation: It expects `condition`, `onTrue` and `onFalse` functions as inputs and it returns a new function with example name of `fn`.
When `fn`` is called with `input` argument, it will return either `onTrue(input)` or `onFalse(input)` depending on `condition(input)` evaluation.
Example:
```const fn = R.ifElse( x => x>10, x => x*2, x => x*10)
const result = [ fn(8), fn(18) ]// => [80, 36]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function ifElse<T, TFiltered extends T, TOnTrueResult, TOnFalseResult>( pred: (a: T) => a is TFiltered, onTrue: (a: TFiltered) => TOnTrueResult, onFalse: (a: Exclude<T, TFiltered>) => TOnFalseResult,): (a: T) => TOnTrueResult | TOnFalseResult;export function ifElse<TArgs extends any[], TOnTrueResult, TOnFalseResult>(fn: (...args: TArgs) => boolean, onTrue: (...args: TArgs) => TOnTrueResult, onFalse: (...args: TArgs) => TOnFalseResult): (...args: TArgs) => TOnTrueResult | TOnFalseResult;
/*Method: inc
Explanation: It increments a number.
Example:
```R.inc(1) // => 2```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function inc(x: number): number;
/*Method: includes
Explanation: If `input` is string, then this method work as native `String.includes`.
If `input` is array, then `R.equals` is used to define if `valueToFind` belongs to the list.
Example:
```const result = [ R.includes('oo', 'foo'), R.includes({a: 1}, [{a: 1}])]// => [true, true ]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function includes<T extends string>(valueToFind: T, input: string): boolean;export function includes<T extends string>(valueToFind: T): (input: string) => boolean;export function includes<T>(valueToFind: T, input: T[]): boolean;export function includes<T>(valueToFind: T): (input: T[]) => boolean;
/*Method: indexBy
Explanation: It generates object with properties provided by `condition` and values provided by `list` array.
If `condition` is a function, then all list members are passed through it.
If `condition` is a string, then all list members are passed through `R.path(condition)`.
Example:
```const list = [ {id: 10}, {id: 20} ]
const withFunction = R.indexBy( x => x.id, list)const withString = R.indexBy( 'id', list)const result = [ withFunction, R.equals(withFunction, withString)]// => [ { 10: {id: 10}, 20: {id: 20} }, true ]```
Categories: List Notes:
*/// @SINGLE_MARKERexport function indexBy<T, K extends string | number = string>(condition: (key: T) => K, list: T[]): { [key in K]: T };export function indexBy<T, K extends string | number | undefined = string>(condition: (key: T) => K, list: T[]): { [key in NonNullable<K>]?: T };export function indexBy<T, K extends string | number = string>(condition: (key: T) => K): (list: T[]) => { [key in K]: T };export function indexBy<T, K extends string | number | undefined = string>(condition: (key: T) => K | undefined): (list: T[]) => { [key in NonNullable<K>]?: T };export function indexBy<T>(condition: string, list: T[]): { [key: string]: T };export function indexBy<T>(condition: string): (list: T[]) => { [key: string]: T };
/*Method: indexOf
Explanation: It returns the index of the first element of `list` equals to `valueToFind`.
If there is no such element, it returns `-1`.
Example:
```const list = [0, 1, 2, 3]
const result = [ R.indexOf(2, list), R.indexOf(0, list)]// => [2, -1]```
Categories: List
Notes: It uses `R.equals` for list of objects/arrays or native `indexOf` for any other case.
*/// @SINGLE_MARKERexport function indexOf<T>(valueToFind: T, list: T[]): number;export function indexOf<T>(valueToFind: T): (list: T[]) => number;
/*Method: init
Explanation: It returns all but the last element of list or string `input`.
Example:
```const result = [ R.init([1, 2, 3]) , R.init('foo') // => 'fo']// => [[1, 2], 'fo']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function init<T extends unknown[]>(input: T): T extends readonly [...infer U, any] ? U : [...T];export function init(input: string): string;
/*Method: intersection
Explanation: It loops through `listA` and `listB` and returns the intersection of the two according to `R.equals`.
Example:
```const listA = [ { id : 1 }, { id : 2 }, { id : 3 }, { id : 4 } ]const listB = [ { id : 3 }, { id : 4 }, { id : 5 }, { id : 6 } ]
const result = R.intersection(listA, listB)// => [{ id : 3 }, { id : 4 }]```
Categories: List
Notes: There is slight difference between Rambda and Ramda implementation. Ramda.intersection(['a', 'b', 'c'], ['c', 'b']) result is "[ 'c', 'b' ]", but Rambda result is "[ 'b', 'c' ]".
*/// @SINGLE_MARKERexport function intersection<T>(listA: T[], listB: T[]): T[];export function intersection<T>(listA: T[]): (listB: T[]) => T[];
/*Method: intersperse
Explanation: It adds a `separator` between members of `list`.
Example:
```const list = [ 0, 1, 2, 3 ]const separator = '|'const result = intersperse(separator, list)// => [0, '|', 1, '|', 2, '|', 3]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function intersperse<T>(separator: T, list: T[]): T[];export function intersperse<T>(separator: T): (list: T[]) => T[];
/*Method: is
Explanation: It returns `true` if `x` is instance of `targetPrototype`.
Example:
```const result = [ R.is(String, 'foo'), R.is(Array, 1)]// => [true, false]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function is<C extends () => any>(targetPrototype: C, val: any): val is ReturnType<C>;export function is<C extends new () => any>(targetPrototype: C, val: any): val is InstanceType<C>;export function is<C extends () => any>(targetPrototype: C): (val: any) => val is ReturnType<C>;export function is<C extends new () => any>(targetPrototype: C): (val: any) => val is InstanceType<C>;
/*Method: isEmpty
Explanation: It returns `true` if `x` is `empty`.
Example:
```const result = [ R.isEmpty(''), R.isEmpty({ x : 0 })]// => [true, false]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isEmpty<T>(x: T): boolean;
/*Method: isNil
Explanation: It returns `true` if `x` is either `null` or `undefined`.
Example:
```const result = [ R.isNil(null), R.isNil(1),]// => [true, false]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isNil(x: any): x is null | undefined;
/*Method: join
Explanation: It returns a string of all `list` instances joined with a `glue`.
Example:
```R.join('-', [1, 2, 3]) // => '1-2-3'```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function join<T>(glue: string, list: T[]): string;export function join<T>(glue: string): (list: T[]) => string;
/*Method: keys
Explanation: It applies `Object.keys` over `x` and returns its keys.
Example:
```R.keys({a:1, b:2}) // => ['a', 'b']```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function keys<T extends object>(x: T): (keyof T & string)[];export function keys<T>(x: T): string[];
/*Method: last
Explanation: It returns the last element of `input`, as the `input` can be either a string or an array.
Example:
```const result = [ R.last([1, 2, 3]), R.last('foo'),]// => [3, 'o']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function last(str: ''): undefined;export function last(str: string): string;export function last(list: never[]): undefined;export function last<T extends unknown[]>(array: T): LastArrayElement<T>export function last<T extends readonly unknown[]>(array: T): LastArrayElement<T>
/*Method: lastIndexOf
Explanation: It returns the last index of `target` in `list` array.
`R.equals` is used to determine equality between `target` and members of `list`.
If there is no such index, then `-1` is returned.
Example:
```const list = [1, 2, 3, 1, 2, 3]const result = [ R.lastIndexOf(2, list), R.lastIndexOf(4, list),]// => [4, -1]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function lastIndexOf<T>(target: T, list: T[]): number;export function lastIndexOf<T>(target: T): (list: T[]) => number;
/*Method: length
Explanation: It returns the `length` property of list or string `input`.
Example:
```const result = [ R.length([1, 2, 3, 4]), R.length('foo'),]// => [4, 3]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function length<T>(input: T[]): number;
/*Method: lens
Explanation: It returns a `lens` for the given `getter` and `setter` functions.
The `getter` **gets** the value of the focus; the `setter` **sets** the value of the focus.
The setter should not mutate the data structure.
Example:
```const xLens = R.lens(R.prop('x'), R.assoc('x'));
R.view(xLens, {x: 1, y: 2}) // => 1R.set(xLens, 4, {x: 1, y: 2}) // => {x: 4, y: 2}R.over(xLens, R.negate, {x: 1, y: 2}) // => {x: -1, y: 2}```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function lens<S, A>(getter: (s: S) => A, setter: (a: A, s: S) => S): Lens<S, A>;
/*Method: lensIndex
Explanation: It returns a lens that focuses on specified `index`.
Example:
```const list = ['a', 'b', 'c']const headLens = R.lensIndex(0)
R.view(headLens, list) // => 'a'R.set(headLens, 'x', list) // => ['x', 'b', 'c']R.over(headLens, R.toUpper, list) // => ['A', 'b', 'c']```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function lensIndex<A>(n: number): Lens<A[], A>;export function lensIndex<A extends any[], N extends number>(n: N): Lens<A, A[N]>;
/*Method: lensPath
Explanation: It returns a lens that focuses on specified `path`.
Example:
```const lensPath = R.lensPath(['x', 0, 'y'])const input = {x: [{y: 2, z: 3}, {y: 4, z: 5}]}
R.view(lensPath, input) // => 2
R.set(lensPath, 1, input) // => {x: [{y: 1, z: 3}, {y: 4, z: 5}]}
R.over(xHeadYLens, R.negate, input) // => {x: [{y: -2, z: 3}, {y: 4, z: 5}]}```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function lensPath<S, K0 extends keyof S = keyof S>(path: [K0]): Lens<S, S[K0]>;export function lensPath<S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0]>( path: [K0, K1],): Lens<S, S[K0][K1]>;export function lensPath< S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0], K2 extends keyof S[K0][K1] = keyof S[K0][K1]>(path: [K0, K1, K2]): Lens<S, S[K0][K1][K2]>;export function lensPath< S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0], K2 extends keyof S[K0][K1] = keyof S[K0][K1], K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2]>(path: [K0, K1, K2, K3]): Lens<S, S[K0][K1][K2][K3]>;export function lensPath< S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0], K2 extends keyof S[K0][K1] = keyof S[K0][K1], K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2], K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3]>(path: [K0, K1, K2, K3, K4]): Lens<S, S[K0][K1][K2][K3][K4]>;export function lensPath< S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0], K2 extends keyof S[K0][K1] = keyof S[K0][K1], K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2], K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3], K5 extends keyof S[K0][K1][K2][K3][K4] = keyof S[K0][K1][K2][K3][K4]>(path: [K0, K1, K2, K3, K4, K5]): Lens<S, S[K0][K1][K2][K3][K4][K5]>;export function lensPath<S = any, A = any>(path: Path): Lens<S, A>;
/*Method: lensProp
Explanation: It returns a lens that focuses on specified property `prop`.
Example:
```const xLens = R.lensProp('x');const input = {x: 1, y: 2}
R.view(xLens, input) // => 1
R.set(xLens, 4, input) // => {x: 4, y: 2}
R.over(xLens, R.negate, input) // => {x: -1, y: 2}```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function lensProp<S, K extends keyof S = keyof S>(prop: K): Lens<S, S[K]>;
/*Method: over
Explanation: It returns a copied **Object** or **Array** with modified value received by applying function `fn` to `lens` focus.
Example:
```const headLens = R.lensIndex(0) R.over(headLens, R.toUpper, ['foo', 'bar', 'baz']) // => ['FOO', 'bar', 'baz']```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function over<S, A>(lens: Lens<S, A>): { (fn: (a: A) => A): (value: S) => S; (fn: (a: A) => A, value: S): S;};export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A): (value: S) => S;export function over<S, A>(lens: Lens<S, A>, fn: (a: A) => A, value: S): S;
/*Method: set
Explanation: It returns a copied **Object** or **Array** with modified `lens` focus set to `replacer` value.
Example:
```const input = {x: 1, y: 2}const xLens = R.lensProp('x')
const result = [ R.set(xLens, 4, input), R.set(xLens, 8, input) ]// => [{x: 4, y: 2}, {x: 8, y: 2}]```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function set<S, A>(lens: Lens<S, A>): { (a: A): (obj: S) => S (a: A, obj: S): S};export function set<S, A>(lens: Lens<S, A>, a: A): (obj: S) => S;export function set<S, A>(lens: Lens<S, A>, a: A, obj: S): S;
/*Method: view
Explanation: It returns the value of `lens` focus over `target` object.
Example:
```const lens = R.lensProp('x')
R.view(lens, {x: 1, y: 2}) // => 1R.view(lens, {x: 4, y: 2}) // => 4```
Categories: Lenses
Notes:
*/// @SINGLE_MARKERexport function view<S, A>(lens: Lens<S, A>): (obj: S) => A;export function view<S, A>(lens: Lens<S, A>, obj: S): A;
/*Method: map
Explanation: It returns the result of looping through `iterable` with `fn`.
It works with both array and object.
Example:
```const fn = x => x * 2const fnWhenObject = (val, prop)=>{ return `${prop}-${val}`}
const iterable = [1, 2]const obj = {a: 1, b: 2}
const result = [ R.map(fn, list), R.map(fnWhenObject, Record<string, unknown>)]// => [ [1, 4], {a: 'a-1', b: 'b-2'}] ```
Categories: List, Object
Notes: Unlike Ramda's `map`, here property and input object are passed as arguments to `fn`, when `iterable` is an object.
*/// @SINGLE_MARKERexport function map<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;export function map<T, U>(fn: Iterator<T, U>, iterable: T[]): U[];export function map<T, U>(fn: Iterator<T, U>): (iterable: T[]) => U[];export function map<T, U, S>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;export function map<T>(fn: Iterator<T, T>): (iterable: T[]) => T[];export function map<T>(fn: Iterator<T, T>, iterable: T[]): T[];
/*Method: mapObjIndexed
Explanation: It works the same way as `R.map` does for objects. It is added as Ramda also has this method.
Example:
```const fn = (val, prop) => { return `${prop}-${val}`}
const obj = {a: 1, b: 2}
const result = R.map(mapObjIndexed, Record<string, unknown>)// => {a: 'a-1', b: 'b-2'}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mapObjIndexed<T>(fn: ObjectIterator<T, T>, iterable: Dictionary<T>): Dictionary<T>;export function mapObjIndexed<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;export function mapObjIndexed<T>(fn: ObjectIterator<T, T>): (iterable: Dictionary<T>) => Dictionary<T>;export function mapObjIndexed<T, U>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;
/*Method: match
Explanation: Curried version of `String.prototype.match` which returns empty array, when there is no match.
Example:
```const result = [ R.match('a', 'foo'), R.match(/([a-z]a)/g, 'bananas')]// => [[], ['ba', 'na', 'na']]```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function match(regExpression: RegExp, str: string): string[];export function match(regExpression: RegExp): (str: string) => string[];
/*Method: mathMod
Explanation: `R.mathMod` behaves like the modulo operator should mathematically, unlike the `%` operator (and by extension, `R.modulo`). So while `-17 % 5` is `-2`, `mathMod(-17, 5)` is `3`.
Example:
```const result = [ R.mathMod(-17, 5), R.mathMod(17, 5), R.mathMod(17, -5), R.mathMod(17, 0) ]// => [3, 2, NaN, NaN]```
Categories: Number
Notes: Explanation is taken from `Ramda` documentation site.
*/// @SINGLE_MARKERexport function mathMod(x: number, y: number): number;export function mathMod(x: number): (y: number) => number;
/*Method: max
Explanation: It returns the greater value between `x` and `y`.
Example:
```const result = [ R.max(5, 7), R.max('bar', 'foo'), ]// => [7, 'foo']```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function max<T extends Ord>(x: T, y: T): T;export function max<T extends Ord>(x: T): (y: T) => T;
/*Method: maxBy
Explanation: It returns the greater value between `x` and `y` according to `compareFn` function.
Example:
```const compareFn = Math.abs
R.maxBy(compareFn, 5, -7) // => -7```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function maxBy<T>(compareFn: (input: T) => Ord, x: T, y: T): T;export function maxBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;export function maxBy<T>(compareFn: (input: T) => Ord): (x: T) => (y: T) => T;
/*Method: mean
Explanation: It returns the mean value of `list` input.
Example:
```R.mean([ 2, 7 ])// => 4.5```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function mean(list: number[]): number;
/*Method: median
Explanation: It returns the median value of `list` input.
Example:
```R.median([ 7, 2, 10, 9 ]) // => 8```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function median(list: number[]): number;
/*Method: merge
Explanation: Same as `R.mergeRight`.
Example:
``````
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function merge<A, B>(target: A, newProps: B): A & Bexport function merge<Output>(target: any): (newProps: any) => Output;
/*Method: mergeRight
Explanation: It creates a copy of `target` object with overwritten `newProps` properties. Previously known as `R.merge` but renamed after Ramda did the same.
Example:
```const target = { 'foo': 0, 'bar': 1 }const newProps = { 'foo': 7 }
const result = R.mergeRight(target, newProps)// => { 'foo': 7, 'bar': 1 }```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mergeRight<A, B>(target: A, newProps: B): A & Bexport function mergeRight<Output>(target: any): (newProps: any) => Output;
/*Method: mergeAll
Explanation: It merges all objects of `list` array sequentially and returns the result.
Example:
```const list = [ {a: 1}, {b: 2}, {c: 3}]const result = R.mergeAll(list)const expected = { a: 1, b: 2, c: 3}// => `result` is equal to `expected````
Categories:
Notes:
*/// @SINGLE_MARKERexport function mergeAll<T>(list: object[]): T;export function mergeAll(list: object[]): object;
/*Method: mergeDeepRight
Explanation: Creates a new object with the own properties of the first object merged with the own properties of the second object. If a key exists in both objects:
- and both values are objects, the two values will be recursively merged - otherwise the value from the second object will be used.Example:
```const x = { name: 'fred', age: 10, contact: { email: 'moo@example.com' }}const y = { age: 40, contact: { email: 'baa@example.com' }}
const result = R.mergeDeepRight(x, y)const expected = { name: 'fred', age: 40, contact: { email: 'baa@example.com' }}// => `result` is equal to `expected````
Categories: Object
Notes: Explanation and example are taken from `Ramda` documentation.
*/// @SINGLE_MARKERexport function mergeDeepRight<Output>(target: object, newProps: object): Output;export function mergeDeepRight<Output>(target: object): (newProps: object) => Output;

/*Method: mergeLeft
Explanation: Same as `R.merge`, but in opposite direction.
Example:
```const result = R.mergeLeft( {a: 10}, {a: 1, b: 2})// => {a:10, b: 2}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mergeLeft<Output>(newProps: object, target: object): Output;export function mergeLeft<Output>(newProps: object): (target: object) => Output;
/*Method: min
Explanation: It returns the lesser value between `x` and `y`.
Example:
```const result = [ R.min(5, 7), R.min('bar', 'foo'), ]// => [5, 'bar']```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function min<T extends Ord>(x: T, y: T): T;export function min<T extends Ord>(x: T): (y: T) => T;
/*Method: minBy
Explanation: It returns the lesser value between `x` and `y` according to `compareFn` function.
Example:
```const compareFn = Math.abs
R.minBy(compareFn, -5, 2) // => -5```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function minBy<T>(compareFn: (input: T) => Ord, x: T, y: T): T;export function minBy<T>(compareFn: (input: T) => Ord, x: T): (y: T) => T;export function minBy<T>(compareFn: (input: T) => Ord): (x: T) => (y: T) => T;

/*Method: modulo
Explanation: Curried version of `x%y`.
Example:
```R.modulo(17, 3) // => 2```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function modulo(x: number, y: number): number;export function modulo(x: number): (y: number) => number;
/*Method: move
Explanation: It returns a copy of `list` with exchanged `fromIndex` and `toIndex` elements.
Example:
```const list = [1, 2, 3]const result = R.move(0, 1, list)// => [2, 1, 3]```
Categories: List
Notes: Rambda.move doesn't support negative indexes - it throws an error.
*/// @SINGLE_MARKERexport function move<T>(fromIndex: number, toIndex: number, list: T[]): T[];export function move(fromIndex: number, toIndex: number): <T>(list: T[]) => T[];export function move(fromIndex: number): { <T>(toIndex: number, list: T[]): T[]; (toIndex: number): <T>(list: T[]) => T[];};
/*Method: multiply
Explanation: Curried version of `x*y`.

Example:
```R.multiply(2, 4) // => 8```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function multiply(x: number, y: number): number;export function multiply(x: number): (y: number) => number;
/*Method: negate
Explanation:
Example:
```R.negate(420)// => -420```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function negate(x: number): number;
/*Method: none
Explanation: It returns `true`, if all members of array `list` returns `false`, when applied as argument to `predicate` function.
Example:
```const list = [ 0, 1, 2, 3, 4 ]const predicate = x => x > 6
const result = R.none(predicate, arr)// => true```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function none<T>(predicate: (x: T) => boolean, list: T[]): boolean;export function none<T>(predicate: (x: T) => boolean): (list: T[]) => boolean;
/*Method: not
Explanation: It returns a boolean negated version of `input`.
Example:
```R.not(false) // true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function not(input: any): boolean;

/*Method: nth
Explanation: Curried version of `input[index]`.
Example:
```const list = [1, 2, 3]const str = 'foo'
const result = [ R.nth(2, list), R.nth(6, list), R.nth(0, str),]// => [3, undefined, 'f']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function nth(index: number, input: string): string; export function nth<T>(index: number, input: T[]): T | undefined; export function nth(n: number): { <T>(input: T[]): T | undefined; (input: string): string;};
/*Method: objOf
Explanation: It creates an object with a single key-value pair.
Example:
```const result = R.objOf('foo', 'bar')// => {foo: 'bar'}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function objOf<T, K extends string>(key: K, value: T): Record<K, T>;export function objOf<K extends string>(key: K): <T>(value: T) => Record<K, T>;
/*Method: once
Explanation: It returns a function, which invokes only once `fn` function.
Example:
```let result = 0const addOnce = R.once((x) => result = result + x)
addOnce(1)addOnce(1)// => 1```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function once<T extends AnyFunction, C = unknown>(fn: T, context?: C): T;
/*Method: omit
Explanation: It returns a partial copy of an `obj` without `propsToOmit` properties.
Example:
```const obj = {a: 1, b: 2, c: 3}const propsToOmit = 'a,c,d'const propsToOmitList = ['a', 'c', 'd']
const result = [ R.omit(propsToOmit, Record<string, unknown>), R.omit(propsToOmitList, Record<string, unknown>) ]// => [{b: 2}, {b: 2}]```
Categories: Object
Notes: When using this method with `TypeScript`, it is much easier to pass `propsToOmit` as an array. If passing a string, you will need to explicitly declare the output type.
*/// @SINGLE_MARKERexport function omit<T, K extends string>(propsToOmit: K[], obj: T): Omit<T, K>;export function omit<K extends string>(propsToOmit: K[]): <T>(obj: T) => Omit<T, K>;export function omit<T, U>(propsToOmit: string, obj: T): U;export function omit<T, U>(propsToOmit: string): (obj: T) => U;export function omit<T>(propsToOmit: string, obj: object): T;export function omit<T>(propsToOmit: string): (obj: object) => T;
/*Method: of
Explanation:
Example:
```R.of(null); // => [null]R.of([42]); // => [[42]]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function of<T>(x: T): T[];
/*Method: partial
Explanation: It is very similar to `R.curry`, but you can pass initial arguments when you create the curried function.
`R.partial` will keep returning a function until all the arguments that the function `fn` expects are passed.The name comes from the fact that you partially inject the inputs.
Example:
```const fn = (title, firstName, lastName) => { return title + ' ' + firstName + ' ' + lastName + '!'}
const canPassAnyNumberOfArguments = R.partial(fn, 'Hello')const ramdaStyle = R.partial(fn, ['Hello'])
const finalFn = canPassAnyNumberOfArguments('Foo')
finalFn('Bar') // => 'Hello, Foo Bar!'```
Categories: Logic
Notes: Rambda's partial doesn't need the input arguments to be wrapped as array.
*/// @SINGLE_MARKERexport function partial<V0, V1, T>(fn: (x0: V0, x1: V1) => T, args: [V0]): (x1: V1) => T;export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V0, V1]): (x2: V2) => T;export function partial<V0, V1, V2, T>(fn: (x0: V0, x1: V1, x2: V2) => T, args: [V0]): (x1: V1, x2: V2) => T;export function partial<V0, V1, V2, V3, T>( fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0, V1, V2],): (x2: V3) => T;export function partial<V0, V1, V2, V3, T>( fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0, V1],): (x2: V2, x3: V3) => T;export function partial<V0, V1, V2, V3, T>( fn: (x0: V0, x1: V1, x2: V2, x3: V3) => T, args: [V0],): (x1: V1, x2: V2, x3: V3) => T;export function partial<T>(fn: (...a: any[]) => T, args: any[]): (...a: any[]) => T;

/*Method: partition
Explanation: It will return array of two objects/arrays according to `predicate` function. The first member holds all instances of `input` that pass the `predicate` function, while the second member - those who doesn't.
Example:
```const list = [1, 2, 3]const obj = {a: 1, b: 2, c: 3}const predicate = x => x > 2
const result = [ R.partition(predicate, list), R.partition(predicate, Record<string, unknown>)]const expected = [ [[3], [1, 2]], [{c: 3}, {a: 1, b: 2}],]// `result` is equal to `expected````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function partition<T>( predicate: Predicate<T>, input: T[]): [T[], T[]];export function partition<T>( predicate: Predicate<T>): (input: T[]) => [T[], T[]];export function partition<T>( predicate: (x: T, prop?: string) => boolean, input: { [key: string]: T}): [{ [key: string]: T}, { [key: string]: T}];export function partition<T>( predicate: (x: T, prop?: string) => boolean): (input: { [key: string]: T}) => [{ [key: string]: T}, { [key: string]: T}];
/*Method: path
Explanation: If `pathToSearch` is `'a.b'` then it will return `1` if `obj` is `{a:{b:1}}`.
It will return `undefined`, if such path is not found.
Example:
```const obj = {a: {b: 1}}const pathToSearch = 'a.b'const pathToSearchList = ['a', 'b']
const result = [ R.path(pathToSearch, Record<string, unknown>), R.path(pathToSearchList, Record<string, unknown>), R.path('a.b.c.d', Record<string, unknown>)]// => [1, 1, undefined]```
Categories: Object
Notes: String annotation of `pathToSearch` is one of the differences between `Rambda` and `Ramda`.
*/// @SINGLE_MARKERexport function path<S, K0 extends keyof S = keyof S>(path: [K0], obj: S): S[K0];export function path<S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0]>(path: [K0, K1], obj: S): S[K0][K1];export function path< S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0], K2 extends keyof S[K0][K1] = keyof S[K0][K1]>(path: [K0, K1, K2], obj: S): S[K0][K1][K2];export function path< S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0], K2 extends keyof S[K0][K1] = keyof S[K0][K1], K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2],>(path: [K0, K1, K2, K3], obj: S): S[K0][K1][K2][K3];export function path< S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0], K2 extends keyof S[K0][K1] = keyof S[K0][K1], K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2], K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3],>(path: [K0, K1, K2, K3, K4], obj: S): S[K0][K1][K2][K3][K4];export function path< S, K0 extends keyof S = keyof S, K1 extends keyof S[K0] = keyof S[K0], K2 extends keyof S[K0][K1] = keyof S[K0][K1], K3 extends keyof S[K0][K1][K2] = keyof S[K0][K1][K2], K4 extends keyof S[K0][K1][K2][K3] = keyof S[K0][K1][K2][K3], K5 extends keyof S[K0][K1][K2][K3][K4] = keyof S[K0][K1][K2][K3][K4],>(path: [K0, K1, K2, K3, K4, K5], obj: S): S[K0][K1][K2][K3][K4][K5];export function path<T>(pathToSearch: string, obj: any): T | undefined;export function path<T>(pathToSearch: string): (obj: any) => T | undefined;export function path<T>(pathToSearch: RamdaPath): (obj: any) => T | undefined;export function path<T>(pathToSearch: RamdaPath, obj: any): T | undefined;
/*Method: pathEq
Explanation: It returns `true` if `pathToSearch` of `input` object is equal to `target` value.
`pathToSearch` is passed to `R.path`, which means that it can be either a string or an array. Also equality between `target` and the found value is determined by `R.equals`.
Example:
```const path = 'a.b'const target = {c: 1}const input = {a: {b: {c: 1}}}
const result = R.pathEq( path, target, input)// => true```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function pathEq(pathToSearch: Path, target: any, input: any): boolean;export function pathEq(pathToSearch: Path, target: any): (input: any) => boolean;export function pathEq(pathToSearch: Path): (target: any) => (input: any) => boolean;
/*Method: paths
Explanation: It loops over members of `pathsToSearch` as `singlePath` and returns the array produced by `R.path(singlePath, Record<string, unknown>)`.
Because it calls `R.path`, then `singlePath` can be either string or a list.
Example:
```const obj = { a : { b : { c : 1, d : 2 } }}
const result = R.paths([ 'a.b.c', 'a.b.d', 'a.b.c.d.e',], Record<string, unknown>)// => [1, 2, undefined]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function paths<Input, T>(pathsToSearch: Path[], obj: Input): (T | undefined)[];export function paths<Input, T>(pathsToSearch: Path[]): (obj: Input) => (T | undefined)[];export function paths<T>(pathsToSearch: Path[], obj: any): (T | undefined)[];export function paths<T>(pathsToSearch: Path[]): (obj: any) => (T | undefined)[];
/*Method: pathOr
Explanation: It reads `obj` input and returns either `R.path(pathToSearch, Record<string, unknown>)` result or `defaultValue` input.
Example:
```const defaultValue = 'DEFAULT_VALUE'const pathToSearch = 'a.b'const pathToSearchList = ['a', 'b']
const obj = { a : { b : 1 }}
const result = [ R.pathOr(DEFAULT_VALUE, pathToSearch, Record<string, unknown>), R.pathOr(DEFAULT_VALUE, pathToSearchList, Record<string, unknown>), R.pathOr(DEFAULT_VALUE, 'a.b.c', Record<string, unknown>)]// => [1, 1, 'DEFAULT_VALUE']```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function pathOr<T>(defaultValue: T, pathToSearch: Path, obj: any): T;export function pathOr<T>(defaultValue: T, pathToSearch: Path): (obj: any) => T;export function pathOr<T>(defaultValue: T): (pathToSearch: Path) => (obj: any) => T;
/*Method: pick
Explanation: It returns a partial copy of an `input` containing only `propsToPick` properties.
`input` can be either an object or an array.
String annotation of `propsToPick` is one of the differences between `Rambda` and `Ramda`.
Example:
```const obj = { a : 1, b : false, foo: 'cherry'}const list = [1, 2, 3, 4]const propsToPick = 'a,foo'const propsToPickList = ['a', 'foo']
const result = [ R.pick(propsToPick, Record<string, unknown>), R.pick(propsToPickList, Record<string, unknown>), R.pick('a,bar', Record<string, unknown>), R.pick('bar', Record<string, unknown>), R.pick([0, 3, 5], list), R.pick('0,3,5', list),]
const expected = [ {a:1, foo: 'cherry'}, {a:1, foo: 'cherry'}, {a:1}, {}, {0: 1, 3: 4}, {0: 1, 3: 4},]// => `result` is equal to `expected````
Categories: Object, List
Notes: When using this method with `TypeScript`, it is much easier to pass `propsToPick` as an array. If passing a string, you will need to explicitly declare the output type.*/// @SINGLE_MARKERexport function pick<T, K extends string | number | symbol>(propsToPick: K[], input: T): Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;export function pick<K extends string | number | symbol>(propsToPick: K[]): <T>(input: T) => Pick<T, Exclude<keyof T, Exclude<keyof T, K>>>;export function pick<T, U>(propsToPick: string, input: T): U;export function pick<T, U>(propsToPick: string): (input: T) => U;export function pick<T>(propsToPick: string, input: object): T;export function pick<T>(propsToPick: string): (input: object) => T;
/*Method: pickAll
Explanation: Same as `R.pick` but it won't skip the missing props, i.e. it will assign them to `undefined`.
Example:
```const obj = { a : 1, b : false, foo: 'cherry'}const propsToPick = 'a,foo,bar'const propsToPickList = ['a', 'foo', 'bar']
const result = [ R.pickAll(propsToPick, Record<string, unknown>), R.pickAll(propsToPickList, Record<string, unknown>), R.pickAll('a,bar', Record<string, unknown>), R.pickAll('bar', Record<string, unknown>),]const expected = [ {a:1, foo: 'cherry', bar: undefined}, {a:1, foo: 'cherry', bar: undefined}, {a:1, bar: undefined}, {bar: undefined}]// => `result` is equal to `expected````
Categories: Object
Notes: When using this method with `TypeScript`, it is much easier to pass `propsToPick` as an array. If passing a string, you will need to explicitly declare the output type.
*/// @SINGLE_MARKERexport function pickAll<T, K extends keyof T>(propsToPicks: K[], input: T): Pick<T, K>;export function pickAll<T, U>(propsToPicks: string[], input: T): U;export function pickAll(propsToPicks: string[]): <T, U>(input: T) => U;export function pickAll<T, U>(propsToPick: string, input: T): U;export function pickAll<T, U>(propsToPick: string): (input: T) => U;/*Method: pipe
Explanation: It performs left-to-right function composition.
Example:
```const result = R.pipe( R.filter(val => val > 2), R.map(a => a * 2))([1, 2, 3, 4])
// => [6, 8]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7, TResult>( ...funcs: [ f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...func: Array<(a: any) => any>, fnLast: (a: any) => TResult ]): (...args: TArgs) => TResult; // fallback overload if number of piped functions greater than 7export function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6, R7>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): (...args: TArgs) => R7;export function pipe<TArgs extends any[], R1, R2, R3, R4, R5, R6>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): (...args: TArgs) => R6;export function pipe<TArgs extends any[], R1, R2, R3, R4, R5>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): (...args: TArgs) => R5;export function pipe<TArgs extends any[], R1, R2, R3, R4>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): (...args: TArgs) => R4;export function pipe<TArgs extends any[], R1, R2, R3>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (...args: TArgs) => R3;export function pipe<TArgs extends any[], R1, R2>( f1: (...args: TArgs) => R1, f2: (a: R1) => R2): (...args: TArgs) => R2;export function pipe<TArgs extends any[], R1>( f1: (...args: TArgs) => R1): (...args: TArgs) => R1;
/*Method: pluck
Explanation: It returns list of the values of `property` taken from the all objects inside `list`.
Example:
```const list = [{a: 1}, {a: 2}, {b: 3}]const property = 'a'
const result = R.pluck(property, list) // => [1, 2]```
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function pluck<K extends keyof T, T>(property: K, list: T[]): T[K][];export function pluck<T>(property: number, list: { [k: number]: T }[]): T[];export function pluck<P extends string>(property: P): <T>(list: Record<P, T>[]) => T[];export function pluck(property: number): <T>(list: { [k: number]: T }[]) => T[];
/*Method: prepend
Explanation: It adds element `x` at the beginning of `list`.
Example:
```const result = R.prepend('foo', ['bar', 'baz'])// => ['foo', 'bar', 'baz']```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function prepend<T>(xToPrepend: T, iterable: T[]): T[];export function prepend<T, U>(xToPrepend: T, iterable: IsFirstSubtypeOfSecond<T, U>[]) : U[];export function prepend<T>(xToPrepend: T): <U>(iterable: IsFirstSubtypeOfSecond<T, U>[]) => U[];export function prepend<T>(xToPrepend: T): (iterable: T[]) => T[];

/*Method: product
Explanation:
Example:
```R.product([ 2, 3, 4 ])// => 24)```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function product(list: number[]): number;
/*Method: prop
Explanation: It returns the value of property `propToFind` in `obj`.
If there is no such property, it returns `undefined`.
Example:
```const result = [ R.prop('x', {x: 100}), R.prop('x', {a: 1}) ]// => [100, undefined]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function prop<_, P extends keyof never, T>(p: P, value: T): Prop<T, P>;export function prop<V>(p: keyof never, value: unknown): V;export function prop<_, P extends keyof never>(p: P): <T>(value: T) => Prop<T, P>;export function prop<V>(p: keyof never): (value: unknown) => V;
/*Method: propEq
Explanation: It returns true if `obj` has property `propToFind` and its value is equal to `valueToMatch`.
Example:
```const obj = { foo: 'bar' }const secondObj = { foo: 1 }
const propToFind = 'foo'const valueToMatch = 'bar'
const result = [ R.propEq(propToFind, valueToMatch, Record<string, unknown>), R.propEq(propToFind, valueToMatch, secondRecord<string, unknown>)]// => [true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function propEq<K extends string | number>(valueToMatch: any, propToFind: K, obj: Record<K, any>): boolean;export function propEq<K extends string | number>(valueToMatch: any, propToFind: K): (obj: Record<K, any>) => boolean;export function propEq(valueToMatch: any): { <K extends string | number>(propToFind: K, obj: Record<K, any>): boolean; <K extends string | number>(propToFind: K): (obj: Record<K, any>) => boolean;};
/*Method: propIs
Explanation: It returns `true` if `property` of `obj` is from `target` type.
Example:
```const obj = {a:1, b: 'foo'}
const result = [ R.propIs(Number, 'a', Record<string, unknown>), R.propIs(String, 'b', Record<string, unknown>), R.propIs(Number, 'b', Record<string, unknown>),]// => [true, true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function propIs<C extends AnyFunction, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, ReturnType<C>>;export function propIs<C extends AnyConstructor, K extends keyof any>(type: C, name: K, obj: any): obj is Record<K, InstanceType<C>>;export function propIs<C extends AnyFunction, K extends keyof any>(type: C, name: K): (obj: any) => obj is Record<K, ReturnType<C>>;export function propIs<C extends AnyConstructor, K extends keyof any>(type: C, name: K): (obj: any) => obj is Record<K, InstanceType<C>>;export function propIs<C extends AnyFunction>(type: C): { <K extends keyof any>(name: K, obj: any): obj is Record<K, ReturnType<C>>; <K extends keyof any>(name: K): (obj: any) => obj is Record<K, ReturnType<C>>;};
/*Method: propOr
Explanation: It returns either `defaultValue` or the value of `property` in `obj`.
Example:
```const obj = {a: 1}const defaultValue = 'DEFAULT_VALUE'const property = 'a'
const result = [ R.propOr(defaultValue, property, Record<string, unknown>), R.propOr(defaultValue, 'foo', Record<string, unknown>)]// => [1, 'DEFAULT_VALUE']```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function propOr<T, P extends string>(defaultValue: T, property: P, obj: Partial<Record<P, T>> | undefined): T;export function propOr<T, P extends string>(defaultValue: T, property: P): (obj: Partial<Record<P, T>> | undefined) => T;export function propOr<T>(defaultValue: T): { <P extends string>(property: P, obj: Partial<Record<P, T>> | undefined): T; <P extends string>(property: P): (obj: Partial<Record<P, T>> | undefined) => T;}
/*Method: propSatisfies
Explanation: It returns `true` if the object property satisfies a given predicate.
Example:
```const obj = {a: {b:1}}const property = 'a'const predicate = x => x?.b === 1
const result = R.propSatisfies(predicate, property, Record<string, unknown>)// => true```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function propSatisfies<T>(predicate: Predicate<T>, property: string, obj: Record<string, T>): boolean;export function propSatisfies<T>(predicate: Predicate<T>, property: string): (obj: Record<string, T>) => boolean;
/*Method: range
Explanation: It returns list of numbers between `startInclusive` to `endExclusive` markers.
Example:
```R.range(0, 5)// => [0, 1, 2, 3, 4]```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function range(startInclusive: number, endExclusive: number): number[];export function range(startInclusive: number): (endExclusive: number) => number[];
/*Method: reduce
Explanation:
Example:
```const list = [1, 2, 3]const initialValue = 10const reducer = (prev, current) => prev * current
const result = R.reduce(reducer, initialValue, list)// => 60```
Categories: List
Notes: It passes index of the list as third argument to `reducer` function.
*/// @SINGLE_MARKERexport function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult, initialValue: TResult, list: T[]): TResult;export function reduce<T, TResult>(reducer: (prev: TResult, current: T) => TResult, initialValue: TResult, list: T[]): TResult;export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult): (initialValue: TResult, list: T[]) => TResult;export function reduce<T, TResult>(reducer: (prev: TResult, current: T, i: number) => TResult, initialValue: TResult): (list: T[]) => TResult;
/*Method: reject
Explanation: It has the opposite effect of `R.filter`.
Example:
```const list = [1, 2, 3, 4]const obj = {a: 1, b: 2}const predicate = x => x > 1
const result = [ R.reject(predicate, list), R.reject(predicate, Record<string, unknown>)]// => [[1], {a: 1}]```
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function reject<T>(predicate: Predicate<T>, list: T[]): T[];export function reject<T>(predicate: Predicate<T>): (list: T[]) => T[];export function reject<T>(predicate: Predicate<T>, obj: Dictionary<T>): Dictionary<T>;export function reject<T, U>(predicate: Predicate<T>): (obj: Dictionary<T>) => Dictionary<T>;
/*Method: repeat
Explanation:
Example:
```R.repeat('foo', 3)// => ['foo', 'foo', 'foo']```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function repeat<T>(x: T): (timesToRepeat: number) => T[];export function repeat<T>(x: T, timesToRepeat: number): T[];
/*Method: replace Explanation: It replaces `strOrRegex` found in `str` with `replacer`.
Example:
```const strOrRegex = /o/g
const result = R.replace(strOrRegex, '|0|', 'foo')// => 'f|0||0|'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function replace(strOrRegex: RegExp | string, replacer: RegExpReplacer, str: string): string;export function replace(strOrRegex: RegExp | string, replacer: RegExpReplacer): (str: string) => string;export function replace(strOrRegex: RegExp | string): (replacer: RegExpReplacer) => (str: string) => string;
/*Method: reverse
Explanation: It returns a reversed copy of list or string `input`.
Example:
```const result = [ R.reverse('foo'), R.reverse([1, 2, 3])]// => ['oof', [3, 2, 1]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function reverse<T>(input: T[]): T[];export function reverse(input: string): string;
/*Method: slice
Explanation:
Example:
```const list = [0, 1, 2, 3, 4, 5]const str = 'FOO_BAR'const from = 1const to = 4
const result = [ R.slice(from, to, str), R.slice(from, to, list)]// => ['OO_', [1, 2, 3]]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function slice(from: number, to: number, input: string): string;export function slice<T>(from: number, to: number, input: T[]): T[];export function slice(from: number, to: number): { (input: string): string; <T>(input: T[]): T[];};export function slice(from: number): { (to: number, input: string): string; <T>(to: number, input: T[]): T[];};
/*Method: sort
Explanation: It returns copy of `list` sorted by `sortFn` function, where `sortFn` needs to return only `-1`, `0` or `1`.
Example:
```const list = [ {a: 2}, {a: 3}, {a: 1}]const sortFn = (x, y) => { return x.a > y.a ? 1 : -1}
const result = R.sort(sortFn, list)const expected = [ {a: 1}, {a: 2}, {a: 3}]// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function sort<T>(sortFn: (a: T, b: T) => number, list: T[]): T[];export function sort<T>(sortFn: (a: T, b: T) => number): (list: T[]) => T[];
/*Method: sortBy
Explanation: It returns copy of `list` sorted by `sortFn` function, where `sortFn` function returns a value to compare, i.e. it doesn't need to return only `-1`, `0` or `1`.
Example:
```const list = [ {a: 2}, {a: 3}, {a: 1}]const sortFn = x => x.a
const result = R.sortBy(sortFn, list)const expected = [ {a: 1}, {a: 2}, {a: 3}]// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function sortBy<T>(sortFn: (a: T) => Ord, list: T[]): T[];export function sortBy<T>(sortFn: (a: T) => Ord): (list: T[]) => T[];export function sortBy(sortFn: (a: any) => Ord): <T>(list: T[]) => T[];
/*Method: sortWith
Explanation:
Example:
```const result = R.sortWith([ (a, b) => a.a === b.a ? 0 : a.a > b.a ? 1 : -1, (a, b) => a.b === b.b ? 0 : a.b > b.b ? 1 : -1,], [ {a: 1, b: 2}, {a: 2, b: 1}, {a: 2, b: 2}, {a: 1, b: 1},])const expected = [ {a: 1, b: 1}, {a: 1, b: 2}, {a: 2, b: 1}, {a: 2, b: 2},]// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function sortWith<T>(fns: Array<(a: T, b: T) => number>): (list: T[]) => T[];export function sortWith<T>(fns: Array<(a: T, b: T) => number>, list: T[]): T[];
/*Method: split
Explanation: Curried version of `String.prototype.split`
Example:
```const str = 'foo|bar|baz'const separator = '|'const result = R.split(separator, str)// => [ 'foo', 'bar', 'baz' ]```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function split(separator: string | RegExp): (str: string) => string[];export function split(separator: string | RegExp, str: string): string[];
/*Method: splitEvery
Explanation: It splits `input` into slices of `sliceLength`.
Example:
```const result = [ R.splitEvery(2, [1, 2, 3]), R.splitEvery(3, 'foobar') ]
const expected = [ [[1, 2], [3]], ['foo', 'bar']]// => `result` is equal to `expected````
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function splitEvery<T>(sliceLength: number, input: T[]): (T[])[];export function splitEvery(sliceLength: number, input: string): string[];export function splitEvery(sliceLength: number): { (input: string): string[]; <T>(input: T[]): (T[])[];};
/*Method: startsWith
Explanation: When iterable is a string, then it behaves as `String.prototype.startsWith`.When iterable is a list, then it uses R.equals to determine if the target list starts in the same way as the given target.
Example:
```const str = 'foo-bar'const list = [{a:1}, {a:2}, {a:3}]
const result = [ R.startsWith('foo', str), R.startsWith([{a:1}, {a:2}], list)]// => [true, true]```
Categories: String, List
Notes: It doesn't work with arrays unlike its corresponding **Ramda** method.
*/// @SINGLE_MARKERexport function startsWith<T extends string>(question: T, input: string): boolean;export function startsWith<T extends string>(question: T): (input: string) => boolean;export function startsWith<T>(question: T[], input: T[]): boolean;export function startsWith<T>(question: T[]): (input: T[]) => boolean;
/*Method: subtract
Explanation: Curried version of `x - y`
Example:
```const x = 3const y = 1
const result = R.subtract(x, y) // => 2```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function subtract(x: number, y: number): number;export function subtract(x: number): (y: number) => number;
/*Method: sum
Explanation:
Example:
```R.sum([1, 2, 3, 4, 5]) // => 15```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function sum(list: number[]): number;
/*Method: symmetricDifference
Explanation: It returns a merged list of `x` and `y` with all equal elements removed.
`R.equals` is used to determine equality.
Example:
```const x = [ 1, 2, 3, 4 ]const y = [ 3, 4, 5, 6 ]
const result = R.symmetricDifference(x, y)// => [ 1, 2, 5, 6 ]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function symmetricDifference<T>(x: T[], y: T[]): T[];export function symmetricDifference<T>(x: T[]): <T>(y: T[]) => T[];
/*Method: T
Explanation:


Example:
```R.T() // => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function T(): boolean;
/*Method: tail
Explanation: It returns all but the first element of `input`.
Example:
```const result = [ R.tail([1, 2, 3]), R.tail('foo') ]// => [[2, 3], 'oo']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function tail<T extends unknown[]>(input: T): T extends [any, ...infer U] ? U : [...T];export function tail(input: string): string;
/*Method: take
Explanation: It returns the first `howMany` elements of `input`.

Example:
```const howMany = 2
const result = [ R.take(howMany, [1, 2, 3]), R.take(howMany, 'foobar'),]// => [[1, 2], 'fo']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function take<T>(howMany: number, input: T[]): T[];export function take(howMany: number, input: string): string;export function take<T>(howMany: number): { <T>(input: T[]): T[]; (input: string): string;};
/*Method: takeLast
Explanation: It returns the last `howMany` elements of `input`.
Example:
```const howMany = 2
const result = [ R.takeLast(howMany, [1, 2, 3]), R.takeLast(howMany, 'foobar'),]// => [[2, 3], 'ar']```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function takeLast<T>(howMany: number, input: T[]): T[];export function takeLast(howMany: number, input: string): string;export function takeLast<T>(howMany: number): { <T>(input: T[]): T[]; (input: string): string;};
/*Method: tap
Explanation: It applies function `fn` to input `x` and returns `x`.
One use case is debugging in the middle of `R.compose`.
Example:
```const list = [1, 2, 3]
R.compose( R.map(x => x * 2) R.tap(console.log), R.filter(x => x > 1))(list)// => `2` and `3` will be logged```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function tap<T>(fn: (x: T) => void, input: T): T;export function tap<T>(fn: (x: T) => void): (input: T) => T;
/*Method: test
Explanation: It determines whether `str` matches `regExpression`.
Example:
```R.test(/^f/, 'foo')// => true```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function test(regExpression: RegExp): (str: string) => boolean;export function test(regExpression: RegExp, str: string): boolean;
/*Method: times
Explanation: It returns the result of applying function `fn` over members of range array.
The range array includes numbers between `0` and `howMany`(exclusive).
Example:
```const fn = x => x * 2const howMany = 5
R.times(fn, howMany)// => [0, 2, 4, 6, 8]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function times<T>(fn: (i: number) => T, howMany: number): T[];export function times<T>(fn: (i: number) => T): (howMany: number) => T[];
/*Method: toLower
Explanation:
Example:
```R.toLower('FOO')// => 'foo'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function toLower<S extends string>(str: S): Lowercase<S>;export function toLower(str: string): string;
/*Method: toUpper
Explanation:
Example:
```R.toUpper('foo')// => 'FOO'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function toUpper<S extends string>(str: S): Uppercase<S>;export function toUpper(str: string): string;
/*Method: toPairs
Explanation: It transforms an object to a list.

Example:
```const list = { a : 1, b : 2, c : [ 3, 4 ],}const expected = [ [ 'a', 1 ], [ 'b', 2 ], [ 'c', [ 3, 4 ] ] ]
const result = R.toPairs(list)// => `result` is equal to `expected````
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function toPairs<O extends object, K extends Extract<keyof O, string | number>>(obj: O): Array<{ [key in K]: [`${key}`, O[key]] }[K]>;export function toPairs<S>(obj: Record<string | number, S>): Array<[string, S]>;
/*Method: toString
Explanation:
Example:
```R.toString([1, 2]) // => '1,2'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function toString(x: unknown): string;
/*Method: transpose
Explanation:
Example:
```const list = [[10, 11], [20], [], [30, 31, 32]]const expected = [[10, 20, 30], [11, 31], [32]]
const result = R.transpose(list)// => `result` is equal to `expected````
Categories:
Notes:
*/// @SINGLE_MARKERexport function transpose<T>(list: (T[])[]): (T[])[];
/*Method: trim
Explanation:
Example:
```R.trim(' foo ') // => 'foo'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function trim(str: string): string;
/*Method: tryCatch
Explanation: It returns function that runs `fn` in `try/catch` block. If there was an error, then `fallback` is used to return the result. Note that `fn` can be value or asynchronous/synchronous function(unlike `Ramda` where fallback can only be a synchronous function).
Example:
```const fn = x => x.foo
const result = [ R.tryCatch(fn, false)(null), R.tryCatch(fn, false)({foo: 'bar'})]// => [false, 'bar']```
Categories: Logic
Notes: Please check the tests of `R.tryCatch` to fully understand how this method works.
*/// @SINGLE_MARKERexport function tryCatch<T, U>( fn: (input: T) => U, fallback: U): (input: T) => U;export function tryCatch<T, U>( fn: (input: T) => U, fallback: (input: T) => U): (input: T) => U;export function tryCatch<T>( fn: (input: any) => Promise<any>, fallback: T): (input: any) => Promise<T>;export function tryCatch<T>( fn: (input: any) => Promise<any>, fallback: (input: any) => Promise<any>,): (input: any) => Promise<T>;
/*Method: type
Explanation: It accepts any input and it returns its type.
Example:
```const result = R.type(() => {}) // => 'Function'R.type(async () => {}) // => 'Async'R.type([]) // => 'Array'R.type({}) // => 'Object'R.type('foo') // => 'String'R.type(1) // => 'Number'R.type(true) // => 'Boolean'R.type(null) // => 'Null'R.type(/[A-z]/) // => 'RegExp'R.type('foo'*1) // => 'NaN'
const delay = ms => new Promise(resolve => { setTimeout(function () { resolve() }, ms)})R.type(delay) // => 'Promise'```
Categories: Logic
Notes: `NaN`, `Promise` and `Async` are types specific for **Rambda**.
*/// @SINGLE_MARKERexport function type(x: any): RambdaTypes;
/*Method: union
Explanation: It takes two lists and return a new list containing a merger of both list with removed duplicates.
`R.equals` is used to compare for duplication.
Example:
```const result = R.union([1,2,3], [3,4,5]);// => [1, 2, 3, 4, 5]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function union<T>(x: T[], y: T[]): T[];export function union<T>(x: T[]): (y: T[]) => T[];
/*Method: uniq
Explanation: It returns a new array containing only one copy of each element of `list`.
`R.equals` is used to determine equality.
Example:
```const list = [1, 1, {a: 1}, {a: 2}, {a:1}]
R.uniq(list)// => [1, {a: 1}, {a: 2}]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function uniq<T>(list: T[]): T[];
/*Method: uniqWith
Explanation: It returns a new array containing only one copy of each element in `list` according to `predicate` function.
This predicate should return true, if two elements are equal.
Example:
```const list = [ {id: 0, title:'foo'}, {id: 1, title:'bar'}, {id: 2, title:'baz'}, {id: 3, title:'foo'}, {id: 4, title:'bar'},]
const expected = [ {id: 0, title:'foo'}, {id: 1, title:'bar'}, {id: 2, title:'baz'},]
const predicate = (x,y) => x.title === y.title
const result = R.uniqWith(predicate, list)// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function uniqWith<T, U>(predicate: (x: T, y: T) => boolean, list: T[]): T[];export function uniqWith<T, U>(predicate: (x: T, y: T) => boolean): (list: T[]) => T[];
/*Method: unless
Explanation: The method returns function that will be called with argument `input`.
If `predicate(input)` returns `false`, then the end result will be the outcome of `whenFalse(input)`.
In the other case, the final output will be the `input` itself.
Example:
```const fn = R.unless( x => x > 2, x => x + 10)
const result = [ fn(1), fn(5)]// => [11, 5]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U, x: T): T | U;export function unless<T, U>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => U): (x: T) => T | U;export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T, x: T): T;export function unless<T>(predicate: (x: T) => boolean, whenFalseFn: (x: T) => T): (x: T) => T;
/*Method: update
Explanation: It returns a copy of `list` with updated element at `index` with `newValue`.
Example:
```const index = 2const newValue = 88const list = [1, 2, 3, 4, 5]
const result = R.update(index, newValue, list)// => [1, 2, 88, 4, 5]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function update<T>(index: number, newValue: T, list: T[]): T[];export function update<T>(index: number, newValue: T): (list: T[]) => T[];
/*Method: values
Explanation: With correct input, this is nothing more than `Object.values(Record<string, unknown>)`. If `obj` is not an object, then it returns an empty array.
Example:
```const obj = {a:1, b:2}
R.values(Record<string, unknown>)// => [1, 2]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function values<T extends object, K extends keyof T>(obj: T): T[K][];
/*Method: when
Explanation: It pass `input` to `predicate` function and if the result is `true`, it will return the result of `whenTrueFn(input)`. If the `predicate` returns `false`, then it will simply return `input`.
Example:```const predicate = x => typeof x === 'number'const whenTrueFn = R.add(11)
const fn = when(predicate, whenTrueResult)
const positiveInput = 88const negativeInput = 'foo'
const result = [ fn(positiveInput), fn(positiveInput),]
const expected = [ 99, 'foo',]// => `result` is equal to `expected````
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U, input: T): T | U;export function when<T, U>(predicate: (x: T) => boolean, whenTrueFn: (a: T) => U): (input: T) => T | U;export function when<T, U>(predicate: (x: T) => boolean): ((whenTrueFn: (a: T) => U) => (input: T) => T | U);
/*Method: where
Explanation: It returns `true` if all each property in `conditions` returns `true` when applied to corresponding property in `input` object.
Example:
```const condition = R.where({ a : x => typeof x === "string", b : x => x === 4})const input = { a : "foo", b : 4, c : 11,}
const result = condition(input) // => true```
Categories: Object, Logic
Notes:
*/// @SINGLE_MARKERexport function where<T, U>(conditions: T, input: U): boolean;export function where<T>(conditions: T): <U>(input: U) => boolean;export function where<ObjFunc2, U>(conditions: ObjFunc2, input: U): boolean;export function where<ObjFunc2>(conditions: ObjFunc2): <U>(input: U) => boolean;
/*Method: whereEq
Explanation: It will return `true` if all of `input` object fully or partially include `rule` object.
`R.equals` is used to determine equality.
Example:
```const condition = { a : { b : 1 } }const input = { a : { b : 1 }, c : 2}
const result = whereEq(condition, input)// => true```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function whereEq<T, U>(condition: T, input: U): boolean;export function whereEq<T>(condition: T): <U>(input: U) => boolean;
/*Method: without
Explanation: It will return a new array, based on all members of `source` list that are not part of `matchAgainst` list.
`R.equals` is used to determine equality.
Example:
```const source = [1, 2, 3, 4]const matchAgainst = [2, 3]
const result = R.without(matchAgainst, source)// => [1, 4]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function without<T>(matchAgainst: T[], source: T[]): T[];export function without<T>(matchAgainst: T[]): (source: T[]) => T[];
/*Method: xor
Explanation: Logical XOR
Example:
```const result = [ xor(true, true), xor(false, false), xor(false, true),]// => [false, false, true]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function xor(x: boolean, y: boolean): boolean;export function xor(y: boolean): (y: boolean) => boolean;
/*Method: zip
Explanation: It will return a new array containing tuples of equally positions items from both `x` and `y` lists.
The returned list will be truncated to match the length of the shortest supplied list.
Example:
```const x = [1, 2]const y = ['A', 'B']R.zip(x, y)// => [[1, 'A'], [2, 'B']]
// truncates to shortest listR.zip([...x, 3], ['A', 'B'])// => [[1, 'A'], [2, 'B']]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function zip<K, V>(x: K[], y: V[]): KeyValuePair<K, V>[];export function zip<K>(x: K[]): <V>(y: V[]) => KeyValuePair<K, V>[];
/*Method: zipObj
Explanation: It will return a new object with keys of `keys` array and values of `values` array.
Example:
```const keys = ['a', 'b', 'c']
R.zipObj(keys, [1, 2, 3])// => {a: 1, b: 2, c: 3}
// truncates to shortest listR.zipObj(keys, [1, 2])// => {a: 1, b: 2}```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function zipObj<T, K extends string>(keys: K[], values: T[]): { [P in K]: T };export function zipObj<K extends string>(keys: K[]): <T>(values: T[]) => { [P in K]: T };export function zipObj<T, K extends number>(keys: K[], values: T[]): { [P in K]: T };export function zipObj<K extends number>(keys: K[]): <T>(values: T[]) => { [P in K]: T };
/*Method: props
Explanation: It takes list with properties `propsToPick` and returns a list with property values in `obj`.
Example:
```const result = R.props( ['a', 'b'], {a:1, c:3})// => [1, undefined]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function props<P extends string, T>(propsToPick: P[], obj: Record<P, T>): T[];export function props<P extends string>(propsToPick: P[]): <T>(obj: Record<P, T>) => T[];export function props<P extends string, T>(propsToPick: P[]): (obj: Record<P, T>) => T[];
/*Method: zipWith
Explanation:
Example:
```const list1 = [ 10, 20, 30, 40 ]const list2 = [ 100, 200 ]
const result = R.zipWith( R.add, list1, list2)// => [110, 220]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: T[], list2: U[]): TResult[];export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult, list1: T[]): (list2: U[]) => TResult[];export function zipWith<T, U, TResult>(fn: (x: T, y: U) => TResult): (list1: T[], list2: U[]) => TResult[];
/*Method: splitAt
Explanation: It splits string or array at a given index.
Example:
```const list = [ 1, 2, 3 ]const result = R.splitAt(2, list)// => [[ 1, 2 ], [ 3 ]]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function splitAt<T>(index: number, input: T[]): [T[], T[]];export function splitAt(index: number, input: string): [string, string];export function splitAt(index: number): { <T>(input: T[]): [T[], T[]]; (input: string): [string, string];};
/*Method: splitWhen
Explanation: It splits `list` to two arrays according to a `predicate` function.
The first array contains all members of `list` before `predicate` returns `true`.
Example:
```const list = [1, 2, 1, 2]const result = R.splitWhen(R.equals(2), list)// => [[1], [2, 1, 2]]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function splitWhen<T, U>(predicate: Predicate<T>, list: U[]): (U[])[];export function splitWhen<T>(predicate: Predicate<T>): <U>(list: U[]) => (U[])[];
/*Method: takeLastWhile
Explanation:
Example:
```const result = R.takeLastWhile( x => x > 2, [1, 2, 3, 4])// => [3, 4]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function takeLastWhile(predicate: (x: string) => boolean, input: string): string;export function takeLastWhile(predicate: (x: string) => boolean): (input: string) => string;export function takeLastWhile<T>(predicate: (x: T) => boolean, input: T[]): T[];export function takeLastWhile<T>(predicate: (x: T) => boolean): <T>(input: T[]) => T[];
/*Method: evolve
Explanation: It takes object or array of functions as set of rules. These `rules` are applied to the `iterable` input to produce the result.
Example:
```const rules = { foo : add(1), bar : add(-1),}const input = { a : 1, foo : 2, bar : 3,}const result = evolve(rules, input)const expected = { a : 1, foo : 3, bar : 2,})// => `result` is equal to `expected````
Categories: Object, List
Notes: Error handling of this method differs between Ramda and Rambda. Ramda for some wrong inputs returns result and for other - it returns one of the inputs. Rambda simply throws when inputs are not correct. Full details for this mismatch are listed in `source/_snapshots/evolve.spec.js.snap` file.
*/// @SINGLE_MARKERexport function evolve<T, U>(rules: ((x: T) => U)[], list: T[]): U[];export function evolve<T, U>(rules: ((x: T) => U)[]) : (list: T[]) => U[];export function evolve<E extends Evolver, V extends Evolvable<E>>(rules: E, obj: V): Evolve<V, E>;export function evolve<E extends Evolver>(rules: E): <V extends Evolvable<E>>(obj: V) => Evolve<V, E>;
/*Method: dropLastWhile
Explanation:
Example:
```const list = [1, 2, 3, 4, 5];const predicate = x => x >= 3
const result = dropLastWhile(predicate, list);// => [1, 2]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function dropLastWhile(predicate: (x: string) => boolean, iterable: string): string;export function dropLastWhile(predicate: (x: string) => boolean): (iterable: string) => string;export function dropLastWhile<T>(predicate: (x: T) => boolean, iterable: T[]): T[];export function dropLastWhile<T>(predicate: (x: T) => boolean): <T>(iterable: T[]) => T[];
/*Method: dropRepeats
Explanation: It removes any successive duplicates according to `R.equals`.
Example:
```const result = R.dropRepeats([ 1, 1, {a: 1}, {a:1}, 1])// => [1, {a: 1}, 1]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function dropRepeats<T>(list: T[]): T[];
/*Method: dropRepeatsWith
Explanation:
Example:
```const list = [{a:1,b:2}, {a:1,b:3}, {a:2, b:4}]const result = R.dropRepeatsWith(R.prop('a'), list)
// => [{a:1,b:2}, {a:2, b:4}]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean, list: T[]): T[];export function dropRepeatsWith<T>(predicate: (x: T, y: T) => boolean): (list: T[]) => T[];
/*Method: dropWhile
Explanation:
Example:
```const list = [1, 2, 3, 4]const predicate = x => x < 3const result = R.dropWhile(predicate, list)// => [3, 4]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function dropWhile(fn: Predicate<string>, iterable: string): string;export function dropWhile(fn: Predicate<string>): (iterable: string) => string;export function dropWhile<T>(fn: Predicate<T>, iterable: T[]): T[];export function dropWhile<T>(fn: Predicate<T>): (iterable: T[]) => T[];
/*Method: takeWhile
Explanation:
Example:
```const list = [1, 2, 3, 4]const predicate = x => x < 3
const result = R.takeWhile(predicate, list)// => [1, 2]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function takeWhile(fn: Predicate<string>, iterable: string): string;export function takeWhile(fn: Predicate<string>): (iterable: string) => string;export function takeWhile<T>(fn: Predicate<T>, iterable: T[]): T[];export function takeWhile<T>(fn: Predicate<T>): (iterable: T[]) => T[];
/*Method: eqProps
Explanation: It returns `true` if property `prop` in `obj1` is equal to property `prop` in `obj2` according to `R.equals`.
Example:
```const obj1 = {a: 1, b:2}const obj2 = {a: 1, b:3}const result = R.eqProps('a', obj1, obj2)// => true ```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function eqProps<T, U>(prop: string, obj1: T, obj2: U): boolean;export function eqProps<P extends string>(prop: P): <T, U>(obj1: Record<P, T>, obj2: Record<P, U>) => boolean;export function eqProps<T>(prop: string, obj1: T): <U>(obj2: U) => boolean;
/*Method: unapply
Explanation: It calls a function `fn` with the list of values of the returned function.
`R.unapply` is the opposite of `R.apply` method.
Example:
```R.unapply(JSON.stringify)(1, 2, 3)//=> '[1,2,3]'```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function unapply<T = any>(fn: (args: any[]) => T): (...args: any[]) => T;
/*Method: apply
Explanation: It applies function `fn` to the list of arguments.
This is useful for creating a fixed-arity function from a variadic function. `fn` should be a bound function if context is significant.
Example:
```const result = R.apply(Math.max, [42, -Infinity, 1337])// => 1337```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function apply<T = any>(fn: (...args: any[]) => T, args: any[]): T;export function apply<T = any>(fn: (...args: any[]) => T): (args: any[]) => T;
/*Method: bind
Explanation: Creates a function that is bound to a context.
Example:
```const log = R.bind(console.log, console)const result = R.pipe( R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); // => result - `{a: 3}`// => console log - `{a: 2}````
Categories: Logic
Notes: R.bind does not provide the additional argument-binding capabilities of `Function.prototype.bind`.
*/// @SINGLE_MARKERexport function bind<F extends AnyFunction, T>(fn: F, thisObj: T): (...args: Parameters<F>) => ReturnType<F>;export function bind<F extends AnyFunction, T>(fn: F): (thisObj: T) => (...args: Parameters<F>) => ReturnType<F>;
/*Method: mergeWith
Explanation: It takes two objects and a function, which will be used when there is an overlap between the keys.
Example:
```const result = R.mergeWith( R.concat, {values : [ 10, 20 ]}, {values : [ 15, 35 ]})// => [ 10, 20, 15, 35 ]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mergeWith(fn: (x: any, z: any) => any, a: Record<string, unknown>, b: Record<string, unknown>): Record<string, unknown>;export function mergeWith<Output>(fn: (x: any, z: any) => any, a: Record<string, unknown>, b: Record<string, unknown>): Output;export function mergeWith(fn: (x: any, z: any) => any, a: Record<string, unknown>): (b: Record<string, unknown>) => Record<string, unknown>;export function mergeWith<Output>(fn: (x: any, z: any) => any, a: Record<string, unknown>): (b: Record<string, unknown>) => Output;export function mergeWith(fn: (x: any, z: any) => any): <U, V>(a: U, b: V) => Record<string, unknown>;export function mergeWith<Output>(fn: (x: any, z: any) => any): <U, V>(a: U, b: V) => Output;
/*Method: juxt
Explanation: It applies list of function to a list of inputs.
Example:
```const getRange = juxt([ Math.min, Math.max, Math.min ])const result = getRange( 3, 4, 9, -3)// => [-3, 9, -3]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function juxt<A extends any[], R1>(fns: [(...a: A) => R1]): (...a: A) => [R1];export function juxt<A extends any[], R1, R2>(fns: [(...a: A) => R1, (...a: A) => R2]): (...a: A) => [R1, R2];export function juxt<A extends any[], R1, R2, R3>(fns: [(...a: A) => R1, (...a: A) => R2, (...a: A) => R3]): (...a: A) => [R1, R2, R3];export function juxt<A extends any[], R1, R2, R3, R4>(fns: [(...a: A) => R1, (...a: A) => R2, (...a: A) => R3, (...a: A) => R4]): (...a: A) => [R1, R2, R3, R4];export function juxt<A extends any[], R1, R2, R3, R4, R5>(fns: [(...a: A) => R1, (...a: A) => R2, (...a: A) => R3, (...a: A) => R4, (...a: A) => R5]): (...a: A) => [R1, R2, R3, R4, R5];export function juxt<A extends any[], U>(fns: Array<(...args: A) => U>): (...args: A) => U[];
/*Method: count
Explanation: It counts how many times `predicate` function returns `true`, when supplied with iteration of `list`.
Example:
```const list = [{a: 1}, 1, {a:2}]const result = R.count(x => x.a !== undefined, list)// => 2```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function count<T>(predicate: (x: T) => boolean, list: T[]): number;export function count<T>(predicate: (x: T) => boolean): (list: T[]) => number;
/*Method: countBy
Explanation: It counts elements in a list after each instance of the input list is passed through `transformFn` function.
Example:
```const list = [ 'a', 'A', 'b', 'B', 'c', 'C' ]
const result = countBy(R.toLower, list)const expected = { a: 2, b: 2, c: 2 }// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function countBy<T extends unknown>(transformFn: (x: T) => any, list: T[]): Record<string, number>;export function countBy<T extends unknown>(transformFn: (x: T) => any): (list: T[]) => Record<string, number>;
/*Method: unwind
Explanation:
Example:
```const obj = { a: 1, b: [2, 3],}const result = R.unwind('b', obj)const expected = [{a:1, b:2}, {a:1, b:3}]// => `result` is equal to `expected````
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function unwind<T, U>(prop: keyof T, obj: T): U[];export function unwind<T, U>(prop: keyof T): (obj: T) => U[];
/*Method: on
Explanation: It passes the two inputs through `unaryFn` and then the results are passed as inputs the the `binaryFn` to receive the final result(`binaryFn(unaryFn(FIRST_INPUT), unaryFn(SECOND_INPUT))`).
This method is also known as P combinator.
Example:
```const result = R.on((a, b) => a + b, R.prop('a'), {b:0, a:1}, {a:2})// => 3```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function on<T, U, R>(binaryFn: (a: U, b: U) => R, unaryFn: (value: T) => U, a: T, b: T): R;export function on<T, U, R>(binaryFn: (a: U, b: U) => R, unaryFn: (value: T) => U, a: T): (b: T) => R;export function on<T, U, R>(binaryFn: (a: U, b: U) => R, unaryFn: (value: T) => U): { (a: T, b: T): R; (a: T): (b: T) => R;};
/*Method: whereAny
Explanation: Same as `R.where`, but it will return `true` if at least one condition check returns `true`.
Example:
```const conditions = { a: a => a > 1, b: b => b > 2,}const result = [ R.whereAny(conditions, {b:3}), R.whereAny(conditions, {c:4})]// => [true, false]```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function whereAny<T, U>(conditions: T, input: U): boolean;export function whereAny<T>(conditions: T): <U>(input: U) => boolean;export function whereAny<ObjFunc2, U>(conditions: ObjFunc2, input: U): boolean;export function whereAny<ObjFunc2>(conditions: ObjFunc2): <U>(input: U) => boolean;
/*Method: partialObject
Explanation: `R.partialObject` is a curry helper designed specifically for functions accepting object as a single argument.
Initially the function knows only a part from the whole input object and then `R.partialObject` helps in preparing the function for the second part, when it receives the rest of the input.
Example:
```const fn = ({ a, b, c }) => a + b + cconst curried = R.partialObject(fn, { a : 1 })const result = curried({ b : 2, c : 3,})// => 6```
Categories: Logic, Async
Notes: Function input can be asynchronous
*/// @SINGLE_MARKERexport function partialObject<Input, PartialInput, Output>( fn: (input: Input) => Output, partialInput: PartialInput,): (input: Pick<Input, Exclude<keyof Input, keyof PartialInput>>) => Output;
/*Method: uniqBy
Explanation:
It applies uniqueness to input list based on function that defines what to be used for comparison between elements.
`R.equals` is used to determine equality.
Example:
```const list = [{a:1}, {a:2}, {a:1}]const result = R.uniqBy(x => x, list)
// => [{a:1}, {a:2}]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function uniqBy<T, U>(fn: (a: T) => U, list: T[]): T[];export function uniqBy<T, U>(fn: (a: T) => U): (list: T[]) => T[];
/*Method: modifyPath
Explanation: It changes a property of object on the base of provided path and transformer function.
Example:
```const result = R.modifyPath('a.b.c', x=> x+1, {a:{b: {c:1}}})// => {a:{b: {c:2}}}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function modifyPath<T extends Record<string, unknown>>(path: Path, fn: (x: any) => unknown, object: Record<string, unknown>): T;export function modifyPath<T extends Record<string, unknown>>(path: Path, fn: (x: any) => unknown): (object: Record<string, unknown>) => T;export function modifyPath<T extends Record<string, unknown>>(path: Path): (fn: (x: any) => unknown) => (object: Record<string, unknown>) => T;
/*Method: modify
Explanation:
Example:
```const result = R.modify()// => ```
Categories:
Notes:
*/// @SINGLE_MARKERexport function modify<T extends object, K extends keyof T, P>( prop: K, fn: (a: T[K]) => P, obj: T,): Omit<T, K> & Record<K, P>;export function modify<K extends string, A, P>( prop: K, fn: (a: A) => P,): <T extends Record<K, A>>(target: T) => Omit<T, K> & Record<K, P>;
/*Method: unnest
Explanation:
Example:
```const result = R.unnest([1, [2], [[3]]])// => [1, 2, [3]]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function unnest(list: unknown[]): unknown[];export function unnest<T>(list: unknown[]): T;
/*Method: differenceWith
Explanation:
Example:
```const result = R.differenceWith( (a, b) => a.x === b.x, [{x: 1}, {x: 2}], [{x: 1}, {x: 3}])// => [{x: 2}]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function differenceWith<T1, T2>( pred: (a: T1, b: T2) => boolean, list1: T1[], list2: T2[],): T1[];export function differenceWith<T1, T2>( pred: (a: T1, b: T2) => boolean,): (list1: T1[], list2: T2[]) => T1[];export function differenceWith<T1, T2>( pred: (a: T1, b: T2) => boolean, list1: T1[],): (list2: T2[]) => T1[];
/*Method: addIndex
Explanation:
Example:
```const result = R.addIndex(R.map)((val, idx) => val + idx + 1, [1, 2, 3])// => [2, 4, 6]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function addIndex(originalFn: any): (fn: any) => (list: any[]) => any[];export function addIndex(originalFn: any): (fn: any, list: any[]) => any[];
/*Method: ap
Explanation: It takes a list of functions and a list of values. Then it returns a list of values obtained by applying each function to each value.
Example:
```const result = R.ap( [ x => x + 1, x => x + 2, ], [1, 2, 3])// => [2, 3, 4, 3, 4, 5]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function ap<T, U>(fns: Array<(a: T) => U>[], vs: T[]): U[];export function ap<T, U>(fns: Array<(a: T) => U>): (vs: T[]) => U[];export function ap<R, A, B>(fn: (r: R, a: A) => B, fn1: (r: R) => A): (r: R) => B;
/*Method: addIndexRight
Explanation: Same as `R.addIndex`, but it will passed indexes are decreasing, instead of increasing.
Example:
``````
Categories:
Notes:
*/// @SINGLE_MARKERexport function addIndexRight(originalFn: any): (fn: any) => (list: any[]) => any[];export function addIndexRight(originalFn: any): (fn: any, list: any[]) => any[];
/*Method: aperture
Explanation: It returns a new list, composed of consecutive `n`-tuples from a `list`.
Example:
```const result = R.aperture(2, [1, 2, 3, 4])// => [[1, 2], [2, 3], [3, 4]]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function aperture<N extends number, T>(n: N, list: T[]): Array<Tuple<T, N>> | [];export function aperture<N extends number>(n: N): <T>(list: T[]) => Array<Tuple<T, N>> | [];

/*Method: applyTo
Explanation:
Example:
```const result = R.applyTo( 1, x => x + 1)// => 2```
Categories:
Notes:
*/// @SINGLE_MARKERexport function applyTo<T, U>(el: T, fn: (t: T) => U): U;export function applyTo<T>(el: T): <U>(fn: (t: T) => U) => U;
/*Method: ascend
Explanation:
Example:
```const result = R.sort( R.ascend(x => x), [2, 1])// => [1, 2]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function ascend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;export function ascend<T>(fn: (obj: T) => Ord): (a: T, b: T) => Ordering;
/*Method: descend
Explanation:
Example:
```R.sort( R.descend(x => x), [1, 2])// => [2, 1]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function descend<T>(fn: (obj: T) => Ord, a: T, b: T): Ordering;export function descend<T>(fn: (obj: T) => Ord): (a: T, b: T) => Ordering;
/*Method: binary
Explanation:
Example:
```const result = R.binary( (a, b, c) => a + b + c,)(1, 2, 3, 4)// => 3```
Categories:
Notes:
*/// @SINGLE_MARKERexport function binary<T extends (...arg: any[]) => any>(fn: T): (...args: any[]) => ReturnType<T>;
/*Method: call
Explanation:
Example:
```const result = R.call( (a, b) => a + b, 1, 2)// => 3```
Categories:
Notes:
*/// @SINGLE_MARKERexport function call<T extends (...args: any[]) => any>(fn: T, ...args: Parameters<T>): ReturnType<T>;
/*Method: collectBy
Explanation:
Example:
```const result = R.collectBy( x => x % 2, [1, 2, 3, 4])// => [[2, 4], [1, 3]]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K, list: T[]): T[][];export function collectBy<T, K extends PropertyKey>(keyFn: (value: T) => K): (list: T[]) => T[][];
/*Method: comparator
Explanation: It returns a comparator function that can be used in `sort` method.
Example:
```const result = R.sort( R.comparator((a, b) => a.x < b.x), [{x: 2}, {x: 1}])// => [{x: 1}, {x: 2}]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function comparator<T>(pred: (a: T, b: T) => boolean): (x: T, y: T) => Ordering;
/*Method: composeWith
Explanation:
Example:
```const result = R.composeWith( (fn, intermediateResult) => fn(intermediateResult), [ R.map(x => x + 1), R.map(x => x * 2), ])([1, 2, 3])// => [3, 5, 7]```
Categories: Function
Notes:
*/// @SINGLE_MARKERexport function composeWith<TArgs extends any[], TResult>( transformer: (fn: (...args: any[]) => any, intermediatResult: any) => any, fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,): (...args: TArgs) => TResult;export function composeWith( transformer: (fn: (...args: any[]) => any, intermediatResult: any) => any,): <TArgs extends any[], TResult>( fns: AtLeastOneFunctionsFlowFromRightToLeft<TArgs, TResult>,) => (...args: TArgs) => TResult;
/*Method: dissocPath
Explanation:
Example:
```const result = R.dissocPath(['a', 'b'], {a: {b: 1, c: 2}})// => {a: {c: 2}}```
Categories:
Notes:
*/// @SINGLE_MARKERexport function dissocPath<T>(path: Path, obj: any): T;export function dissocPath<T>(path: Path): (obj: any) => T;
/*Method: removeIndex
Explanation: It returns a copy of `list` input with removed `index`.
Example:
```const list = [1, 2, 3, 4]const result = R.removeIndex(1, list)// => [1, 3, 4]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function removeIndex<T>(index: number, list: T[]): T[];export function removeIndex(index: number): <T>(list: T[]) => T[];
/*Method: dropRepeatsBy
Explanation:
Example:
```const result = R.dropRepeatsBy( Math.abs, [1, -1, 2, 3, -3])// => [1, 2, 3]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function dropRepeatsBy<T, U>(fn: (a: T) => U, list: T[]): T[];export function dropRepeatsBy<T, U>( fn: (a: T) => U): (list: T[]) => T[];export function dropRepeatsBy(fn: any): <T>(list: T[]) => T[];
/*Method: empty
Explanation:
Example:
```const result = [R.empty([1,2,3]), R.empty('foo'), R.empty({x: 1, y: 2})]// => [[], '', {}]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function empty<T>(x: T): T;
/*Method: eqBy
Explanation:
Example:
```const result = R.eqBy(Math.abs, 5, -5)// => true```
Categories:
Notes:
*/// @SINGLE_MARKERexport function eqBy<T>(fn: (a: T) => unknown, a: T, b: T): boolean;export function eqBy<T>(fn: (a: T) => unknown, a: T): (b: T) => boolean;export function eqBy<T>(fn: (a: T) => unknown): { (a: T, b: T): boolean; (a: T): (b: T) => boolean;};
/*Method: forEachObjIndexed
Explanation:
Example:
``````
Categories:
Notes:
*/// @SINGLE_MARKERexport function forEachObjIndexed<T>(fn: (value: T[keyof T], key: keyof T, obj: T) => void, obj: T): T;export function forEachObjIndexed<T>(fn: (value: T[keyof T], key: keyof T, obj: T) => void): (obj: T) => T;
/*Method: gt
Explanation:
Example:
```const result = [R.gt(2, 1), R.gt(2, 3)]// => [true, false]```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function gt<T, U>(x: T, y: U): boolean;export function gt<T, U>(x: T): (y: U) => boolean;
/*Method: gte
Explanation:
Example:
```const result = [R.gte(2, 1), R.gte(2, 2), R.gte(2, 3)]// => [true, true, false]```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function gte<T, U>(x: T, y: U): boolean;export function gte<T, U>(x: T): (y: U) => boolean;
/*Method: lt
Explanation:
Example:
```const result = [R.lt(2, 1), R.lt(2, 3)]// => [false, true]```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function lt<T, U>(x: T, y: U): boolean;export function lt<T, U>(x: T): (y: U) => boolean;
/*Method: lte
Explanation:
Example:
```const result = [R.lte(2, 1), R.lte(2, 2), R.lte(2, 3)]// => [false, true, true]```
Categories: Number
Notes:
*/// @SINGLE_MARKER
export function lte<T, U>(x: T, y: U): boolean;export function lte<T, U>(x: T): (y: U) => boolean;
/*Method: reduceBy
Explanation:
Example:
```const result = R.reduceBy( (acc, elem) => acc + elem, 0, x => x > 2 ? 'big' : 'small', [1, 2, 3, 4, 5])// => { big: 12, small: 3 }```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function reduceBy<T, TResult>( valueFn: (acc: TResult, elem: T) => TResult,): (a: TResult, b: (elem: T) => string, c: T[]) => { [index: string]: TResult }export function reduceBy<T, TResult>( valueFn: (acc: TResult, elem: T) => TResult, acc: TResult,): (a: (elem: T) => string, b: T[]) => { [index: string]: TResult }export function reduceBy<T, TResult>( valueFn: (acc: TResult, elem: T) => TResult, acc: TResult, keyFn: (elem: T) => string,): (list: T[]) => { [index: string]: TResult };export function reduceBy<T, TResult>( valueFn: (acc: TResult, elem: T) => TResult, acc: TResult, keyFn: (elem: T) => string, list: T[],): { [index: string]: TResult };
/*Method: hasIn
Explanation:
Example:
```const result = R.hasIn('a', {a: 1})// => true```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function hasIn(searchProperty: string): <T>(obj: T) => boolean;export function hasIn<T>(searchProperty: string, obj: T): boolean;
/*Method: innerJoin
Explanation: It returns a new list by applying a `predicate` function to all elements of `list1` and `list2` and keeping only these elements where `predicate` returns `true`.
Example:
```const list1 = [1, 2, 3, 4, 5]const list2 = [4, 5, 6]const predicate = (x, y) => x >= yconst result = R.innerJoin(predicate, list1, list2)// => [4, 5]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function innerJoin<T1, T2>( pred: (a: T1, b: T2) => boolean,): (list1: T1[], list2: T2[]) => T1[];export function innerJoin<T1, T2>( pred: (a: T1, b: T2) => boolean, list1: T1[],): (list2: T2[]) => T1[];export function innerJoin<T1, T2>(pred: (a: T1, b: T2) => boolean, list1: T1[], list2: T2[]): T1[];
/*Method: insert
Explanation:
Example:
```const list = ['a', 'b', 'c', 'd', 'e'];const result = R.insert(2, 'x', list);// => ['a', 'b', 'x', 'c', 'd', 'e']```
Categories:
Notes:
*/// @SINGLE_MARKERexport function insert(index: number): <T>(itemToInsert: T, list: T[]) => T[];export function insert<T>(index: number, itemToInsert: T): (list: T[]) => T[];export function insert<T>(index: number, itemToInsert: T, list: T[]): T[];
/*Method: insertAll
Explanation:
Example:
```const list = ['a', 'b', 'c', 'd', 'e'];const result = R.insertAll(2, ['x', 'y', 'z'], list);// => ['a', 'b', 'x', 'y', 'z', 'c', 'd', 'e']```
Categories:
Notes:
*/// @SINGLE_MARKERexport function insertAll(index: number): <T>(itemsToInsert: T[], list: T[]) => T[];export function insertAll<T>(index: number, itemsToInsert: T[]): (list: T[]) => T[];export function insertAll<T>(index: number, itemsToInsert: T[], list: T[]): T[];
/*Method: isNotNil
Explanation:
Example:
```const result = [ R.isNotNil(null), R.isNotNil(undefined), R.isNotNil([]),]// => [false, false, true]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function isNotNil<T>(value: T): value is NonNullable<T>;
/*Method: pickBy
Explanation:
Example:
```const result = R.pickBy( x => x > 1, {a: 1, b: 2, c: 3})// => {b: 2, c: 3}```
Categories:
Notes:
*/// @SINGLE_MARKERexport function pickBy<T>(pred: ObjPred<T>): <U, V extends T>(obj: V) => U;export function pickBy<T, U>(pred: ObjPred<T>, obj: T): U;
/*Method: pathSatisfies
Explanation:
Example:
```const result = R.pathSatisfies( x => x > 0, ['a', 'b', 'c'], {a: {b: {c: 1}}})// => true```
Categories:
Notes:
*/// @SINGLE_MARKERexport function pathSatisfies<T, U>(pred: (val: T) => boolean, path: Path): (obj: U) => boolean;export function pathSatisfies<T, U>(pred: (val: T) => boolean, path: Path, obj: U): boolean;
/*Method: swap
Explanation:
Example:
```const result = R.swap(1, 2, [1, 2, 3])// => [1, 3, 2]```
Categories:
Notes:
*/// @SINGLE_MARKERexport function swap(indexA: number, indexB: number): <T>(list: T[]) => T[];export function swap<T>(indexA: number, indexB: number, list: T[]): T[];
/*Method: mergeDeepLeft
Explanation:
Example:
```const result = R.mergeDeepLeft( {a: {b: 1}}, {a: {b: 2, c: 3}})// => {a: {b: 1, c: 3}}```
Categories:
Notes:
*/// @SINGLE_MARKERexport function mergeDeepLeft<Output>(newProps: object, target: object): Output;export function mergeDeepLeft<Output>(newProps: object): (target: object) => Output;
// RAMBDAX_MARKER_START
/*Method: allFalse
Explanation: It returns `true` if all `inputs` arguments are falsy(empty objects and empty arrays are considered falsy).
Functions are valid inputs, but these functions cannot have their own arguments.
This method is very similar to `R.anyFalse`, `R.anyTrue` and `R.allTrue`
Example:
```R.allFalse(0, null, [], {}, '', () => false)// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function allFalse(...inputs: any[]): boolean;
/*Method: anyFalse
Explanation: It returns `true` if any of `inputs` is falsy(empty objects and empty arrays are considered falsy).
Example:
```R.anyFalse(1, {a: 1}, [1], () => false)// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function anyFalse(...input: any[]): boolean;
/*Method: allTrue
Explanation: It returns `true` if all `inputs` arguments are truthy(empty objects and empty arrays are considered falsy).
Example:
```R.allTrue(1, true, {a: 1}, [1], 'foo', () => true)// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function allTrue(...input: any[]): boolean;
/*Method: anyTrue
Explanation: It returns `true` if any of `inputs` arguments are truthy(empty objects and empty arrays are considered falsy).
Example:
```R.anyTrue(0, null, [], {}, '', () => true)// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function anyTrue(...input: any[]): boolean;
/*Method: allType
Explanation: It returns a function which will return `true` if all of its `inputs` arguments belong to `targetType`.
Example:
```const targetType = 'String'
const result = R.allType( targetType)('foo', 'bar', 'baz')// => true```
Categories: Logic
Notes: `targetType` is one of the possible returns of `R.type`
*/// @SINGLE_MARKERexport function allType(targetType: RambdaTypes): (...input: any[]) => boolean;
/*Method: anyType
Explanation: It returns a function which will return `true` if at least one of its `inputs` arguments belongs to `targetType`.
`targetType` is one of the possible returns of `R.type`
Example:
```const targetType = 'String'
const result = R.anyType( targetType)(1, {}, 'foo')// => true```
Categories: Logic
Notes: `targetType` is one of the possible returns of `R.type`
*/// @SINGLE_MARKERexport function anyType(targetType: RambdaTypes): (...input: any[]) => boolean;
/*Method: composeAsync
Explanation: Asynchronous version of `R.compose`. `await`s the result of each function before passing it to the next. Returns a `Promise` of the result.
Example:
```const add = async x => { await R.delay(100) return x + 1}const multiply = async x => { await R.delay(100) return x * 2 }
const result = await R.composeAsync( add, multiply)(1)// `result` resolves to `3````
Categories: Logic, Async
*/// @SINGLE_MARKERexport function composeAsync<TArg, R1, R2, R3, R4, R5, R6, R7, TResult>( ...func: [ fnLast: (a: any) => TResult, ...func: Array<(a: any) => any>, f7: (a: Awaited<R6>) => R7, f6: (a: Awaited<R5>) => R6, f5: (a: Awaited<R4>) => R5, f4: (a: Awaited<R3>) => R4, f3: (a: Awaited<R2>) => R3, f2: (a: Awaited<R1>) => R2, f1: (a: Awaited<TArg>) => R1 ]): (a: TArg | Promise<TArg>) => TResult;export function composeAsync<TArg, R1, R2, R3, R4, R5, R6, R7, TResult>( f7: (a: Awaited<R6>) => R7, f6: (a: Awaited<R5>) => R6, f5: (a: Awaited<R4>) => R5, f4: (a: Awaited<R3>) => R4, f3: (a: Awaited<R2>) => R3, f2: (a: Awaited<R1>) => R2, f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R7;export function composeAsync<TArg, R1, R2, R3, R4, R5, R6, R7>( f7: (a: Awaited<R6>) => R7, f6: (a: Awaited<R5>) => R6, f5: (a: Awaited<R4>) => R5, f4: (a: Awaited<R3>) => R4, f3: (a: Awaited<R2>) => R3, f2: (a: Awaited<R1>) => R2, f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R7;export function composeAsync<TArg, R1, R2, R3, R4, R5, R6>( f6: (a: Awaited<R5>) => R6, f5: (a: Awaited<R4>) => R5, f4: (a: Awaited<R3>) => R4, f3: (a: Awaited<R2>) => R3, f2: (a: Awaited<R1>) => R2, f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R6;export function composeAsync<TArg, R1, R2, R3, R4, R5>( f5: (a: Awaited<R4>) => R5, f4: (a: Awaited<R3>) => R4, f3: (a: Awaited<R2>) => R3, f2: (a: Awaited<R1>) => R2, f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R5;export function composeAsync<TArg, R1, R2, R3, R4>( f4: (a: Awaited<R3>) => R4, f3: (a: Awaited<R2>) => R3, f2: (a: Awaited<R1>) => R2, f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R4;export function composeAsync<TArg, R1, R2, R3>( f3: (a: Awaited<R2>) => R3, f2: (a: Awaited<R1>) => R2, f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R3;export function composeAsync<TArg, R1, R2>( f2: (a: Awaited<R1>) => R2, f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R2;export function composeAsync<TArg, R1>( f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R1;
/*Method: pipeAsync
Explanation: Asynchronous version of `R.pipe`. `await`s the result of each function before passing it to the next. Returns a `Promise` of the result.
Example:
```const add = async x => { await R.delay(100) return x + 1}const multiply = async x => { await R.delay(100) return x * 2 }
const result = await R.pipeAsync( add, multiply)(1)// `result` resolves to `4````
Categories: Logic, Async
*/// @SINGLE_MARKERexport function pipeAsync<TArg, R1, R2, R3, R4, R5, R6, R7, TResult>( ...funcs: [ f1: (a: Awaited<TArg>) => R1, f2: (a: Awaited<R1>) => R2, f3: (a: Awaited<R2>) => R3, f4: (a: Awaited<R3>) => R4, f5: (a: Awaited<R4>) => R5, f6: (a: Awaited<R5>) => R6, f7: (a: Awaited<R6>) => R7, ...func: Array<(a: any) => any>, fnLast: (a: any) => TResult ]): (a: TArg | Promise<TArg>) => TResult; // fallback overload if number of piped functions greater than 7export function pipeAsync<TArg, R1, R2, R3, R4, R5, R6, R7>( f1: (a: Awaited<TArg>) => R1, f2: (a: Awaited<R1>) => R2, f3: (a: Awaited<R2>) => R3, f4: (a: Awaited<R3>) => R4, f5: (a: Awaited<R4>) => R5, f6: (a: Awaited<R5>) => R6, f7: (a: Awaited<R6>) => R7): (a: TArg | Promise<TArg>) => R7;export function pipeAsync<TArg, R1, R2, R3, R4, R5, R6>( f1: (a: Awaited<TArg>) => R1, f2: (a: Awaited<R1>) => R2, f3: (a: Awaited<R2>) => R3, f4: (a: Awaited<R3>) => R4, f5: (a: Awaited<R4>) => R5, f6: (a: Awaited<R5>) => R6): (a: TArg | Promise<TArg>) => R6;export function pipeAsync<TArg, R1, R2, R3, R4, R5>( f1: (a: Awaited<TArg>) => R1, f2: (a: Awaited<R1>) => R2, f3: (a: Awaited<R2>) => R3, f4: (a: Awaited<R3>) => R4, f5: (a: Awaited<R4>) => R5): (a: TArg | Promise<TArg>) => R5;export function pipeAsync<TArg, R1, R2, R3, R4>( f1: (a: Awaited<TArg>) => R1, f2: (a: Awaited<R1>) => R2, f3: (a: Awaited<R2>) => R3, f4: (a: Awaited<R3>) => R4): (a: TArg | Promise<TArg>) => R4;export function pipeAsync<TArg, R1, R2, R3>( f1: (a: Awaited<TArg>) => R1, f2: (a: Awaited<R1>) => R2, f3: (a: Awaited<R2>) => R3): (a: TArg | Promise<TArg>) => R3;export function pipeAsync<TArg, R1, R2>( f1: (a: Awaited<TArg>) => R1, f2: (a: Awaited<R1>) => R2): (a: TArg | Promise<TArg>) => R2;export function pipeAsync<TArg, R1>( f1: (a: Awaited<TArg>) => R1): (a: TArg | Promise<TArg>) => R1;
/*Method: debounce
Explanation:
Example:
```let counter = 0const increment = () => { counter++}
const debounced = R.debounce(increment, 1000)
async function fn(){ debounced() await R.delay(500) debounced() await R.delay(800) console.log(counter) // => 0 await R.delay(1200) console.log(counter) // => 1 return counter}const result = await fn()// `result` resolves to `1````
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function debounce<T, U>(fn: (input: T) => U, ms: number, immediate?: boolean): (input: T) => void;export function debounce<T, Q, U>(fn: (input1: T, input2: Q) => U, ms: number, immediate?: boolean): (input1: T, input2: Q) => void;export function debounce<T, Q, Z, U>(fn: (input1: T, input2: Q, input3: Z) => U, ms: number, immediate?: boolean): (input1: T, input2: Q, input3: Z) => void;
/*Method: delay
Explanation: `setTimeout` as a promise that resolves to `R.DELAY` variable after `ms` milliseconds.
Example:
```const result = R.delay(1000)// `result` resolves to `RAMBDAX_DELAY````
Categories: Async
Notes:
*/// @SINGLE_MARKERexport function delay(ms: number): Promise<'RAMBDAX_DELAY'>;
/*Method: filterAsync
Explanation: Asynchronous version of `R.filter`
Example:
```const predicate = async x => { await R.delay(100) return x % 2 === 1}const result = await R.filterAsync(predicate, [ 1, 2, 3 ])// => [ 1, 3 ]```
Categories: List, Object, Async
Notes:
*/// @SINGLE_MARKERexport function filterAsync<T>(fn: AsyncPredicate<T>, list: T[]): Promise<T[]>;export function filterAsync<T>(fn: AsyncPredicateIndexed<T>, list: T[]): Promise<T[]>;export function filterAsync<T>(fn: AsyncPredicate<T>) : ( list: T[]) => Promise<T[]>;export function filterAsync<T>(fn: AsyncPredicateIndexed<T>) : ( list: T[]) => Promise<T[]>;
/*Method: glue
Explanation: It transforms multiline string to single line by gluing together the separate lines with the `glueString` and removing the empty spaces. By default `glueString` is equal to single space, so if that is what you need, then you can just pass a single argument.
Example:
```const result = R.glue(` foo bar baz`)// => 'foo bar baz'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function glue(input: string, glueString?: string): string;
/*Method: getter
Explanation: The set of methods `R.setter`, `R.getter` and `R.reset` allow different parts of your logic to access communicate indirectly via shared cache object.
Usually these methods show that you might need to refactor to classes. Still, they can be helpful meanwhile.
`R.getter`: It provides access to the cache object. If `undefined` is used as a key, this method will return the whole cache object. If `string` is passed, then it will return cache value for this key. If array of `string` is passed, then it assume that this is array of keys and it will return the corresponding cache values for these keys.
`R.setter`: It allows cache object's keys to be changed. You can either set individual key-value pairs with `R.setter(key, value)` or you pass directly object, which will be merged with the cache object.
`R.reset`: It resets the cache object.
Example:
```R.setter('foo','bar')R.setter('a', 1)R.getter(['foo','a']) // => {foo: 'bar', a: 1}
R.setter('a', 2)R.getter('a') // => 2R.reset()R.getter('a') // => undefined```
Categories:
Notes:
*/// @SINGLE_MARKERexport function getter<T>(keyOrKeys: string | string[] | undefined): T;
/*Method: setter
Explanation:
Example:
```
```
Categories:
Notes: `R.getter` method contains explanations, tests and source information of `R.reset`, `R.setter` and `R.getter` methods.
*/// @SINGLE_MARKERexport function setter(keyOrObject: string | object, value?: any): void;
/*Method: reset
Explanation:
Example:
```
```
Categories:
Notes: `R.getter` method contains explanations, tests and source information of `R.reset`, `R.setter` and `R.getter` methods.
*/// @SINGLE_MARKERexport function reset(): void;
/*Method: interpolate
Explanation: It generates a new string from `inputWithTags` by replacing all `{{x}}` occurrences with values provided by `templateArguments`.
Example:
```const inputWithTags = 'foo is {{bar}} even {{a}} more'const templateArguments = {"bar":"BAR", a: 1}
const result = R.interpolate(inputWithTags, templateArguments)const expected = 'foo is BAR even 1 more'// => `result` is equal to `expected````
Categories: String
Notes:
*/// @SINGLE_MARKERexport function interpolate(inputWithTags: string, templateArguments: object): string;export function interpolate(inputWithTags: string): (templateArguments: object) => string;
/*Method: ifElseAsync
Explanation: Asynchronous version of `R.ifElse`. Any of `condition`, `ifFn` and `elseFn` can be either asynchronous or synchronous function.
Example:
```const condition = async x => { await R.delay(100) return x > 1}const ifFn = async x => { await R.delay(100) return x + 1}const elseFn = async x => { await R.delay(100) return x - 1}
const result = await R.ifElseAsync( condition, ifFn, elseFn )(1)// => 0```
Categories: Async, Logic
Notes:
*/// @SINGLE_MARKERexport function ifElseAsync<T, U>( condition: (x: T) => Promise<boolean>, onTrue: (x: T) => U, onFalse: (x: T) => U, ): (x: T) => Promise<U>;export function ifElseAsync<T, U>( condition: (x: T) => boolean, onTrue: (x: T) => Promise<U>, onFalse: (x: T) => Promise<U>, ): (x: T) => Promise<U>;export function ifElseAsync<T, U>( condition: (x: T) => Promise<boolean>, onTrue: (x: T) => Promise<U>, onFalse: (x: T) => Promise<U>, ): (x: T) => Promise<U>;export function ifElseAsync<T, K, U>( condition: (x: T, y: K) => Promise<boolean>, onTrue: (x: T, y: K) => U, onFalse: (x: T, y: K) => U, ): (x: T, y: K) => Promise<U>;export function ifElseAsync<T, K, U>( condition: (x: T, y: K) => boolean, onTrue: (x: T, y: K) => Promise<U>, onFalse: (x: T, y: K) => Promise<U>, ): (x: T, y: K) => Promise<U>;export function ifElseAsync<T, K, U>( condition: (x: T, y: K) => Promise<boolean>, onTrue: (x: T, y: K) => Promise<U>, onFalse: (x: T, y: K) => Promise<U>, ): (x: T, y: K) => Promise<U>;
/*Method:
Explanation: It returns true if `input` is either asynchronous function or unresolved promise.
Example:
```R.isPromise(R.delay(1000))// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isPromise(input: any): boolean;
/*Method: isType
Explanation: It returns true if `targetType` is equal to type of `input` according to `R.type`.
Example:
```R.isType('Async',R.delay(1000))// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function isType(targetType: RambdaTypes, input: any): boolean;export function isType(targetType: RambdaTypes): (input: any) => boolean;
/*Method: isValid
Explanation: It checks if `input` is following `schema` specifications.
If validation fails, it returns `false`.
Please [check the detailed explanation](https://github.com/selfrefactor/rambdax/blob/master/files/isValid.md) as it is hard to write a short description for this method.
Example:
```const input = {a: ['foo', 'bar']}const invalidInput = {a: ['foo', 'bar', 1]}const schema = {a: [String]}const result = [ R.isValid({schema, input}), R.isValid({schema, input: invalidInput})]// => [true, false]```
Categories: Logic
Notes: Independently, somebody else came with very similar idea called [superstruct](https://github.com/ianstormtaylor/superstruct)
*/// @SINGLE_MARKERexport function isValid({input: object, schema: Schema}: IsValid): boolean;
/*Method: isValidAsync
Explanation: Asynchronous version of `R.isValid`
Example:
```const input = {a: 1, b: 2}const invalidInput = {a: 1, b: 'foo'}const schema = {a: Number, b: async x => { await R.delay(100) return typeof x === 'number'}}
const result = await Promise.all([ R.isValidAsync({schema, input}), R.isValidAsync({schema, input: invalidInput})])// => [true, false]```
Categories: Logic, Async
Notes:
*/// @SINGLE_MARKERexport function isValidAsync(x: IsValidAsync): Promise<boolean>;
/*Method: mapAsync
Explanation: Sequential asynchronous mapping with `fn` over members of `list`.
Example:
```async function fn(x){ await R.delay(1000) return x+1}
const result = await R.mapAsync(fn, [1, 2, 3])// `result` resolves after 3 seconds to `[2, 3, 4]````
Categories: Async, List
Notes:
*/// @SINGLE_MARKERexport function mapAsync<T, K>(fn: AsyncIterable<T, K>, list: T[]): Promise<K[]>;export function mapAsync<T, K>(fn: AsyncIterableIndexed<T, K>, list: T[]): Promise<K[]>;export function mapAsync<T, K>(fn: AsyncIterable<T, K>) : ( list: T[]) => Promise<K[]>;export function mapAsync<T, K>(fn: AsyncIterableIndexed<T, K>) : ( list: T[]) => Promise<K[]>;
/*Method: mapParallelAsync
Explanation: Parallel asynchronous mapping with `fn` over members of `list`.
Example:
```async function fn(x){ await R.delay(1000) return x+1}
const result = await R.mapParallelAsync(fn, [1, 2, 3])// `result` resolves after 1 second to `[2, 3, 4]````
Categories: Async, List
Notes:
*/// @SINGLE_MARKERexport function mapParallelAsync<T, K>(fn: AsyncIterable<T, K>, list: T[]): Promise<K[]>;export function mapParallelAsync<T, K>(fn: AsyncIterableIndexed<T, K>, list: T[]): Promise<K[]>;export function mapParallelAsync<T, K>(fn: AsyncIterable<T, K>) : ( list: T[]) => Promise<K[]>;export function mapParallelAsync<T, K>(fn: AsyncIterableIndexed<T, K>) : ( list: T[]) => Promise<K[]>;
/*Method: mapParallelAsyncWithLimit
Explanation: It is similar to `R.mapParallelAsync` in that it uses `Promise.all`, but not over the whole list, rather than with only slice from `list` with length `limit`.
Example:
```
```
Categories: Async, List
Notes: For example usage, please check `R.mapAsyncLimit` tests.
*/// @SINGLE_MARKERexport function mapParallelAsyncWithLimit<T, K>(fn: AsyncIterable<T, K>, limit: number, list: T[]): Promise<K[]>;export function mapParallelAsyncWithLimit<T, K>(fn: AsyncIterable<T, K>, limit: number): (list: T[]) => Promise<K[]>;export function mapParallelAsyncWithLimit<T, K>(fn: AsyncIterableIndexed<T, K>, limit: number, list: T[]): Promise<K[]>;export function mapParallelAsyncWithLimit<T, K>(fn: AsyncIterableIndexed<T, K>, limit: number): (list: T[]) => Promise<K[]>;
/*Method: mapToObject
Explanation: This method allows to generate an object from a list using input function `fn`.
This function must return either an object or `false` for every member of `list` input.
If `false` is returned, then this element of `list` will be skipped in the calculation of the result.
All of returned objects will be merged to generate the final result.
Example:
```const list = [1, 2, 3, 12]const fn = x => { if(x > 10) return false return x % 2 ? {[x]: x + 1}: {[x]: x + 10}}
const result = mapToObject(fn, list)const expected = {'1': 2, '2': 12, '3': 4}// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function mapToObject<T, U extends object>(fn: (input: T) => U|false, list: readonly T[]): U;export function mapToObject<T, U extends object>(fn: (input: T) => U|false): (list: readonly T[]) => U;export function mapToObject<T, U>(fn: (input: T) => object|false, list: T[]): U;export function mapToObject<T, U>(fn: (input: T) => object|false): (list: T[]) => U;
/*Method: mapToObjectAsync
Explanation: Asynchronous version of `R.mapToObject`
Example:
```
```
Categories: List, Async
Notes:
*/// @SINGLE_MARKERexport function mapToObjectAsync<T, U extends object>(fn: (input: T) => Promise<U|false>, list: readonly T[]): Promise<U>;export function mapToObjectAsync<T, U extends object>(fn: (input: T) => Promise<U|false>): (list: readonly T[]) => Promise<U>;export function mapToObjectAsync<T, U>(fn: (input: T) => object|false, list: T[]): U;export function mapToObjectAsync<T, U>(fn: (input: T) => object|false): (list: T[]) => U;/*Method: mapKeys
Explanation: It takes an object and returns a new object with changed keys according to `changeKeyFn` function.
Example:
```const obj = {a: 1, b: 2}const changeKeyFn = prop => `{prop}_foo`const result = R.mapKeys(changeKeyFn, Record<string, unknown>)// => {a_foo: 1, b_foo: 2}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mapKeys<T, U>(changeKeyFn: (x: string) => string, obj: { [key: string]: T}): U;export function mapKeys<T, U>(changeKeyFn: (x: string) => string): (obj: { [key: string]: T}) => U;
/*Method: maybe
Explanation: It acts as ternary operator and it is helpful when we have nested ternaries.
All of the inputs can be either direct values or anonymous functions. This is helpful if we don't want to evaluate certain paths as we can wrap this logic in a function.
Example:
```const x = 4const y = 8
const ifRule = x > 2const whenIf = y > 10 ? 3 : 7const whenElse = () => { // just to show that it won't be evaluated return JSON.parse('{a:')}
const result = R.maybe( ifRule, whenIf, whenElse,)// `result` is `7````
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function maybe<T>(ifRule: boolean, whenIf: T | Func<T>, whenElse: T | Func<T>): T;export function maybe<T>(ifRule: VoidInputFunc<boolean>, whenIf: T | Func<T>, whenElse: T | Func<T>): T;
/*Method: memoize
Explanation: When `fn` is called for a second time with the same input, then the cache result is returned instead of calling again `fn`.
Example:
```let result = 0const fn = (a,b) =>{ result++ return a + b}const memoized = R.memoize(fn)memoized(1, 2)memoized(1, 2)
// => `result` is equal to `1````
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function memoize<T, K extends any[]>(fn: (...inputs: K) => T): (...inputs: K) => T;
/*Method: memoizeWith
Explanation: Creates a new function that, when invoked, caches the result of calling fn for a given argument set and returns the result.
Example:
```const keyGen = (a,b) => a + blet result = 0const fn = (a,b) =>{ result++ return a + b}const memoized = R.memoizeWith(keyGen, fn)memoized(1, 2)memoized(1, 2)
// => `result` is equal to `1````
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function memoizeWith<T, K extends any[]>(keyGen: any, fn: (...inputs: K) => T): (...inputs: K) => T;
/*Method: nextIndex
Explanation: It returns the next index of the list.
If we have reached the end of the list, then it will return `0`.
Example:
```const list = [1, 2, 3]
const result = [ R.nextIndex(0, list), R.nextIndex(1, list), R.nextIndex(2, list), R.nextIndex(10, list)]// => [1, 2, 0, 0]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function nextIndex(index: number, list: any[]): number;
/*Method: prevIndex
Explanation: It returns the next index of the list when the order is descending.
If we have reached the beginning of the list, then it will return the last index of the list.
Example:
```const list = [1, 2, 3]
const result = [ R.prevIndex(0, list), R.prevIndex(1, list), R.prevIndex(2, list),]// => [2, 0, 1]```
Categories: List
Notes: Unlike `R.nextIndex`, which safeguards against index out of bounds, this method does not.
*/// @SINGLE_MARKERexport function prevIndex(index: number, list: any[]): number;
/*Method: ok
Explanation: It checks if `inputs` are following `schemas` specifications according to `R.isValid`.
If validation fails, it throws.
Example:
```const result = R.ok( 1, ['foo', 'bar'])( Number, [String])// => undefined```
Categories:
Notes: It is same as `R.pass` but instead of returning `false`, it throws an error.
*/// @SINGLE_MARKERexport function ok(...inputs: any[]): (...schemas: any[]) => void | never;
/*Method: pass
Explanation: It checks if `inputs` are following `schemas` specifications according to `R.isValid`.
Example:
```const result = R.pass( 1, ['foo','bar'])( Number, [String])// => true```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function pass(...inputs: any[]): (...rules: any[]) => boolean;
/*Method: piped
Explanation: It is basically `R.pipe`, but instead of passing `input` argument as `R.pipe(...)(input)`, you pass it as the first argument.
Example:
```const result = R.piped( [1, 2, 3], R.filter(x => x > 1), R.map(x => x*10),)// => [20, 30]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function piped<A, B>(input: A, fn0: (x: A) => B) : B;export function piped<A, B, C>(input: A, fn0: (x: A) => B, fn1: (x: B) => C) : C;export function piped<A, B, C, D>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D) : D;export function piped<A, B, C, D, E>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E) : E;export function piped<A, B, C, D, E, F>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E, fn4: (x: E) => F) : F;export function piped<A, B, C, D, E, F, G>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E, fn4: (x: E) => F, fn5: (x: F) => G) : G;export function piped<A, B, C, D, E, F, G, H>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E, fn4: (x: E) => F, fn5: (x: F) => G, fn6: (x: G) => H) : H;export function piped<A, B, C, D, E, F, G, H, I>(input: A, fn0: (x: A) => B, fn1: (x: B) => C, fn2: (x: C) => D, fn3: (x: D) => E, fn4: (x: E) => F, fn5: (x: F) => G, fn6: (x: G) => H, fn7: (x: H) => I) : I;
/*Method: pipedAsync
Explanation: It accepts input as first argument and series of functions as next arguments. It is same as `R.piped` but with support for asynchronous functions like `R.pipeAsync`.
Example:
```const result = await R.pipedAsync( 100, async x => { await R.delay(100) return x + 2 }, R.add(2), async x => { const delayed = await R.delay(100) return delayed + x })// `result` resolves to `RAMBDAX_DELAY104````
Categories: Async
*/// @SINGLE_MARKERexport function pipedAsync<A, B>(input: A, fn0: (x: Awaited<A>) => B) : B;export function pipedAsync<A, B, C>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C) : C;export function pipedAsync<A, B, C, D>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D) : D;export function pipedAsync<A, B, C, D, E>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E) : E;export function pipedAsync<A, B, C, D, E, F>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F) : F;export function pipedAsync<A, B, C, D, E, F, G>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G) : G;export function pipedAsync<A, B, C, D, E, F, G, H>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G, fn6: (x: Awaited<G>) => H) : H;export function pipedAsync<A, B, C, D, E, F, G, H, I>(input: A, fn0: (x: Awaited<A>) => B, fn1: (x: Awaited<B>) => C, fn2: (x: Awaited<C>) => D, fn3: (x: Awaited<D>) => E, fn4: (x: Awaited<E>) => F, fn5: (x: Awaited<F>) => G, fn6: (x: Awaited<G>) => H, fn7: (x: Awaited<H>) => I) : I;
/*Method: produce
Explanation: It returns an object created by applying each value of `rules` to `input` argument.
Example:
```const rules = { foo: R.pipe(R.add(1), R.add(2)), a: {b: R.add(3)}}const result = R.produce(rules, 1)
const expected = { foo: 4, a: {b: 4}}// => `result` is equal to `expected````
Categories: Object
Notes: In Typescript context, `rules` functions can be only 1 level deep. In Javascript context, there is no such restriction.
*/// @SINGLE_MARKERexport function produce<Input extends any, Output>( rules: ProduceRules<Output, keyof Output, Input>, input: Input): Output;export function produce<Input extends any, Output>( rules: ProduceRules<Output, keyof Output, Input>): <Input>( input: Input) => Output;
/*Method: produceAsync
Explanation: It returns an object created by applying each value of `rules` to `input` argument.
`rules` input is an object with synchronous or asynchronous functions as values.
The return value is wrapped in a promise, even if all `rules` are synchronous functions.
Example:
```const rules = { foo: async x => { await R.delay(100) return x > 1 }, bar: x => ({baz: x})}const input = 2const result = await R.produceAsync(rules, input)
const expected = { foo: true, bar: {baz: 2}}// => `result` is equal to `expected````
Categories: Logic, Async
Notes:
*/// @SINGLE_MARKERexport function produceAsync<Input extends any, Output>( rules: ProduceAsyncRules<Output, keyof Output, Input>, input: Input): Promise<Output>;export function produceAsync<Input extends any, Output>( rules: ProduceAsyncRules<Output, keyof Output, Input>): <Input>( input: Input) => Promise<Output>;

/*Method: random
Explanation: It returns a random number between `min` inclusive and `max` inclusive.
Example:
```
```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function random(minInclusive: number, maxInclusive: number): number;
/*Method: remove
Explanation: It will remove all `toRemove` entries from `text` sequentially.
`toRemove` argument can be either a list of strings/regular expressions or a single string/regular expression.
Example:
```const result = R.remove( ['foo','bar'], 'foo bar baz foo')// => 'baz foo'```
Categories: String
Notes: This is the only case where Rambdax exports clashes with Ramda API, as Ramda has `remove` method. If `Rambda.remove` is introduced, then this method will be renamed.
*/// @SINGLE_MARKERexport function remove( toRemove: string | RegExp | (string | RegExp)[], text: string): string;export function remove( toRemove: string | RegExp | (string | RegExp)[]): (text: string) => string;
/*Method: renameProps
Explanation: If property `prop` of `rules` is also a property in `input`, then rename `input` property to `rules[prop]`.
Example:
```
```
Categories:
Notes:
*/// @SINGLE_MARKERexport function renameProps(rules: object, input: object): object;export function renameProps(rules: object): (input: object) => object;export function renameProps<Output>(rules: object, input: object): Output;export function renameProps<Output>(rules: object): (input: object) => Output;

/*Method: replaceAll Explanation: Same as `R.replace` but it accepts array of string and regular expressions instead of a single value.
Example:
```const replacer = '|'const patterns = [ /foo/g, 'bar' ]const input = 'foo bar baz foo bar'
const result = R.replaceAll(patterns, replacer, input)// => '| | baz | bar'```
Categories: String
Notes:
*/// @SINGLE_MARKERexport function replaceAll(patterns: (RegExp | string)[], replacer: string, input: string): string;export function replaceAll(patterns: (RegExp | string)[], replacer: string): (input: string) => string;export function replaceAll(patterns: (RegExp | string)[]): (replacer: string) => (input: string) => string;
/*Method: shuffle
Explanation: It returns a randomized copy of array.
Example:
```
```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function shuffle<T>(list: T[]): T[];
/*Method: sortObject
Explanation: It returns a sorted version of `input` object.
Example:
```const predicate = (propA, propB, valueA, valueB) => valueA > valueB ? -1 : 1
const result = R.sortObject(predicate, {a:1, b: 4, c: 2})// => {b: 4, c: 2, a: 1}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function sortObject<T>(predicate: SortObjectPredicate<T>, input: { [key: string]: T }): { [keyOutput: string]: T };export function sortObject<T>(predicate: SortObjectPredicate<T>): (input: { [key: string]: T }) => { [keyOutput: string]: T };
/*Method: switcher
Explanation: Edited fork of [Switchem](https://github.com/planttheidea/switchem) library.
The method return a value if the matched option is a value.
If the matched option is a function, then `R.switcher` returns a function which expects input. Tests of the method explain it better than this short description.
`R.equals` is used to determine equality.
Example:
```const valueToMatch = {foo: 1}
const result = R.switcher(valueToMatch) .is('baz', 'is baz') .is(x => typeof x === 'boolean', 'is boolean') .is({foo: 1}, 'Property foo is 1') .default('is bar')// => 'Property foo is 1'```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function switcher<T>(valueToMatch: any): Switchem<T>;
/*Method: tapAsync
Explanation: Asynchronous version of `R.tap`.
Example:
```
```
Categories: Async
Notes:
*/// @SINGLE_MARKERexport function tapAsync<T>(fn: Func<any> | Promise<any>, input: T): T;export function tapAsync<T>(fn: Func<any> | Promise<any>): (input: T) => T;
/*Method: throttle
Explanation:
Example:
```let counter = 0const inc = () => { counter++}
const throttledInc = R.throttle(inc, 800)
const result = async () => { throttledInc() await R.delay(500) throttledInc() return counter}// `result` resolves to `1````
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function throttle<T, U>(fn: (input: T) => U, ms: number): (input: T) => U;export function throttle<T, Q, U>(fn: (input1: T, input2: Q) => U, ms: number): (input1: T, input2: Q) => U;export function throttle<T, Q, Z, U>(fn: (input1: T, input2: Q, input3: Z) => U, ms: number): (input1: T, input2: Q, input3: Z) => U;
/*Method: toDecimal
Explanation:
Example:
```R.toDecimal(2.45464,2) // => 2.45```
Categories: Number
Notes:
*/// @SINGLE_MARKERexport function toDecimal(num: number, charsAfterDecimalPoint?: number): number;
/*Method: wait
Explanation: It provides `Golang`-like interface for handling promises.
Example:
```const [result, err] = await R.wait(R.delay(1000))// => err is undefined// => result is `RAMBDAX_DELAY````
Categories: Async
Notes:
*/// @SINGLE_MARKERexport function wait<T>(fn: Promise<T>): Promise<[T, Error|undefined]>;export function wait<T>(fn: (x: any) => Promise<T>): Promise<[T, Error|undefined]>;
/*Method: waitFor
Explanation: It returns `true`, if `condition` returns `true` within `howLong` milliseconds time period.
The method accepts an optional third argument `loops`(default to 10), which is the number of times `waitForTrueCondition` will be evaluated for `howLong` period. Once this function returns a value different from `false`, this value will be the final result.
Otherwise, `R.waitFor` will return `false`.
Example:
```const howLong = 1000let counter = 0const waitForTrueCondition = async x => { await R.delay(100) counter = counter + x return counter > 10}
const result = await R.waitFor(waitForTrueCondition, howLong)(2)// => true```
Categories: Async, Logic
Notes:
*/// @SINGLE_MARKERexport function waitFor( waitForTrueCondition: () => boolean, howLong: number, loops?: number): () => Promise<boolean>;export function waitFor( waitForTrueCondition: () => Promise<boolean>, howLong: number, loops?: number): () => Promise<boolean>;export function waitFor<T>( waitForTrueCondition: (input: T) => Promise<boolean>, howLong: number, loops?: number): (input: T) => Promise<boolean>;export function waitFor<T>( waitForTrueCondition: (input: T) => boolean, howLong: number, loops?: number): (input: T) => Promise<boolean>;
/*Method: lensEq
Explanation: It returns `true` if data structure focused by the given lens equals to the `target` value.
`R.equals` is used to determine equality.
Example:
```const list = [ 1, 2, 3 ]const lens = R.lensIndex(0)const result = R.lensEq( lens, 1, list)// => true```
Categories: Lenses
Notes: Idea for this method comes from `ramda-adjunct` library
*/// @SINGLE_MARKERexport function lensEq(lens: Function, value: any, data: any): boolean;export function lensEq(lens: Function, value: any): (data: any) => boolean;export function lensEq(lens: Function): (value: any) => (data: any) => boolean;
/*Method: lensSatisfies
Explanation: It returns `true` if data structure focused by the given lens satisfies the predicate.
Example:
```const fn = R.lensSatisfies(x => x > 5, R.lensIndex(0))const result = [ fn([10, 20, 30]), fn([1, 2, 3]),]// => [true, false]```
Categories: Lenses
Notes: Idea for this method comes from `ramda-adjunct` library
*/// @SINGLE_MARKERexport function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens, input: U): boolean;export function lensSatisfies<T, U>(predicate: (x: T) => boolean, lens: Lens): (input: U) => boolean;export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens, input: T[]): boolean;export function lensSatisfies<T>(predicate: (x: T) => boolean, lens: Lens): (input: T[]) => boolean;
/*Method: viewOr
Explanation: A combination between `R.defaultTo` and `R.view.
Example:
```const lens = R.lensProp('a');const input = {a: 'foo'}const fallbackInput = {b: 'bar'}const fallback = 'FALLBACK'
const result = [ R.viewOr(fallback, lens, input), R.viewOr(fallback, lens, fallbackInput)]// => ['foo', 'FALLBACK']```
Categories: Lenses
Notes: Idea for this method comes from `@meltwater/phi` library
*/// @SINGLE_MARKERexport function viewOr<Input, Output>(fallback: Output, lens: Lens, input: Input): Output;export function viewOr<Input, Output>(fallback: Output, lens: Lens): (input: Input) => Output;export function viewOr<Input, Output>(fallback: Output): (lens: Lens) => (input: Input) => Output;
/*Method: sortByPath
Explanation: It returns copy of `list` sorted by `sortPath` value.
As `sortPath` is passed to `R.path`, it can be either a string or an array of strings.
Example:
```const list = [ {a: {b: 2}}, {a: {b: 1}}, {a: {b: 3}}]const result = R.sortByPath('a.b', list)const expected = [ {a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}]// => `result` is equal to `expected````
Categories: List
Notes: Idea for this method comes from `@meltwater/phi` library
*/// @SINGLE_MARKERexport function sortByPath<T>(sortPath: Path, list: T[]): T[];export function sortByPath(sortPath: Path): <T>(list: T[]) => T[];
/*Method: sortByProps
Explanation: It returns sorted copy of `list` of objects.
Sorting is done using a list of strings, each representing a path. Two members `a` and `b` from `list` can be sorted if both return a value for a given path. If the value is equal, then the next member of `sortPaths`(if there is such) will be used in order to find difference between `a` and `b`.
Example:
```const list = [ {a: {b: 2}}, {a: {b: 1}}, {a: {b: 3}}]const result = R.sortByProps(['a.b'], list)const expected = [ {a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}]// => `result` is equal to `expected````
Categories: List
Notes: Idea for this method comes from `@meltwater/phi` library
*/// @SINGLE_MARKERexport function sortByProps<T>(sortPaths: string[], list: T[]): T[];export function sortByProps(sortPaths: string[]): <T>(list: T[]) => T[];
/*Method: excludes
Explanation: Opposite of `R.includes`
`R.equals` is used to determine equality.
Example:
```const result = [ R.excludes('ar', 'foo'), R.excludes({a: 2}, [{a: 1}])]// => [true, true ]```
Categories: List, String
Notes:
*/// @SINGLE_MARKERexport function excludes(valueToFind: string, input: string[] | string): boolean;export function excludes(valueToFind: string): (input: string[] | string) => boolean;export function excludes<T>(valueToFind: T, input: T[]): boolean;export function excludes<T>(valueToFind: T): (input: T[]) => boolean;
/*Method: updateObject
Explanation: Very similar to `R.assocPath` but it applies list of updates instead of only a single update.
It returns a copy of `obj` input with changed properties according to `rules` input.
Each instance of `rules` is a tuple of object path and the new value for this path. If such object path does not exist, then such object path is created.
As it uses `R.path` underneath, object path can be either string or array of strings(in Typescript object path can be only a string).
Example:
```const obj = { a: {b: 1}, foo: {bar: 10},}const rules = [ ['a.b', 2], ['foo.bar', 20], ['q.z', 300],]const result = R.updateObject(rules, Record<string, unknown>)
const expected = { a: {b: 2}, foo: {bar: 20}, q: {z: 300},}// => `result` is equal to `expected````
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function updateObject<Output>(rules: ([string, any])[], input: object): Output;export function updateObject<Output>(rules: ([string, any])[]): (input: object) => Output;
/*Method: takeUntil
Explanation:
Example:
```const list = [1, 2, 3, 4, 5]const predicate = x => x > 3const result = R.takeUntil(predicate, list)
// => [1, 2, 3]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function takeUntil<T>(predicate: (x: T) => boolean, list: T[]): T[];export function takeUntil<T>(predicate: (x: T) => boolean): (list: T[]) => T[];
/*Method: applyDiff
Explanation: It changes paths in an object according to a list of operations. Valid operations are `add`, `update` and `delete`. Its use-case is while writing tests and you need to change the test data.
Note, that you cannot use `update` operation, if the object path is missing in the input object.Also, you cannot use `add` operation, if the object path has a value.
Example:
```const obj = {a: {b:1, c:2}}const rules = [ {op: 'remove', path: 'a.c'}, {op: 'add', path: 'a.d', value: 4}, {op: 'update', path: 'a.b', value: 2},]const result = R.applyDiff(rules, Record<string, unknown>)const expected = {a: {b: 2, d: 4}}
// => `result` is equal to `expected````
Categories: List
Notes:
*/// @SINGLE_MARKERexport function applyDiff<Output>(rules: ApplyDiffRule[], obj: object): Output;export function applyDiff<Output>(rules: ApplyDiffRule[]): ( obj: object) => Output;
/*Method: mapIndexed
Explanation: Same as `R.map`, but it passes index as second argument to the iterator, when looping over arrays.
Example:
``````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function mapIndexed<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;export function mapIndexed<T, U>(fn: IndexedIterator<T, U>, iterable: T[]): U[];export function mapIndexed<T, U>(fn: IndexedIterator<T, U>): (iterable: T[]) => U[];export function mapIndexed<T, U, S>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;export function mapIndexed<T>(fn: IndexedIterator<T, T>): (iterable: T[]) => T[];export function mapIndexed<T>(fn: IndexedIterator<T, T>, iterable: T[]): T[];
/*Method: mapArray
Explanation:
Example:
```const result = R.mapArray(x => x + 1, [1, 2])// => [2, 3]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function mapArray<T>(fn: Iterator<T, T>, iterable: T[]): T[];export function mapArray<T, U>(fn: Iterator<T, U>, iterable: T[]): U[];export function mapArray<T, U>(fn: Iterator<T, U>): (iterable: T[]) => U[];export function mapArray<T>(fn: Iterator<T, T>): (iterable: T[]) => T[];
/*Method: filterIndexed
Explanation: Same as `R.filter`, but it passes index/property as second argument to the predicate, when looping over arrays/objects.
Example:
``````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function filterIndexed<T>(predicate: IndexedPredicate<T>): (x: T[]) => T[];export function filterIndexed<T>(predicate: IndexedPredicate<T>, x: T[]): T[];export function filterIndexed<T, U>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;export function filterIndexed<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;
/*Method: rejectIndexed
Explanation: Same as `R.reject`, but it passes index/property as second argument to the predicate, when looping over arrays/objects.
Example:
```const list = [1, 2, 3, 4]const obj = {a: 1, b: 2}
const result = [ R.reject((x, index) => x > 1, list) R.reject((x, property) => x > 1, Record<string, unknown>)]// => [[1], {a: 1}]```
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function rejectIndexed<T>(predicate: IndexedPredicate<T>): (x: T[]) => T[];export function rejectIndexed<T>(predicate: IndexedPredicate<T>, x: T[]): T[];export function rejectIndexed<T, U>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;export function rejectIndexed<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;

/*Method: partitionIndexed
Explanation:
Example:
``````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function partitionIndexed<T>( predicate: IndexedPredicate<T>, input: T[]): [T[], T[]];export function partitionIndexed<T>( predicate: IndexedPredicate<T>): (input: T[]) => [T[], T[]];export function partitionIndexed<T>( predicate: (x: T, prop?: string) => boolean, input: { [key: string]: T}): [{ [key: string]: T}, { [key: string]: T}];export function partitionIndexed<T>( predicate: (x: T, prop?: string) => boolean): (input: { [key: string]: T}) => [{ [key: string]: T}, { [key: string]: T}];
/*Method: filterObject
Explanation:
Example:
```const obj = {a: 1, b:2}const result = R.filterObject( x => x > 1, obj)// => {b: 2}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function filterObject<T>(predicate: ObjectPredicate<T>): (x: Dictionary<T>) => Dictionary<T>;export function filterObject<T>(predicate: ObjectPredicate<T>, x: Dictionary<T>): Dictionary<T>;
/*Method: filterArray
Explanation:
Example:
```const result = R.filterArray( x => x > 1, [1, 2, 3])// => [1, 3]```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function filterArray<T>(predicate: Predicate<T>): (input: T[]) => T[];export function filterArray<T>(predicate: Predicate<T>, input: T[]): T[];
/*Method: forEachIndexed
Explanation:
Example:
``````
Categories: List, Object
Notes:
*/// @SINGLE_MARKERexport function forEachIndexed<T>(fn: IndexedIterator<T, void>, list: T[]): T[];export function forEachIndexed<T>(fn: IndexedIterator<T, void>): (list: T[]) => T[];export function forEachIndexed<T>(fn: ObjectIterator<T, void>, list: Dictionary<T>): Dictionary<T>;export function forEachIndexed<T, U>(fn: ObjectIterator<T, void>): (list: Dictionary<T>) => Dictionary<T>;
/*Method: mapObject
Explanation:
Example:
```const result = R.mapObject(x => x + 1, {a:1, b:2})// => {a:2, b:3}```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function mapObject<T>(fn: ObjectIterator<T, T>, iterable: Dictionary<T>): Dictionary<T>;export function mapObject<T, U>(fn: ObjectIterator<T, U>, iterable: Dictionary<T>): Dictionary<U>;export function mapObject<T>(fn: ObjectIterator<T, T>): (iterable: Dictionary<T>) => Dictionary<T>;export function mapObject<T, U>(fn: ObjectIterator<T, U>): (iterable: Dictionary<T>) => Dictionary<U>;
/*Method: tryCatchAsync
Explanation: It returns function that runs `fn` in `try/catch` block. If there was an error, then `fallback` is used to return the result.
Example:
```const x = {foo: 1}const fnFoo = async () => x.fooconst fnBar = async () => x.bar
const result = await Promise.all([ R.tryCatchAsync (fnFoo, false)(), R.tryCatchAsync(fnBar, false)()])// => [1, false]```
Categories: Async, Logic
Notes:
*/// @SINGLE_MARKERexport function tryCatchAsync<T>( fn: (input: any) => Promise<T>, fallback: T): (input: any) => Promise<T>;export function tryCatchAsync<T>( fn: (input: any) => Promise<T>, fallback: (input: any) => Promise<T>,): (input: any) => Promise<T>;
export const DELAY: 'RAMBDAX_DELAY';
/*Method: findAsync
Explanation: Asynchronous version of `R.find`.
Example:
```const predicate = x => { await R.delay(100) return R.type(x.foo) === 'Number'}
const list = [{foo: 'bar'}, {foo: 1}]
const result = await R.findAsync(predicate, list)// => {foo: 1}```
Categories: List
Notes:
*/// @SINGLE_MARKERexport function findAsync<T>(predicate: (x: T) => Promise<boolean>, list: T[]): T | undefined;export function findAsync<T>(predicate: (x: T) => Promise<boolean>): (list: T[]) => T | undefined;
/*Method: xnor
Explanation: Logical XNOR
Example:
```const result = [ R.xnor(1, 0), R.xnor(0, 1), R.xnor(0, 0), R.xnor(1, 1),]// => [true, false, false, true]```
Categories: Logic
Notes:
*/// @SINGLE_MARKERexport function xnor(x: boolean, y: boolean): boolean;export function xnor(y: boolean): (y: boolean) => boolean;
/*Method: mapcat
Explanation:
Example:
```const result = R.mapcat()// => ```
Categories:
Notes:
*/// @SINGLE_MARKERexport function mapcat<T>(x: T): T;
/*Method: contains
Explanation: It returns `true` if all of `target` object properties are `R.equal` to `compareTo` object.
Example:
```const result = R.contains({a:1}, {a:1, b:2})// => true```
Categories: Object
Notes:
*/// @SINGLE_MARKERexport function contains<T, U>(target: T, compareTo: U): boolean;export function contains<T, U>(target: T): (compareTo: U) => boolean;
/*Method: partialCurry
Explanation: Same as `R.partialObject`.
When `Ramda` introduced `R.partialObject`, `Rambdax` already had such method, i.e. `R.partialCurry`. So this method is kept for backward compatibility.
Example:
``````
Categories: Logic, Async
Notes: Function input can be asynchronous
*/// @SINGLE_MARKERexport function partialCurry<Input, PartialInput, Output>( fn: (input: Input) => Output, partialInput: PartialInput,): (input: Pick<Input, Exclude<keyof Input, keyof PartialInput>>) => Output;
/*Method: noop
Explanation:
Example:
``````
Categories:
Notes:
*/// @SINGLE_MARKERexport function noop(): void;
// RAMBDAX_MARKER_END// ============================================
export as namespace R