Best JavaScript code snippet using sinon
symbols.js
Source:symbols.js
...39 "math": {},40 "text": {},41};42/** `acceptUnicodeChar = true` is only applicable if `replace` is set. */43function defineSymbol(44 mode,45 font,46 group,47 replace,48 name,49 acceptUnicodeChar,50) {51 symbols[mode][name] = {font, group, replace};52 if (acceptUnicodeChar && replace) {53 symbols[mode][replace] = symbols[mode][name];54 }55}56// Some abbreviations for commonly used strings.57// This helps minify the code, and also spotting typos using jshint.58// modes:59const math = "math";60const text = "text";61// fonts:62const main = "main";63const ams = "ams";64// groups:65const accent = "accent-token";66const bin = "bin";67const close = "close";68const inner = "inner";69const mathord = "mathord";70const op = "op-token";71const open = "open";72const punct = "punct";73const rel = "rel";74const spacing = "spacing";75const textord = "textord";76// Now comes the symbol table77// Relation Symbols78defineSymbol(math, main, rel, "\u2261", "\\equiv", true);79defineSymbol(math, main, rel, "\u227a", "\\prec", true);80defineSymbol(math, main, rel, "\u227b", "\\succ", true);81defineSymbol(math, main, rel, "\u223c", "\\sim", true);82defineSymbol(math, main, rel, "\u22a5", "\\perp");83defineSymbol(math, main, rel, "\u2aaf", "\\preceq", true);84defineSymbol(math, main, rel, "\u2ab0", "\\succeq", true);85defineSymbol(math, main, rel, "\u2243", "\\simeq", true);86defineSymbol(math, main, rel, "\u2223", "\\mid", true);87defineSymbol(math, main, rel, "\u226a", "\\ll", true);88defineSymbol(math, main, rel, "\u226b", "\\gg", true);89defineSymbol(math, main, rel, "\u224d", "\\asymp", true);90defineSymbol(math, main, rel, "\u2225", "\\parallel");91defineSymbol(math, main, rel, "\u22c8", "\\bowtie", true);92defineSymbol(math, main, rel, "\u2323", "\\smile", true);93defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq", true);94defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq", true);95defineSymbol(math, main, rel, "\u2250", "\\doteq", true);96defineSymbol(math, main, rel, "\u2322", "\\frown", true);97defineSymbol(math, main, rel, "\u220b", "\\ni", true);98defineSymbol(math, main, rel, "\u221d", "\\propto", true);99defineSymbol(math, main, rel, "\u22a2", "\\vdash", true);100defineSymbol(math, main, rel, "\u22a3", "\\dashv", true);101defineSymbol(math, main, rel, "\u220b", "\\owns");102// Punctuation103defineSymbol(math, main, punct, "\u002e", "\\ldotp");104defineSymbol(math, main, punct, "\u22c5", "\\cdotp");105// Misc Symbols106defineSymbol(math, main, textord, "\u0023", "\\#");107defineSymbol(text, main, textord, "\u0023", "\\#");108defineSymbol(math, main, textord, "\u0026", "\\&");109defineSymbol(text, main, textord, "\u0026", "\\&");110defineSymbol(math, main, textord, "\u2135", "\\aleph", true);111defineSymbol(math, main, textord, "\u2200", "\\forall", true);112defineSymbol(math, main, textord, "\u210f", "\\hbar", true);113defineSymbol(math, main, textord, "\u2203", "\\exists", true);114defineSymbol(math, main, textord, "\u2207", "\\nabla", true);115defineSymbol(math, main, textord, "\u266d", "\\flat", true);116defineSymbol(math, main, textord, "\u2113", "\\ell", true);117defineSymbol(math, main, textord, "\u266e", "\\natural", true);118defineSymbol(math, main, textord, "\u2663", "\\clubsuit", true);119defineSymbol(math, main, textord, "\u2118", "\\wp", true);120defineSymbol(math, main, textord, "\u266f", "\\sharp", true);121defineSymbol(math, main, textord, "\u2662", "\\diamondsuit", true);122defineSymbol(math, main, textord, "\u211c", "\\Re", true);123defineSymbol(math, main, textord, "\u2661", "\\heartsuit", true);124defineSymbol(math, main, textord, "\u2111", "\\Im", true);125defineSymbol(math, main, textord, "\u2660", "\\spadesuit", true);126defineSymbol(text, main, textord, "\u00a7", "\\S", true);127defineSymbol(text, main, textord, "\u00b6", "\\P", true);128// Math and Text129defineSymbol(math, main, textord, "\u2020", "\\dag");130defineSymbol(text, main, textord, "\u2020", "\\dag");131defineSymbol(text, main, textord, "\u2020", "\\textdagger");132defineSymbol(math, main, textord, "\u2021", "\\ddag");133defineSymbol(text, main, textord, "\u2021", "\\ddag");134defineSymbol(text, main, textord, "\u2021", "\\textdaggerdbl");135// Large Delimiters136defineSymbol(math, main, close, "\u23b1", "\\rmoustache", true);137defineSymbol(math, main, open, "\u23b0", "\\lmoustache", true);138defineSymbol(math, main, close, "\u27ef", "\\rgroup", true);139defineSymbol(math, main, open, "\u27ee", "\\lgroup", true);140// Binary Operators141defineSymbol(math, main, bin, "\u2213", "\\mp", true);142defineSymbol(math, main, bin, "\u2296", "\\ominus", true);143defineSymbol(math, main, bin, "\u228e", "\\uplus", true);144defineSymbol(math, main, bin, "\u2293", "\\sqcap", true);145defineSymbol(math, main, bin, "\u2217", "\\ast");146defineSymbol(math, main, bin, "\u2294", "\\sqcup", true);147defineSymbol(math, main, bin, "\u25ef", "\\bigcirc");148defineSymbol(math, main, bin, "\u2219", "\\bullet");149defineSymbol(math, main, bin, "\u2021", "\\ddagger");150defineSymbol(math, main, bin, "\u2240", "\\wr", true);151defineSymbol(math, main, bin, "\u2a3f", "\\amalg");152defineSymbol(math, main, bin, "\u0026", "\\And"); // from amsmath153// Arrow Symbols154defineSymbol(math, main, rel, "\u27f5", "\\longleftarrow", true);155defineSymbol(math, main, rel, "\u21d0", "\\Leftarrow", true);156defineSymbol(math, main, rel, "\u27f8", "\\Longleftarrow", true);157defineSymbol(math, main, rel, "\u27f6", "\\longrightarrow", true);158defineSymbol(math, main, rel, "\u21d2", "\\Rightarrow", true);159defineSymbol(math, main, rel, "\u27f9", "\\Longrightarrow", true);160defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow", true);161defineSymbol(math, main, rel, "\u27f7", "\\longleftrightarrow", true);162defineSymbol(math, main, rel, "\u21d4", "\\Leftrightarrow", true);163defineSymbol(math, main, rel, "\u27fa", "\\Longleftrightarrow", true);164defineSymbol(math, main, rel, "\u21a6", "\\mapsto", true);165defineSymbol(math, main, rel, "\u27fc", "\\longmapsto", true);166defineSymbol(math, main, rel, "\u2197", "\\nearrow", true);167defineSymbol(math, main, rel, "\u21a9", "\\hookleftarrow", true);168defineSymbol(math, main, rel, "\u21aa", "\\hookrightarrow", true);169defineSymbol(math, main, rel, "\u2198", "\\searrow", true);170defineSymbol(math, main, rel, "\u21bc", "\\leftharpoonup", true);171defineSymbol(math, main, rel, "\u21c0", "\\rightharpoonup", true);172defineSymbol(math, main, rel, "\u2199", "\\swarrow", true);173defineSymbol(math, main, rel, "\u21bd", "\\leftharpoondown", true);174defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown", true);175defineSymbol(math, main, rel, "\u2196", "\\nwarrow", true);176defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons", true);177// AMS Negated Binary Relations178defineSymbol(math, ams, rel, "\u226e", "\\nless", true);179// Symbol names preceeded by "@" each have a corresponding macro.180defineSymbol(math, ams, rel, "\ue010", "\\@nleqslant");181defineSymbol(math, ams, rel, "\ue011", "\\@nleqq");182defineSymbol(math, ams, rel, "\u2a87", "\\lneq", true);183defineSymbol(math, ams, rel, "\u2268", "\\lneqq", true);184defineSymbol(math, ams, rel, "\ue00c", "\\@lvertneqq");185defineSymbol(math, ams, rel, "\u22e6", "\\lnsim", true);186defineSymbol(math, ams, rel, "\u2a89", "\\lnapprox", true);187defineSymbol(math, ams, rel, "\u2280", "\\nprec", true);188// unicode-math maps \u22e0 to \npreccurlyeq. We'll use the AMS synonym.189defineSymbol(math, ams, rel, "\u22e0", "\\npreceq", true);190defineSymbol(math, ams, rel, "\u22e8", "\\precnsim", true);191defineSymbol(math, ams, rel, "\u2ab9", "\\precnapprox", true);192defineSymbol(math, ams, rel, "\u2241", "\\nsim", true);193defineSymbol(math, ams, rel, "\ue006", "\\@nshortmid");194defineSymbol(math, ams, rel, "\u2224", "\\nmid", true);195defineSymbol(math, ams, rel, "\u22ac", "\\nvdash", true);196defineSymbol(math, ams, rel, "\u22ad", "\\nvDash", true);197defineSymbol(math, ams, rel, "\u22ea", "\\ntriangleleft");198defineSymbol(math, ams, rel, "\u22ec", "\\ntrianglelefteq", true);199defineSymbol(math, ams, rel, "\u228a", "\\subsetneq", true);200defineSymbol(math, ams, rel, "\ue01a", "\\@varsubsetneq");201defineSymbol(math, ams, rel, "\u2acb", "\\subsetneqq", true);202defineSymbol(math, ams, rel, "\ue017", "\\@varsubsetneqq");203defineSymbol(math, ams, rel, "\u226f", "\\ngtr", true);204defineSymbol(math, ams, rel, "\ue00f", "\\@ngeqslant");205defineSymbol(math, ams, rel, "\ue00e", "\\@ngeqq");206defineSymbol(math, ams, rel, "\u2a88", "\\gneq", true);207defineSymbol(math, ams, rel, "\u2269", "\\gneqq", true);208defineSymbol(math, ams, rel, "\ue00d", "\\@gvertneqq");209defineSymbol(math, ams, rel, "\u22e7", "\\gnsim", true);210defineSymbol(math, ams, rel, "\u2a8a", "\\gnapprox", true);211defineSymbol(math, ams, rel, "\u2281", "\\nsucc", true);212// unicode-math maps \u22e1 to \nsucccurlyeq. We'll use the AMS synonym.213defineSymbol(math, ams, rel, "\u22e1", "\\nsucceq", true);214defineSymbol(math, ams, rel, "\u22e9", "\\succnsim", true);215defineSymbol(math, ams, rel, "\u2aba", "\\succnapprox", true);216// unicode-math maps \u2246 to \simneqq. We'll use the AMS synonym.217defineSymbol(math, ams, rel, "\u2246", "\\ncong", true);218defineSymbol(math, ams, rel, "\ue007", "\\@nshortparallel");219defineSymbol(math, ams, rel, "\u2226", "\\nparallel", true);220defineSymbol(math, ams, rel, "\u22af", "\\nVDash", true);221defineSymbol(math, ams, rel, "\u22eb", "\\ntriangleright");222defineSymbol(math, ams, rel, "\u22ed", "\\ntrianglerighteq", true);223defineSymbol(math, ams, rel, "\ue018", "\\@nsupseteqq");224defineSymbol(math, ams, rel, "\u228b", "\\supsetneq", true);225defineSymbol(math, ams, rel, "\ue01b", "\\@varsupsetneq");226defineSymbol(math, ams, rel, "\u2acc", "\\supsetneqq", true);227defineSymbol(math, ams, rel, "\ue019", "\\@varsupsetneqq");228defineSymbol(math, ams, rel, "\u22ae", "\\nVdash", true);229defineSymbol(math, ams, rel, "\u2ab5", "\\precneqq", true);230defineSymbol(math, ams, rel, "\u2ab6", "\\succneqq", true);231defineSymbol(math, ams, rel, "\ue016", "\\@nsubseteqq");232defineSymbol(math, ams, bin, "\u22b4", "\\unlhd");233defineSymbol(math, ams, bin, "\u22b5", "\\unrhd");234// AMS Negated Arrows235defineSymbol(math, ams, rel, "\u219a", "\\nleftarrow", true);236defineSymbol(math, ams, rel, "\u219b", "\\nrightarrow", true);237defineSymbol(math, ams, rel, "\u21cd", "\\nLeftarrow", true);238defineSymbol(math, ams, rel, "\u21cf", "\\nRightarrow", true);239defineSymbol(math, ams, rel, "\u21ae", "\\nleftrightarrow", true);240defineSymbol(math, ams, rel, "\u21ce", "\\nLeftrightarrow", true);241// AMS Misc242defineSymbol(math, ams, rel, "\u25b3", "\\vartriangle");243defineSymbol(math, ams, textord, "\u210f", "\\hslash");244defineSymbol(math, ams, textord, "\u25bd", "\\triangledown");245defineSymbol(math, ams, textord, "\u25ca", "\\lozenge");246defineSymbol(math, ams, textord, "\u24c8", "\\circledS");247defineSymbol(math, ams, textord, "\u00ae", "\\circledR");248defineSymbol(text, ams, textord, "\u00ae", "\\circledR");249defineSymbol(math, ams, textord, "\u2221", "\\measuredangle", true);250defineSymbol(math, ams, textord, "\u2204", "\\nexists");251defineSymbol(math, ams, textord, "\u2127", "\\mho");252defineSymbol(math, ams, textord, "\u2132", "\\Finv", true);253defineSymbol(math, ams, textord, "\u2141", "\\Game", true);254defineSymbol(math, ams, textord, "\u2035", "\\backprime");255defineSymbol(math, ams, textord, "\u25b2", "\\blacktriangle");256defineSymbol(math, ams, textord, "\u25bc", "\\blacktriangledown");257defineSymbol(math, ams, textord, "\u25a0", "\\blacksquare");258defineSymbol(math, ams, textord, "\u29eb", "\\blacklozenge");259defineSymbol(math, ams, textord, "\u2605", "\\bigstar");260defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle", true);261defineSymbol(math, ams, textord, "\u2201", "\\complement", true);262// unicode-math maps U+F0 (ð) to \matheth. We map to AMS function \eth263defineSymbol(math, ams, textord, "\u00f0", "\\eth", true);264defineSymbol(math, ams, textord, "\u2571", "\\diagup");265defineSymbol(math, ams, textord, "\u2572", "\\diagdown");266defineSymbol(math, ams, textord, "\u25a1", "\\square");267defineSymbol(math, ams, textord, "\u25a1", "\\Box");268defineSymbol(math, ams, textord, "\u25ca", "\\Diamond");269// unicode-math maps U+A5 to \mathyen. We map to AMS function \yen270defineSymbol(math, ams, textord, "\u00a5", "\\yen", true);271defineSymbol(text, ams, textord, "\u00a5", "\\yen", true);272defineSymbol(math, ams, textord, "\u2713", "\\checkmark", true);273defineSymbol(text, ams, textord, "\u2713", "\\checkmark");274// AMS Hebrew275defineSymbol(math, ams, textord, "\u2136", "\\beth", true);276defineSymbol(math, ams, textord, "\u2138", "\\daleth", true);277defineSymbol(math, ams, textord, "\u2137", "\\gimel", true);278// AMS Greek279defineSymbol(math, ams, textord, "\u03dd", "\\digamma");280defineSymbol(math, ams, textord, "\u03f0", "\\varkappa");281// AMS Delimiters282defineSymbol(math, ams, open, "\u250c", "\\ulcorner", true);283defineSymbol(math, ams, close, "\u2510", "\\urcorner", true);284defineSymbol(math, ams, open, "\u2514", "\\llcorner", true);285defineSymbol(math, ams, close, "\u2518", "\\lrcorner", true);286// AMS Binary Relations287defineSymbol(math, ams, rel, "\u2266", "\\leqq", true);288defineSymbol(math, ams, rel, "\u2a7d", "\\leqslant", true);289defineSymbol(math, ams, rel, "\u2a95", "\\eqslantless", true);290defineSymbol(math, ams, rel, "\u2272", "\\lesssim", true);291defineSymbol(math, ams, rel, "\u2a85", "\\lessapprox", true);292defineSymbol(math, ams, rel, "\u224a", "\\approxeq", true);293defineSymbol(math, ams, bin, "\u22d6", "\\lessdot");294defineSymbol(math, ams, rel, "\u22d8", "\\lll", true);295defineSymbol(math, ams, rel, "\u2276", "\\lessgtr", true);296defineSymbol(math, ams, rel, "\u22da", "\\lesseqgtr", true);297defineSymbol(math, ams, rel, "\u2a8b", "\\lesseqqgtr", true);298defineSymbol(math, ams, rel, "\u2251", "\\doteqdot");299defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq", true);300defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq", true);301defineSymbol(math, ams, rel, "\u223d", "\\backsim", true);302defineSymbol(math, ams, rel, "\u22cd", "\\backsimeq", true);303defineSymbol(math, ams, rel, "\u2ac5", "\\subseteqq", true);304defineSymbol(math, ams, rel, "\u22d0", "\\Subset", true);305defineSymbol(math, ams, rel, "\u228f", "\\sqsubset", true);306defineSymbol(math, ams, rel, "\u227c", "\\preccurlyeq", true);307defineSymbol(math, ams, rel, "\u22de", "\\curlyeqprec", true);308defineSymbol(math, ams, rel, "\u227e", "\\precsim", true);309defineSymbol(math, ams, rel, "\u2ab7", "\\precapprox", true);310defineSymbol(math, ams, rel, "\u22b2", "\\vartriangleleft");311defineSymbol(math, ams, rel, "\u22b4", "\\trianglelefteq");312defineSymbol(math, ams, rel, "\u22a8", "\\vDash", true);313defineSymbol(math, ams, rel, "\u22aa", "\\Vvdash", true);314defineSymbol(math, ams, rel, "\u2323", "\\smallsmile");315defineSymbol(math, ams, rel, "\u2322", "\\smallfrown");316defineSymbol(math, ams, rel, "\u224f", "\\bumpeq", true);317defineSymbol(math, ams, rel, "\u224e", "\\Bumpeq", true);318defineSymbol(math, ams, rel, "\u2267", "\\geqq", true);319defineSymbol(math, ams, rel, "\u2a7e", "\\geqslant", true);320defineSymbol(math, ams, rel, "\u2a96", "\\eqslantgtr", true);321defineSymbol(math, ams, rel, "\u2273", "\\gtrsim", true);322defineSymbol(math, ams, rel, "\u2a86", "\\gtrapprox", true);323defineSymbol(math, ams, bin, "\u22d7", "\\gtrdot");324defineSymbol(math, ams, rel, "\u22d9", "\\ggg", true);325defineSymbol(math, ams, rel, "\u2277", "\\gtrless", true);326defineSymbol(math, ams, rel, "\u22db", "\\gtreqless", true);327defineSymbol(math, ams, rel, "\u2a8c", "\\gtreqqless", true);328defineSymbol(math, ams, rel, "\u2256", "\\eqcirc", true);329defineSymbol(math, ams, rel, "\u2257", "\\circeq", true);330defineSymbol(math, ams, rel, "\u225c", "\\triangleq", true);331defineSymbol(math, ams, rel, "\u223c", "\\thicksim");332defineSymbol(math, ams, rel, "\u2248", "\\thickapprox");333defineSymbol(math, ams, rel, "\u2ac6", "\\supseteqq", true);334defineSymbol(math, ams, rel, "\u22d1", "\\Supset", true);335defineSymbol(math, ams, rel, "\u2290", "\\sqsupset", true);336defineSymbol(math, ams, rel, "\u227d", "\\succcurlyeq", true);337defineSymbol(math, ams, rel, "\u22df", "\\curlyeqsucc", true);338defineSymbol(math, ams, rel, "\u227f", "\\succsim", true);339defineSymbol(math, ams, rel, "\u2ab8", "\\succapprox", true);340defineSymbol(math, ams, rel, "\u22b3", "\\vartriangleright");341defineSymbol(math, ams, rel, "\u22b5", "\\trianglerighteq");342defineSymbol(math, ams, rel, "\u22a9", "\\Vdash", true);343defineSymbol(math, ams, rel, "\u2223", "\\shortmid");344defineSymbol(math, ams, rel, "\u2225", "\\shortparallel");345defineSymbol(math, ams, rel, "\u226c", "\\between", true);346defineSymbol(math, ams, rel, "\u22d4", "\\pitchfork", true);347defineSymbol(math, ams, rel, "\u221d", "\\varpropto");348defineSymbol(math, ams, rel, "\u25c0", "\\blacktriangleleft");349// unicode-math says that \therefore is a mathord atom.350// We kept the amssymb atom type, which is rel.351defineSymbol(math, ams, rel, "\u2234", "\\therefore", true);352defineSymbol(math, ams, rel, "\u220d", "\\backepsilon");353defineSymbol(math, ams, rel, "\u25b6", "\\blacktriangleright");354// unicode-math says that \because is a mathord atom.355// We kept the amssymb atom type, which is rel.356defineSymbol(math, ams, rel, "\u2235", "\\because", true);357defineSymbol(math, ams, rel, "\u22d8", "\\llless");358defineSymbol(math, ams, rel, "\u22d9", "\\gggtr");359defineSymbol(math, ams, bin, "\u22b2", "\\lhd");360defineSymbol(math, ams, bin, "\u22b3", "\\rhd");361defineSymbol(math, ams, rel, "\u2242", "\\eqsim", true);362defineSymbol(math, main, rel, "\u22c8", "\\Join");363defineSymbol(math, ams, rel, "\u2251", "\\Doteq", true);364// AMS Binary Operators365defineSymbol(math, ams, bin, "\u2214", "\\dotplus", true);366defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus");367defineSymbol(math, ams, bin, "\u22d2", "\\Cap", true);368defineSymbol(math, ams, bin, "\u22d3", "\\Cup", true);369defineSymbol(math, ams, bin, "\u2a5e", "\\doublebarwedge", true);370defineSymbol(math, ams, bin, "\u229f", "\\boxminus", true);371defineSymbol(math, ams, bin, "\u229e", "\\boxplus", true);372defineSymbol(math, ams, bin, "\u22c7", "\\divideontimes", true);373defineSymbol(math, ams, bin, "\u22c9", "\\ltimes", true);374defineSymbol(math, ams, bin, "\u22ca", "\\rtimes", true);375defineSymbol(math, ams, bin, "\u22cb", "\\leftthreetimes", true);376defineSymbol(math, ams, bin, "\u22cc", "\\rightthreetimes", true);377defineSymbol(math, ams, bin, "\u22cf", "\\curlywedge", true);378defineSymbol(math, ams, bin, "\u22ce", "\\curlyvee", true);379defineSymbol(math, ams, bin, "\u229d", "\\circleddash", true);380defineSymbol(math, ams, bin, "\u229b", "\\circledast", true);381defineSymbol(math, ams, bin, "\u22c5", "\\centerdot");382defineSymbol(math, ams, bin, "\u22ba", "\\intercal", true);383defineSymbol(math, ams, bin, "\u22d2", "\\doublecap");384defineSymbol(math, ams, bin, "\u22d3", "\\doublecup");385defineSymbol(math, ams, bin, "\u22a0", "\\boxtimes", true);386// AMS Arrows387// Note: unicode-math maps \u21e2 to their own function \rightdasharrow.388// We'll map it to AMS function \dashrightarrow. It produces the same atom.389defineSymbol(math, ams, rel, "\u21e2", "\\dashrightarrow", true);390// unicode-math maps \u21e0 to \leftdasharrow. We'll use the AMS synonym.391defineSymbol(math, ams, rel, "\u21e0", "\\dashleftarrow", true);392defineSymbol(math, ams, rel, "\u21c7", "\\leftleftarrows", true);393defineSymbol(math, ams, rel, "\u21c6", "\\leftrightarrows", true);394defineSymbol(math, ams, rel, "\u21da", "\\Lleftarrow", true);395defineSymbol(math, ams, rel, "\u219e", "\\twoheadleftarrow", true);396defineSymbol(math, ams, rel, "\u21a2", "\\leftarrowtail", true);397defineSymbol(math, ams, rel, "\u21ab", "\\looparrowleft", true);398defineSymbol(math, ams, rel, "\u21cb", "\\leftrightharpoons", true);399defineSymbol(math, ams, rel, "\u21b6", "\\curvearrowleft", true);400// unicode-math maps \u21ba to \acwopencirclearrow. We'll use the AMS synonym.401defineSymbol(math, ams, rel, "\u21ba", "\\circlearrowleft", true);402defineSymbol(math, ams, rel, "\u21b0", "\\Lsh", true);403defineSymbol(math, ams, rel, "\u21c8", "\\upuparrows", true);404defineSymbol(math, ams, rel, "\u21bf", "\\upharpoonleft", true);405defineSymbol(math, ams, rel, "\u21c3", "\\downharpoonleft", true);406defineSymbol(math, ams, rel, "\u22b8", "\\multimap", true);407defineSymbol(math, ams, rel, "\u21ad", "\\leftrightsquigarrow", true);408defineSymbol(math, ams, rel, "\u21c9", "\\rightrightarrows", true);409defineSymbol(math, ams, rel, "\u21c4", "\\rightleftarrows", true);410defineSymbol(math, ams, rel, "\u21a0", "\\twoheadrightarrow", true);411defineSymbol(math, ams, rel, "\u21a3", "\\rightarrowtail", true);412defineSymbol(math, ams, rel, "\u21ac", "\\looparrowright", true);413defineSymbol(math, ams, rel, "\u21b7", "\\curvearrowright", true);414// unicode-math maps \u21bb to \cwopencirclearrow. We'll use the AMS synonym.415defineSymbol(math, ams, rel, "\u21bb", "\\circlearrowright", true);416defineSymbol(math, ams, rel, "\u21b1", "\\Rsh", true);417defineSymbol(math, ams, rel, "\u21ca", "\\downdownarrows", true);418defineSymbol(math, ams, rel, "\u21be", "\\upharpoonright", true);419defineSymbol(math, ams, rel, "\u21c2", "\\downharpoonright", true);420defineSymbol(math, ams, rel, "\u21dd", "\\rightsquigarrow", true);421defineSymbol(math, ams, rel, "\u21dd", "\\leadsto");422defineSymbol(math, ams, rel, "\u21db", "\\Rrightarrow", true);423defineSymbol(math, ams, rel, "\u21be", "\\restriction");424defineSymbol(math, main, textord, "\u2018", "`");425defineSymbol(math, main, textord, "$", "\\$");426defineSymbol(text, main, textord, "$", "\\$");427defineSymbol(text, main, textord, "$", "\\textdollar");428defineSymbol(math, main, textord, "%", "\\%");429defineSymbol(text, main, textord, "%", "\\%");430defineSymbol(math, main, textord, "_", "\\_");431defineSymbol(text, main, textord, "_", "\\_");432defineSymbol(text, main, textord, "_", "\\textunderscore");433defineSymbol(math, main, textord, "\u2220", "\\angle", true);434defineSymbol(math, main, textord, "\u221e", "\\infty", true);435defineSymbol(math, main, textord, "\u2032", "\\prime");436defineSymbol(math, main, textord, "\u25b3", "\\triangle");437defineSymbol(math, main, textord, "\u0393", "\\Gamma", true);438defineSymbol(math, main, textord, "\u0394", "\\Delta", true);439defineSymbol(math, main, textord, "\u0398", "\\Theta", true);440defineSymbol(math, main, textord, "\u039b", "\\Lambda", true);441defineSymbol(math, main, textord, "\u039e", "\\Xi", true);442defineSymbol(math, main, textord, "\u03a0", "\\Pi", true);443defineSymbol(math, main, textord, "\u03a3", "\\Sigma", true);444defineSymbol(math, main, textord, "\u03a5", "\\Upsilon", true);445defineSymbol(math, main, textord, "\u03a6", "\\Phi", true);446defineSymbol(math, main, textord, "\u03a8", "\\Psi", true);447defineSymbol(math, main, textord, "\u03a9", "\\Omega", true);448defineSymbol(math, main, textord, "A", "\u0391");449defineSymbol(math, main, textord, "B", "\u0392");450defineSymbol(math, main, textord, "E", "\u0395");451defineSymbol(math, main, textord, "Z", "\u0396");452defineSymbol(math, main, textord, "H", "\u0397");453defineSymbol(math, main, textord, "I", "\u0399");454defineSymbol(math, main, textord, "K", "\u039A");455defineSymbol(math, main, textord, "M", "\u039C");456defineSymbol(math, main, textord, "N", "\u039D");457defineSymbol(math, main, textord, "O", "\u039F");458defineSymbol(math, main, textord, "P", "\u03A1");459defineSymbol(math, main, textord, "T", "\u03A4");460defineSymbol(math, main, textord, "X", "\u03A7");461defineSymbol(math, main, textord, "\u00ac", "\\neg", true);462defineSymbol(math, main, textord, "\u00ac", "\\lnot");463defineSymbol(math, main, textord, "\u22a4", "\\top");464defineSymbol(math, main, textord, "\u22a5", "\\bot");465defineSymbol(math, main, textord, "\u2205", "\\emptyset");466defineSymbol(math, ams, textord, "\u2205", "\\varnothing");467defineSymbol(math, main, mathord, "\u03b1", "\\alpha", true);468defineSymbol(math, main, mathord, "\u03b2", "\\beta", true);469defineSymbol(math, main, mathord, "\u03b3", "\\gamma", true);470defineSymbol(math, main, mathord, "\u03b4", "\\delta", true);471defineSymbol(math, main, mathord, "\u03f5", "\\epsilon", true);472defineSymbol(math, main, mathord, "\u03b6", "\\zeta", true);473defineSymbol(math, main, mathord, "\u03b7", "\\eta", true);474defineSymbol(math, main, mathord, "\u03b8", "\\theta", true);475defineSymbol(math, main, mathord, "\u03b9", "\\iota", true);476defineSymbol(math, main, mathord, "\u03ba", "\\kappa", true);477defineSymbol(math, main, mathord, "\u03bb", "\\lambda", true);478defineSymbol(math, main, mathord, "\u03bc", "\\mu", true);479defineSymbol(math, main, mathord, "\u03bd", "\\nu", true);480defineSymbol(math, main, mathord, "\u03be", "\\xi", true);481defineSymbol(math, main, mathord, "\u03bf", "\\omicron", true);482defineSymbol(math, main, mathord, "\u03c0", "\\pi", true);483defineSymbol(math, main, mathord, "\u03c1", "\\rho", true);484defineSymbol(math, main, mathord, "\u03c3", "\\sigma", true);485defineSymbol(math, main, mathord, "\u03c4", "\\tau", true);486defineSymbol(math, main, mathord, "\u03c5", "\\upsilon", true);487defineSymbol(math, main, mathord, "\u03d5", "\\phi", true);488defineSymbol(math, main, mathord, "\u03c7", "\\chi", true);489defineSymbol(math, main, mathord, "\u03c8", "\\psi", true);490defineSymbol(math, main, mathord, "\u03c9", "\\omega", true);491defineSymbol(math, main, mathord, "\u03b5", "\\varepsilon", true);492defineSymbol(math, main, mathord, "\u03d1", "\\vartheta", true);493defineSymbol(math, main, mathord, "\u03d6", "\\varpi", true);494defineSymbol(math, main, mathord, "\u03f1", "\\varrho", true);495defineSymbol(math, main, mathord, "\u03c2", "\\varsigma", true);496defineSymbol(math, main, mathord, "\u03c6", "\\varphi", true);497defineSymbol(math, main, bin, "\u2217", "*");498defineSymbol(math, main, bin, "+", "+");499defineSymbol(math, main, bin, "\u2212", "-");500defineSymbol(math, main, bin, "\u22c5", "\\cdot", true);501defineSymbol(math, main, bin, "\u2218", "\\circ");502defineSymbol(math, main, bin, "\u00f7", "\\div", true);503defineSymbol(math, main, bin, "\u00b1", "\\pm", true);504defineSymbol(math, main, bin, "\u00d7", "\\times", true);505defineSymbol(math, main, bin, "\u2229", "\\cap", true);506defineSymbol(math, main, bin, "\u222a", "\\cup", true);507defineSymbol(math, main, bin, "\u2216", "\\setminus");508defineSymbol(math, main, bin, "\u2227", "\\land");509defineSymbol(math, main, bin, "\u2228", "\\lor");510defineSymbol(math, main, bin, "\u2227", "\\wedge", true);511defineSymbol(math, main, bin, "\u2228", "\\vee", true);512defineSymbol(math, main, textord, "\u221a", "\\surd");513defineSymbol(math, main, open, "(", "(");514defineSymbol(math, main, open, "[", "[");515defineSymbol(math, main, open, "\u27e8", "\\langle", true);516defineSymbol(math, main, open, "\u2223", "\\lvert");517defineSymbol(math, main, open, "\u2225", "\\lVert");518defineSymbol(math, main, close, ")", ")");519defineSymbol(math, main, close, "]", "]");520defineSymbol(math, main, close, "?", "?");521defineSymbol(math, main, close, "!", "!");522defineSymbol(math, main, close, "\u27e9", "\\rangle", true);523defineSymbol(math, main, close, "\u2223", "\\rvert");524defineSymbol(math, main, close, "\u2225", "\\rVert");525defineSymbol(math, main, rel, "=", "=");526defineSymbol(math, main, rel, "<", "<");527defineSymbol(math, main, rel, ">", ">");528defineSymbol(math, main, rel, ":", ":");529defineSymbol(math, main, rel, "\u2248", "\\approx", true);530defineSymbol(math, main, rel, "\u2245", "\\cong", true);531defineSymbol(math, main, rel, "\u2265", "\\ge");532defineSymbol(math, main, rel, "\u2265", "\\geq", true);533defineSymbol(math, main, rel, "\u2190", "\\gets");534defineSymbol(math, main, rel, ">", "\\gt");535defineSymbol(math, main, rel, "\u2208", "\\in", true);536defineSymbol(math, main, rel, "\ue020", "\\@not");537defineSymbol(math, main, rel, "\u2282", "\\subset", true);538defineSymbol(math, main, rel, "\u2283", "\\supset", true);539defineSymbol(math, main, rel, "\u2286", "\\subseteq", true);540defineSymbol(math, main, rel, "\u2287", "\\supseteq", true);541defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq", true);542defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq", true);543defineSymbol(math, main, rel, "\u22a8", "\\models");544defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true);545defineSymbol(math, main, rel, "\u2264", "\\le");546defineSymbol(math, main, rel, "\u2264", "\\leq", true);547defineSymbol(math, main, rel, "<", "\\lt");548defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true);549defineSymbol(math, main, rel, "\u2192", "\\to");550defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true);551defineSymbol(math, ams, rel, "\u2270", "\\nleq", true);552defineSymbol(math, main, spacing, "\u00a0", "\\ ");553defineSymbol(math, main, spacing, "\u00a0", "~");554defineSymbol(math, main, spacing, "\u00a0", "\\space");555// Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{%556defineSymbol(math, main, spacing, "\u00a0", "\\nobreakspace");557defineSymbol(text, main, spacing, "\u00a0", "\\ ");558defineSymbol(text, main, spacing, "\u00a0", "~");559defineSymbol(text, main, spacing, "\u00a0", "\\space");560defineSymbol(text, main, spacing, "\u00a0", "\\nobreakspace");561defineSymbol(math, main, spacing, null, "\\nobreak");562defineSymbol(math, main, spacing, null, "\\allowbreak");563defineSymbol(math, main, punct, ",", ",");564defineSymbol(math, main, punct, ";", ";");565defineSymbol(math, ams, bin, "\u22bc", "\\barwedge", true);566defineSymbol(math, ams, bin, "\u22bb", "\\veebar", true);567defineSymbol(math, main, bin, "\u2299", "\\odot", true);568defineSymbol(math, main, bin, "\u2295", "\\oplus", true);569defineSymbol(math, main, bin, "\u2297", "\\otimes", true);570defineSymbol(math, main, textord, "\u2202", "\\partial", true);571defineSymbol(math, main, bin, "\u2298", "\\oslash", true);572defineSymbol(math, ams, bin, "\u229a", "\\circledcirc", true);573defineSymbol(math, ams, bin, "\u22a1", "\\boxdot", true);574defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup");575defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown");576defineSymbol(math, main, bin, "\u2020", "\\dagger");577defineSymbol(math, main, bin, "\u22c4", "\\diamond");578defineSymbol(math, main, bin, "\u22c6", "\\star");579defineSymbol(math, main, bin, "\u25c3", "\\triangleleft");580defineSymbol(math, main, bin, "\u25b9", "\\triangleright");581defineSymbol(math, main, open, "{", "\\{");582defineSymbol(text, main, textord, "{", "\\{");583defineSymbol(text, main, textord, "{", "\\textbraceleft");584defineSymbol(math, main, close, "}", "\\}");585defineSymbol(text, main, textord, "}", "\\}");586defineSymbol(text, main, textord, "}", "\\textbraceright");587defineSymbol(math, main, open, "{", "\\lbrace");588defineSymbol(math, main, close, "}", "\\rbrace");589defineSymbol(math, main, open, "[", "\\lbrack");590defineSymbol(text, main, textord, "[", "\\lbrack");591defineSymbol(math, main, close, "]", "\\rbrack");592defineSymbol(text, main, textord, "]", "\\rbrack");593defineSymbol(math, main, open, "(", "\\lparen");594defineSymbol(math, main, close, ")", "\\rparen");595defineSymbol(text, main, textord, "<", "\\textless"); // in T1 fontenc596defineSymbol(text, main, textord, ">", "\\textgreater"); // in T1 fontenc597defineSymbol(math, main, open, "\u230a", "\\lfloor", true);598defineSymbol(math, main, close, "\u230b", "\\rfloor", true);599defineSymbol(math, main, open, "\u2308", "\\lceil", true);600defineSymbol(math, main, close, "\u2309", "\\rceil", true);601defineSymbol(math, main, textord, "\\", "\\backslash");602defineSymbol(math, main, textord, "\u2223", "|");603defineSymbol(math, main, textord, "\u2223", "\\vert");604defineSymbol(text, main, textord, "|", "\\textbar"); // in T1 fontenc605defineSymbol(math, main, textord, "\u2225", "\\|");606defineSymbol(math, main, textord, "\u2225", "\\Vert");607defineSymbol(text, main, textord, "\u2225", "\\textbardbl");608defineSymbol(text, main, textord, "~", "\\textasciitilde");609defineSymbol(text, main, textord, "\\", "\\textbackslash");610defineSymbol(text, main, textord, "^", "\\textasciicircum");611defineSymbol(math, main, rel, "\u2191", "\\uparrow", true);612defineSymbol(math, main, rel, "\u21d1", "\\Uparrow", true);613defineSymbol(math, main, rel, "\u2193", "\\downarrow", true);614defineSymbol(math, main, rel, "\u21d3", "\\Downarrow", true);615defineSymbol(math, main, rel, "\u2195", "\\updownarrow", true);616defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow", true);617defineSymbol(math, main, op, "\u2210", "\\coprod");618defineSymbol(math, main, op, "\u22c1", "\\bigvee");619defineSymbol(math, main, op, "\u22c0", "\\bigwedge");620defineSymbol(math, main, op, "\u2a04", "\\biguplus");621defineSymbol(math, main, op, "\u22c2", "\\bigcap");622defineSymbol(math, main, op, "\u22c3", "\\bigcup");623defineSymbol(math, main, op, "\u222b", "\\int");624defineSymbol(math, main, op, "\u222b", "\\intop");625defineSymbol(math, main, op, "\u222c", "\\iint");626defineSymbol(math, main, op, "\u222d", "\\iiint");627defineSymbol(math, main, op, "\u220f", "\\prod");628defineSymbol(math, main, op, "\u2211", "\\sum");629defineSymbol(math, main, op, "\u2a02", "\\bigotimes");630defineSymbol(math, main, op, "\u2a01", "\\bigoplus");631defineSymbol(math, main, op, "\u2a00", "\\bigodot");632defineSymbol(math, main, op, "\u222e", "\\oint");633defineSymbol(math, main, op, "\u222f", "\\oiint");634defineSymbol(math, main, op, "\u2230", "\\oiiint");635defineSymbol(math, main, op, "\u2a06", "\\bigsqcup");636defineSymbol(math, main, op, "\u222b", "\\smallint");637defineSymbol(text, main, inner, "\u2026", "\\textellipsis");638defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");639defineSymbol(text, main, inner, "\u2026", "\\ldots", true);640defineSymbol(math, main, inner, "\u2026", "\\ldots", true);641defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true);642defineSymbol(math, main, inner, "\u22f1", "\\ddots", true);643defineSymbol(math, main, textord, "\u22ee", "\\varvdots"); // \vdots is a macro644defineSymbol(math, main, accent, "\u02ca", "\\acute");645defineSymbol(math, main, accent, "\u02cb", "\\grave");646defineSymbol(math, main, accent, "\u00a8", "\\ddot");647defineSymbol(math, main, accent, "\u007e", "\\tilde");648defineSymbol(math, main, accent, "\u02c9", "\\bar");649defineSymbol(math, main, accent, "\u02d8", "\\breve");650defineSymbol(math, main, accent, "\u02c7", "\\check");651defineSymbol(math, main, accent, "\u005e", "\\hat");652defineSymbol(math, main, accent, "\u20d7", "\\vec");653defineSymbol(math, main, accent, "\u02d9", "\\dot");654defineSymbol(math, main, accent, "\u02da", "\\mathring");655defineSymbol(math, main, mathord, "\u0131", "\\imath", true);656defineSymbol(math, main, mathord, "\u0237", "\\jmath", true);657defineSymbol(text, main, textord, "\u0131", "\\i", true);658defineSymbol(text, main, textord, "\u0237", "\\j", true);659defineSymbol(text, main, textord, "\u00df", "\\ss", true);660defineSymbol(text, main, textord, "\u00e6", "\\ae", true);661defineSymbol(text, main, textord, "\u00e6", "\\ae", true);662defineSymbol(text, main, textord, "\u0153", "\\oe", true);663defineSymbol(text, main, textord, "\u00f8", "\\o", true);664defineSymbol(text, main, textord, "\u00c6", "\\AE", true);665defineSymbol(text, main, textord, "\u0152", "\\OE", true);666defineSymbol(text, main, textord, "\u00d8", "\\O", true);667defineSymbol(text, main, accent, "\u02ca", "\\'"); // acute668defineSymbol(text, main, accent, "\u02cb", "\\`"); // grave669defineSymbol(text, main, accent, "\u02c6", "\\^"); // circumflex670defineSymbol(text, main, accent, "\u02dc", "\\~"); // tilde671defineSymbol(text, main, accent, "\u02c9", "\\="); // macron672defineSymbol(text, main, accent, "\u02d8", "\\u"); // breve673defineSymbol(text, main, accent, "\u02d9", "\\."); // dot above674defineSymbol(text, main, accent, "\u02da", "\\r"); // ring above675defineSymbol(text, main, accent, "\u02c7", "\\v"); // caron676defineSymbol(text, main, accent, "\u00a8", '\\"'); // diaresis677defineSymbol(text, main, accent, "\u02dd", "\\H"); // double acute678defineSymbol(text, main, accent, "\u25ef", "\\textcircled"); // \bigcirc glyph679// These ligatures are detected and created in Parser.js's `formLigatures`.680const ligatures = {681 "--": true,682 "---": true,683 "``": true,684 "''": true,685};686defineSymbol(text, main, textord, "\u2013", "--");687defineSymbol(text, main, textord, "\u2013", "\\textendash");688defineSymbol(text, main, textord, "\u2014", "---");689defineSymbol(text, main, textord, "\u2014", "\\textemdash");690defineSymbol(text, main, textord, "\u2018", "`");691defineSymbol(text, main, textord, "\u2018", "\\textquoteleft");692defineSymbol(text, main, textord, "\u2019", "'");693defineSymbol(text, main, textord, "\u2019", "\\textquoteright");694defineSymbol(text, main, textord, "\u201c", "``");695defineSymbol(text, main, textord, "\u201c", "\\textquotedblleft");696defineSymbol(text, main, textord, "\u201d", "''");697defineSymbol(text, main, textord, "\u201d", "\\textquotedblright");698// \degree from gensymb package699defineSymbol(math, main, textord, "\u00b0", "\\degree", true);700defineSymbol(text, main, textord, "\u00b0", "\\degree");701// \textdegree from inputenc package702defineSymbol(text, main, textord, "\u00b0", "\\textdegree", true);703// TODO: In LaTeX, \pounds can generate a different character in text and math704// mode, but among our fonts, only Main-Italic defines this character "163".705defineSymbol(math, main, mathord, "\u00a3", "\\pounds");706defineSymbol(math, main, mathord, "\u00a3", "\\mathsterling", true);707defineSymbol(text, main, mathord, "\u00a3", "\\pounds");708defineSymbol(text, main, mathord, "\u00a3", "\\textsterling", true);709defineSymbol(math, ams, textord, "\u2720", "\\maltese");710defineSymbol(text, ams, textord, "\u2720", "\\maltese");711defineSymbol(text, main, spacing, "\u00a0", "\\ ");712defineSymbol(text, main, spacing, "\u00a0", " ");713defineSymbol(text, main, spacing, "\u00a0", "~");714// There are lots of symbols which are the same, so we add them in afterwards.715// All of these are textords in math mode716const mathTextSymbols = "0123456789/@.\"";717for (let i = 0; i < mathTextSymbols.length; i++) {718 const ch = mathTextSymbols.charAt(i);719 defineSymbol(math, main, textord, ch, ch);720}721// All of these are textords in text mode722const textSymbols = "0123456789!@*()-=+[]<>|\";:?/.,";723for (let i = 0; i < textSymbols.length; i++) {724 const ch = textSymbols.charAt(i);725 defineSymbol(text, main, textord, ch, ch);726}727// All of these are textords in text mode, and mathords in math mode728const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";729for (let i = 0; i < letters.length; i++) {730 const ch = letters.charAt(i);731 defineSymbol(math, main, mathord, ch, ch);732 defineSymbol(text, main, textord, ch, ch);733}734// Blackboard bold and script letters in Unicode range735defineSymbol(math, ams, textord, "C", "\u2102"); // blackboard bold736defineSymbol(text, ams, textord, "C", "\u2102");737defineSymbol(math, ams, textord, "H", "\u210D");738defineSymbol(text, ams, textord, "H", "\u210D");739defineSymbol(math, ams, textord, "N", "\u2115");740defineSymbol(text, ams, textord, "N", "\u2115");741defineSymbol(math, ams, textord, "P", "\u2119");742defineSymbol(text, ams, textord, "P", "\u2119");743defineSymbol(math, ams, textord, "Q", "\u211A");744defineSymbol(text, ams, textord, "Q", "\u211A");745defineSymbol(math, ams, textord, "R", "\u211D");746defineSymbol(text, ams, textord, "R", "\u211D");747defineSymbol(math, ams, textord, "Z", "\u2124");748defineSymbol(text, ams, textord, "Z", "\u2124");749defineSymbol(math, main, mathord, "h", "\u210E"); // italic h, Planck constant750defineSymbol(text, main, mathord, "h", "\u210E");751// The next loop loads wide (surrogate pair) characters.752// We support some letters in the Unicode range U+1D400 to U+1D7FF,753// Mathematical Alphanumeric Symbols.754// Some editors do not deal well with wide characters. So don't write the755// string into this file. Instead, create the string from the surrogate pair.756let wideChar = "";757for (let i = 0; i < letters.length; i++) {758 const ch = letters.charAt(i);759 // The hex numbers in the next line are a surrogate pair.760 // 0xD835 is the high surrogate for all letters in the range we support.761 // 0xDC00 is the low surrogate for bold A.762 wideChar = String.fromCharCode(0xD835, 0xDC00 + i); // A-Z a-z bold763 defineSymbol(math, main, mathord, ch, wideChar);764 defineSymbol(text, main, textord, ch, wideChar);765 wideChar = String.fromCharCode(0xD835, 0xDC34 + i); // A-Z a-z italic766 defineSymbol(math, main, mathord, ch, wideChar);767 defineSymbol(text, main, textord, ch, wideChar);768 wideChar = String.fromCharCode(0xD835, 0xDC68 + i); // A-Z a-z bold italic769 defineSymbol(math, main, mathord, ch, wideChar);770 defineSymbol(text, main, textord, ch, wideChar);771 wideChar = String.fromCharCode(0xD835, 0xDD04 + i); // A-Z a-z Fractur772 defineSymbol(math, main, mathord, ch, wideChar);773 defineSymbol(text, main, textord, ch, wideChar);774 wideChar = String.fromCharCode(0xD835, 0xDDA0 + i); // A-Z a-z sans-serif775 defineSymbol(math, main, mathord, ch, wideChar);776 defineSymbol(text, main, textord, ch, wideChar);777 wideChar = String.fromCharCode(0xD835, 0xDDD4 + i); // A-Z a-z sans bold778 defineSymbol(math, main, mathord, ch, wideChar);779 defineSymbol(text, main, textord, ch, wideChar);780 wideChar = String.fromCharCode(0xD835, 0xDE08 + i); // A-Z a-z sans italic781 defineSymbol(math, main, mathord, ch, wideChar);782 defineSymbol(text, main, textord, ch, wideChar);783 wideChar = String.fromCharCode(0xD835, 0xDE70 + i); // A-Z a-z monospace784 defineSymbol(math, main, mathord, ch, wideChar);785 defineSymbol(text, main, textord, ch, wideChar);786 if (i < 26) {787 // KaTeX fonts have only capital letters for blackboard bold and script.788 // See exception for k below.789 wideChar = String.fromCharCode(0xD835, 0xDD38 + i); // A-Z double struck790 defineSymbol(math, main, mathord, ch, wideChar);791 defineSymbol(text, main, textord, ch, wideChar);792 wideChar = String.fromCharCode(0xD835, 0xDC9C + i); // A-Z script793 defineSymbol(math, main, mathord, ch, wideChar);794 defineSymbol(text, main, textord, ch, wideChar);795 }796 // TODO: Add bold script when it is supported by a KaTeX font.797}798// "k" is the only double struck lower case letter in the KaTeX fonts.799wideChar = String.fromCharCode(0xD835, 0xDD5C); // k double struck800defineSymbol(math, main, mathord, "k", wideChar);801defineSymbol(text, main, textord, "k", wideChar);802// Next, some wide character numerals803for (let i = 0; i < 10; i++) {804 const ch = i.toString();805 wideChar = String.fromCharCode(0xD835, 0xDFCE + i); // 0-9 bold806 defineSymbol(math, main, mathord, ch, wideChar);807 defineSymbol(text, main, textord, ch, wideChar);808 wideChar = String.fromCharCode(0xD835, 0xDFE2 + i); // 0-9 sans serif809 defineSymbol(math, main, mathord, ch, wideChar);810 defineSymbol(text, main, textord, ch, wideChar);811 wideChar = String.fromCharCode(0xD835, 0xDFEC + i); // 0-9 bold sans812 defineSymbol(math, main, mathord, ch, wideChar);813 defineSymbol(text, main, textord, ch, wideChar);814 wideChar = String.fromCharCode(0xD835, 0xDFF6 + i); // 0-9 monospace815 defineSymbol(math, main, mathord, ch, wideChar);816 defineSymbol(text, main, textord, ch, wideChar);817}818// We add these Latin-1 letters as symbols for backwards-compatibility,819// but they are not actually in the font, nor are they supported by the820// Unicode accent mechanism, so they fall back to Times font and look ugly.821// TODO(edemaine): Fix this.822const extraLatin = "ÃÃÃçþ";823for (let i = 0; i < extraLatin.length; i++) {824 const ch = extraLatin.charAt(i);825 defineSymbol(math, main, mathord, ch, ch);826 defineSymbol(text, main, textord, ch, ch);827}828defineSymbol(text, main, textord, "ð", "ð");829// Unicode versions of existing characters830defineSymbol(text, main, textord, "\u2013", "â");831defineSymbol(text, main, textord, "\u2014", "â");832defineSymbol(text, main, textord, "\u2018", "â");833defineSymbol(text, main, textord, "\u2019", "â");834defineSymbol(text, main, textord, "\u201c", "â");835defineSymbol(text, main, textord, "\u201d", "â");836module.exports = {837 ATOMS,838 NON_ATOMS,839 symbols,840 defineSymbol,841 ligatures,842 extraLatin...
cryptos.js
Source:cryptos.js
1export const BTC = {2 id: 'bitcoin',3 name: 'Bitcoin',4 symbol: 'BTC',5};6export const ETH = {7 id: 'ethereum',8 name: 'Ethereum',9 symbol: 'ETH',10};11export const BCH = {12 id: 'bitcoin-cash',13 name: 'Bitcoin Cash',14 symbol: 'BCH',15};16export const LTC = {17 id: 'litecoin',18 name: 'Litecoin',19 symbol: 'LTC',20};21export const MIOTA = {22 id: 'iota',23 name: 'IOTA',24 symbol: 'MIOTA',25};26export const XRP = {27 id: 'ripple',28 name: 'Ripple',29 symbol: 'XRP',30};31export const DASH = {32 id: 'dash',33 name: 'Dash',34 symbol: 'DASH',35};36export const XEM = {37 id: 'nem',38 name: 'NEM',39 symbol: 'XEM',40};41export const XMR = {42 id: 'monero',43 name: 'Monero',44 symbol: 'XMR',45};46export const BTG = {47 id: 'bitcoin-gold',48 name: 'Bitcoin Gold',49 symbol: 'BTG',50};51export const ADA = {52 id: 'cardano',53 name: 'Cardano',54 symbol: 'ADA',55};56export const EOS = {57 id: 'eos',58 name: 'EOS',59 symbol: 'EOS',60};61export const ETC = {62 id: 'ethereum-classic',63 name: 'Ethereum Classic',64 symbol: 'ETC',65};66export const XLM = {67 id: 'stellar',68 name: 'Stellar Lumens',69 symbol: 'XLM',70};71export const NEO = {72 id: 'neo',73 name: 'NEO',74 symbol: 'NEO',75};76export const BCC = {77 id: 'bitconnect',78 name: 'BitConnect',79 symbol: 'BCC',80};81export const PPT = {82 id: 'populous',83 name: 'Populous',84 symbol: 'PPT',85};86export const WAVES = {87 id: 'waves',88 name: 'Waves',89 symbol: 'WAVES',90};91export const OMG = {92 id: 'omisego',93 name: 'OmiseGO',94 symbol: 'OMG',95};96export const LSK = {97 id: 'lisk',98 name: 'Lisk',99 symbol: 'LSK',100};101export const QTUM = {102 id: 'qtum',103 name: 'Qtum',104 symbol: 'QTUM',105};106export const ZEC = {107 id: 'zcash',108 name: 'Zcash',109 symbol: 'ZEC',110};111export const STRAT = {112 id: 'stratis',113 name: 'Stratis',114 symbol: 'STRAT',115};116export const ARDR = {117 id: 'ardor',118 name: 'Ardor',119 symbol: 'ARDR',120};121export const USDT = {122 id: 'tether',123 name: 'Tether',124 symbol: 'USDT',125};126export const MONA = {127 id: 'monacoin',128 name: 'MonaCoin',129 symbol: 'MONA',130};131export const NXT = {132 id: 'nxt',133 name: 'Nxt',134 symbol: 'NXT',135};136export const HSR = {137 id: 'hshare',138 name: 'Hshare',139 symbol: 'HSR',140};141export const BTS = {142 id: 'bitshares',143 name: 'BitShares',144 symbol: 'BTS',145};146export const BCN = {147 id: 'bytecoin-bcn',148 name: 'Bytecoin',149 symbol: 'BCN',150};151export const TRX = {152 id: 'tron',153 name: 'TRON',154 symbol: 'TRX',155};156export const STEEM = {157 id: 'steem',158 name: 'Steem',159 symbol: 'STEEM',160};161export const VERI = {162 id: 'veritaseum',163 name: 'Veritaseum',164 symbol: 'VERI',165};166export const ARK = {167 id: 'ark',168 name: 'Ark',169 symbol: 'ARK',170};171export const SALT = {172 id: 'salt',173 name: 'SALT',174 symbol: 'SALT',175};176export const DCR = {177 id: 'decred',178 name: 'Decred',179 symbol: 'DCR',180};181export const REP = {182 id: 'augur',183 name: 'Augur',184 symbol: 'REP',185};186export const DOGE = {187 id: 'dogecoin',188 name: 'Dogecoin',189 symbol: 'DOGE',190};191export const KMD = {192 id: 'komodo',193 name: 'Komodo',194 symbol: 'KMD',195};196export const VTC = {197 id: 'vertcoin',198 name: 'Vertcoin',199 symbol: 'VTC',200};201export const EMC2 = {202 id: 'einsteinium',203 name: 'Einsteinium',204 symbol: 'EMC2',205};206export const SC = {207 id: 'siacoin',208 name: 'Siacoin',209 symbol: 'SC',210};211export const GNT = {212 id: 'golem-network-tokens',213 name: 'Golem',214 symbol: 'GNT',215};216export const PIVX = {217 id: 'pivx',218 name: 'PIVX',219 symbol: 'PIVX',220};221export const BNB = {222 id: 'binance-coin',223 name: 'Binance Coin',224 symbol: 'BNB',225};226export const DGD = {227 id: 'digixdao',228 name: 'DigixDAO',229 symbol: 'DGD',230};231export const MAID = {232 id: 'maidsafecoin',233 name: 'MaidSafeCoin',234 symbol: 'MAID',235};236export const SAN = {237 id: 'santiment',238 name: 'Santiment Network Token',239 symbol: 'SAN',240};241export const XRB = {242 id: 'raiblocks',243 name: 'RaiBlocks',244 symbol: 'XRB',245};246export const BAT = {247 id: 'basic-attention-token',248 name: 'Basic Attention Token',249 symbol: 'BAT',250};251export const PAY = {252 id: 'tenx',253 name: 'TenX',254 symbol: 'PAY',255};256export const SYS = {257 id: 'syscoin',258 name: 'Syscoin',259 symbol: 'SYS',260};261export const FCT = {262 id: 'factom',263 name: 'Factom',264 symbol: 'FCT',265};266export const SNT = {267 id: 'status',268 name: 'Status',269 symbol: 'SNT',270};271export const CNX = {272 id: 'cryptonex',273 name: 'Cryptonex',274 symbol: 'CNX',275};276export const QASH = {277 id: 'qash',278 name: 'QASH',279 symbol: 'QASH',280};281export const POWR = {282 id: 'power-ledger',283 name: 'Power Ledger',284 symbol: 'POWR',285};286export const BTCD = {287 id: 'bitcoindark',288 name: 'BitcoinDark',289 symbol: 'BTCD',290};291export const MANA = {292 id: 'decentraland',293 name: 'Decentraland',294 symbol: 'MANA',295};296export const MCO = {297 id: 'monaco',298 name: 'Monaco',299 symbol: 'MCO',300};301export const GBYTE = {302 id: 'byteball',303 name: 'Byteball Bytes',304 symbol: 'GBYTE',305};306export const WTC = {307 id: 'walton',308 name: 'Walton',309 symbol: 'WTC',310};311export const KNC = {312 id: 'kyber-network',313 name: 'Kyber Network',314 symbol: 'KNC',315};316export const BTM = {317 id: 'bytom',318 name: 'Bytom',319 symbol: 'BTM',320};321export const XZC = {322 id: 'zcoin',323 name: 'ZCoin',324 symbol: 'XZC',325};326export const GAS = {327 id: 'gas',328 name: 'Gas',329 symbol: 'GAS',330};331export const GNO = {332 id: 'gnosis-gno',333 name: 'Gnosis',334 symbol: 'GNO',335};336export const VEN = {337 id: 'vechain',338 name: 'VeChain',339 symbol: 'VEN',340};341export const AION = {342 id: 'aion',343 name: 'Aion',344 symbol: 'AION',345};346export const ICN = {347 id: 'iconomi',348 name: 'Iconomi',349 symbol: 'ICN',350};351export const DGB = {352 id: 'digibyte',353 name: 'DigiByte',354 symbol: 'DGB',355};356export const AE = {357 id: 'aeternity',358 name: 'Aeternity',359 symbol: 'AE',360};361export const FUN = {362 id: 'funfair',363 name: 'FunFair',364 symbol: 'FUN',365};366export const GAME = {367 id: 'gamecredits',368 name: 'GameCredits',369 symbol: 'GAME',370};371export const RDN = {372 id: 'raiden-network-token',373 name: 'Raiden Network Token',374 symbol: 'RDN',375};376export const NAV = {377 id: 'nav-coin',378 name: 'NAV Coin',379 symbol: 'NAV',380};381export const PURA = {382 id: 'pura',383 name: 'Pura',384 symbol: 'PURA',385};386export const BNT = {387 id: 'bancor',388 name: 'Bancor',389 symbol: 'BNT',390};391export const NXS = {392 id: 'nexus',393 name: 'Nexus',394 symbol: 'NXS',395};396export const XVG = {397 id: 'verge',398 name: 'Verge',399 symbol: 'XVG',400};401export const CVC = {402 id: 'civic',403 name: 'Civic',404 symbol: 'CVC',405};406export const ZRX = {407 id: '0x',408 name: '0x',409 symbol: 'ZRX',410};411export const EDG = {412 id: 'edgeless',413 name: 'Edgeless',414 symbol: 'EDG',415};416export const MTL = {417 id: 'metal',418 name: 'Metal',419 symbol: 'MTL',420};421export const REQ = {422 id: 'request-network',423 name: 'Request Network',424 symbol: 'REQ',425};426export const BLOCK = {427 id: 'blocknet',428 name: 'Blocknet',429 symbol: 'BLOCK',430};431export const RHOC = {432 id: 'rchain',433 name: 'RChain',434 symbol: 'RHOC',435};436export const STORJ = {437 id: 'storj',438 name: 'Storj',439 symbol: 'STORJ',440};441export const GXS = {442 id: 'gxshares',443 name: 'GXShares',444 symbol: 'GXS',445};446export const ETP = {447 id: 'metaverse',448 name: 'Metaverse ETP',449 symbol: 'ETP',450};451export const ETHOS = {452 id: 'ethos',453 name: 'Ethos',454 symbol: 'ETHOS',455};456export const R = {457 id: 'revain',458 name: 'Revain',459 symbol: 'R',460};461export const SKY = {462 id: 'skycoin',463 name: 'Skycoin',464 symbol: 'SKY',465};466export const DATA = {467 id: 'streamr-datacoin',468 name: 'Streamr DATAcoin',469 symbol: 'DATA',470};471export const SNGLS = {472 id: 'singulardtv',473 name: 'SingularDTV',474 symbol: 'SNGLS',475};476export const DRGN = {477 id: 'dragonchain',478 name: 'Dragonchain',479 symbol: 'DRGN',480};481export const BAY = {482 id: 'bitbay',483 name: 'BitBay',484 symbol: 'BAY',485};486export const LINK = {487 id: 'chainlink',488 name: 'ChainLink',489 symbol: 'LINK',490};491export const PPC = {492 id: 'peercoin',493 name: 'Peercoin',494 symbol: 'PPC',495};496export const FTC = {497 id: 'feathercoin',498 name: 'Feathercoin',499 symbol: 'FTC',500};501export const SBD = {502 id: 'steem-dollars',503 name: 'Steem Dollars',504 symbol: 'SBD*',505};506export const CRYPTO_MAP = {507 [BTC.symbol]: BTC,508 [ETH.symbol]: ETH,509 [BCH.symbol]: BCH,510 [LTC.symbol]: LTC,511 [MIOTA.symbol]: MIOTA,512 [XRP.symbol]: XRP,513 [DASH.symbol]: DASH,514 [XEM.symbol]: XEM,515 [XMR.symbol]: XMR,516 [BTG.symbol]: BTG,517 [ADA.symbol]: ADA,518 [EOS.symbol]: EOS,519 [ETC.symbol]: ETC,520 [XLM.symbol]: XLM,521 [NEO.symbol]: NEO,522 [BCC.symbol]: BCC,523 [PPT.symbol]: PPT,524 [WAVES.symbol]: WAVES,525 [OMG.symbol]: OMG,526 [LSK.symbol]: LSK,527 [QTUM.symbol]: QTUM,528 [ZEC.symbol]: ZEC,529 [STRAT.symbol]: STRAT,530 [ARDR.symbol]: ARDR,531 [USDT.symbol]: USDT,532 [MONA.symbol]: MONA,533 [NXT.symbol]: NXT,534 [HSR.symbol]: HSR,535 [BTS.symbol]: BTS,536 [BCN.symbol]: BCN,537 [TRX.symbol]: TRX,538 [STEEM.symbol]: STEEM,539 [SBD.symbol]: SBD,540 [VERI.symbol]: VERI,541 [ARK.symbol]: ARK,542 [SALT.symbol]: SALT,543 [DCR.symbol]: DCR,544 [REP.symbol]: REP,545 [DOGE.symbol]: DOGE,546 [KMD.symbol]: KMD,547 [VTC.symbol]: VTC,548 [EMC2.symbol]: EMC2,549 [SC.symbol]: SC,550 [GNT.symbol]: GNT,551 [PIVX.symbol]: PIVX,552 [BNB.symbol]: BNB,553 [DGD.symbol]: DGD,554 [MAID.symbol]: MAID,555 [SAN.symbol]: SAN,556 [XRB.symbol]: XRB,557 [BAT.symbol]: BAT,558 [PAY.symbol]: PAY,559 [SYS.symbol]: SYS,560 [FCT.symbol]: FCT,561 [SNT.symbol]: SNT,562 [CNX.symbol]: CNX,563 [QASH.symbol]: QASH,564 [POWR.symbol]: POWR,565 [BTCD.symbol]: BTCD,566 [MANA.symbol]: MANA,567 [MCO.symbol]: MCO,568 [GBYTE.symbol]: GBYTE,569 [WTC.symbol]: WTC,570 [KNC.symbol]: KNC,571 [BTM.symbol]: BTM,572 [XZC.symbol]: XZC,573 [GAS.symbol]: GAS,574 [GNO.symbol]: GNO,575 [VEN.symbol]: VEN,576 [AION.symbol]: AION,577 [ICN.symbol]: ICN,578 [DGB.symbol]: DGB,579 [AE.symbol]: AE,580 [FUN.symbol]: FUN,581 [GAME.symbol]: GAME,582 [RDN.symbol]: RDN,583 [NAV.symbol]: NAV,584 [PURA.symbol]: PURA,585 [BNT.symbol]: BNT,586 [NXS.symbol]: NXS,587 [XVG.symbol]: XVG,588 [CVC.symbol]: CVC,589 [ZRX.symbol]: ZRX,590 [EDG.symbol]: EDG,591 [MTL.symbol]: MTL,592 [REQ.symbol]: REQ,593 [BLOCK.symbol]: BLOCK,594 [RHOC.symbol]: RHOC,595 [STORJ.symbol]: STORJ,596 [GXS.symbol]: GXS,597 [ETP.symbol]: ETP,598 [ETHOS.symbol]: ETHOS,599 [R.symbol]: R,600 [SKY.symbol]: SKY,601 [DATA.symbol]: DATA,602 [SNGLS.symbol]: SNGLS,603 [DRGN.symbol]: DRGN,604 [BAY.symbol]: BAY,605 [LINK.symbol]: LINK,606 [PPC.symbol]: PPC,607 [FTC.symbol]: FTC,...
Symbol.js
Source:Symbol.js
...18 * @param {module:echarts/data/List} data19 * @param {number} idx20 * @extends {module:zrender/graphic/Group}21 */22 function Symbol(data, idx, seriesScope) {23 graphic.Group.call(this);24 this.updateData(data, idx, seriesScope);25 }26 var symbolProto = Symbol.prototype;27 function driftSymbol(dx, dy) {28 this.parent.drift(dx, dy);29 }30 symbolProto._createSymbol = function (symbolType, data, idx) {31 // Remove paths created before32 this.removeAll();33 var seriesModel = data.hostModel;34 var color = data.getItemVisual(idx, 'color');35 var symbolPath = symbolUtil.createSymbol(36 symbolType, -0.5, -0.5, 1, 1, color37 );38 symbolPath.attr({39 z2: 100,40 culling: true,41 scale: [0, 0]42 });43 // Rewrite drift method44 symbolPath.drift = driftSymbol;45 var size = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));46 graphic.initProps(symbolPath, {47 scale: size48 }, seriesModel, idx);49 this._symbolType = symbolType;50 this.add(symbolPath);51 };52 /**53 * Stop animation54 * @param {boolean} toLastFrame55 */56 symbolProto.stopSymbolAnimation = function (toLastFrame) {57 this.childAt(0).stopAnimation(toLastFrame);58 };59 /**60 * Get symbol path element61 */62 symbolProto.getSymbolPath = function () {63 return this.childAt(0);64 };65 /**66 * Get scale(aka, current symbol size).67 * Including the change caused by animation68 */69 symbolProto.getScale = function () {70 return this.childAt(0).scale;71 };72 /**73 * Highlight symbol74 */75 symbolProto.highlight = function () {76 this.childAt(0).trigger('emphasis');77 };78 /**79 * Downplay symbol80 */81 symbolProto.downplay = function () {82 this.childAt(0).trigger('normal');83 };84 /**85 * @param {number} zlevel86 * @param {number} z87 */88 symbolProto.setZ = function (zlevel, z) {89 var symbolPath = this.childAt(0);90 symbolPath.zlevel = zlevel;91 symbolPath.z = z;92 };93 symbolProto.setDraggable = function (draggable) {94 var symbolPath = this.childAt(0);95 symbolPath.draggable = draggable;96 symbolPath.cursor = draggable ? 'move' : 'pointer';97 };98 /**99 * Update symbol properties100 * @param {module:echarts/data/List} data101 * @param {number} idx102 */103 symbolProto.updateData = function (data, idx, seriesScope) {104 this.silent = false;105 var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';106 var seriesModel = data.hostModel;107 var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));108 if (symbolType !== this._symbolType) {109 this._createSymbol(symbolType, data, idx);110 }111 else {112 var symbolPath = this.childAt(0);113 graphic.updateProps(symbolPath, {114 scale: symbolSize115 }, seriesModel, idx);116 }117 this._updateCommon(data, idx, symbolSize, seriesScope);118 this._seriesModel = seriesModel;119 };120 // Update common properties121 var normalStyleAccessPath = ['itemStyle', 'normal'];122 var emphasisStyleAccessPath = ['itemStyle', 'emphasis'];123 var normalLabelAccessPath = ['label', 'normal'];...
matrix.ts
Source:matrix.ts
1import { KeyboardItem, KeyboardSettings } from './keyboard.model';2const matrixRuLower: Array<KeyboardItem[]> = [3 [4 { symbol: 'Ñ' }, { symbol: '1' }, { symbol: '2' }, { symbol: '3' }, { symbol: '4' }, { symbol: '5' },5 { symbol: '6' }, { symbol: '7' }, { symbol: '8' }, { symbol: '9' }, { symbol: '0' }, { symbol: '<-', action: 'backspace', size: 2 },6 ],7 [8 { symbol: 'й' }, { symbol: 'Ñ' }, { symbol: 'Ñ' }, { symbol: 'к' }, { symbol: 'е' }, { symbol: 'н' },9 { symbol: 'г' }, { symbol: 'Ñ' }, { symbol: 'Ñ' }, { symbol: 'з' }, { symbol: 'Ñ
' }, { symbol: 'EN', action: 'en', size: 2 }10 ],11 [12 { symbol: 'Ñ' }, { symbol: 'Ñ' }, { symbol: 'в' }, { symbol: 'а' }, { symbol: 'п' }, { symbol: 'Ñ' },13 { symbol: 'о' }, { symbol: 'л' }, { symbol: 'д' }, { symbol: 'ж' }, { symbol: 'Ñ' }, { symbol: 'ÐÐÐ', action: 'upper', size: 2 }14 ],15 [16 { symbol: 'Ñ' }, { symbol: 'Ñ' }, { symbol: 'Ñ' }, { symbol: 'м' }, { symbol: 'и' }, { symbol: 'Ñ' },17 { symbol: 'Ñ' }, { symbol: 'б' }, { symbol: 'Ñ' }, { symbol: 'Ñ' }, { symbol: '@' }, { symbol: '#+=', action: 'specSymbols', size: 2 }18 ],19 [20 { symbol: ' ', size: 13 }21 ]22];23const matrixRuUpper: Array<KeyboardItem[]> = [24 [25 { symbol: 'Ð' }, { symbol: '1' }, { symbol: '2' }, { symbol: '3' }, { symbol: '4' }, { symbol: '5' },26 { symbol: '6' }, { symbol: '7' }, { symbol: '8' }, { symbol: '9' }, { symbol: '0' }, { symbol: '<-', action: 'backspace', size: 2 }27 ],28 [29 { symbol: 'Ð' }, { symbol: 'Ц' }, { symbol: 'У' }, { symbol: 'Ð' }, { symbol: 'Ð' }, { symbol: 'Ð' },30 { symbol: 'Ð' }, { symbol: 'Ш' }, { symbol: 'Щ' }, { symbol: 'Ð' }, { symbol: 'Ð¥' }, { symbol: 'EN', action: 'en', size: 2 }31 ],32 [33 { symbol: 'Ф' }, { symbol: 'Ы' }, { symbol: 'Ð' }, { symbol: 'Ð' }, { symbol: 'Ð' }, { symbol: 'Ð ' },34 { symbol: 'Ð' }, { symbol: 'Ð' }, { symbol: 'Ð' }, { symbol: 'Ð' }, { symbol: 'Ð' }, { symbol: 'абв', action: 'lower', size: 2 }35 ],36 [37 { symbol: 'Я' }, { symbol: 'Ч' }, { symbol: 'С' }, { symbol: 'Ð' }, { symbol: 'Ð' }, { symbol: 'Т' },38 { symbol: 'Ь' }, { symbol: 'Ð' }, { symbol: 'Ю' }, { symbol: 'Ъ' }, { symbol: '@' }, { symbol: '#+=', action: 'specSymbols', size: 2 }39 ],40 [41 { symbol: ' ', size: 13 }42 ]43];44const matrixEnLower: Array<KeyboardItem[]> = [45 [46 { symbol: '1' }, { symbol: '2' }, { symbol: '3' }, { symbol: '4' }, { symbol: '5' },47 { symbol: '6' }, { symbol: '7' }, { symbol: '8' }, { symbol: '9' }, { symbol: '0' }, { symbol: '<-', action: 'backspace', size: 2 }48 ],49 [50 { symbol: 'q' }, { symbol: 'w' }, { symbol: 'e' }, { symbol: 'r' }, { symbol: 't' }, { symbol: 'y' },51 { symbol: 'u' }, { symbol: 'i' }, { symbol: 'o' }, { symbol: 'p' }, { symbol: 'RU', action: 'ru', size: 2 }52 ],53 [54 { symbol: 'a' }, { symbol: 's' }, { symbol: 'd' }, { symbol: 'f' }, { symbol: 'g' }, { symbol: 'h' },55 { symbol: 'j' }, { symbol: 'k' }, { symbol: 'l' }, { symbol: '@' }, { symbol: 'ABC', action: 'upper', size: 2 }56 ],57 [58 { symbol: 'z' }, { symbol: 'x' }, { symbol: 'c' }, { symbol: 'v' }, { symbol: 'b' }, { symbol: 'n' },59 { symbol: 'm' }, { symbol: '-' }, { symbol: '_' }, { symbol: '.' }, { symbol: '#+=', action: 'specSymbols', size: 2 }60 ],61 [62 { symbol: ' ', size: 13 }63 ]64];65const matrixEnUpper: Array<KeyboardItem[]> = [66 [67 { symbol: '1' }, { symbol: '2' }, { symbol: '3' }, { symbol: '4' }, { symbol: '5' },68 { symbol: '6' }, { symbol: '7' }, { symbol: '8' }, { symbol: '9' }, { symbol: '0' }, { symbol: '<-', action: 'backspace', size: 2 }69 ],70 [71 { symbol: 'Q' }, { symbol: 'W' }, { symbol: 'E' }, { symbol: 'R' }, { symbol: 'T' }, { symbol: 'Y' },72 { symbol: 'U' }, { symbol: 'I' }, { symbol: 'O' }, { symbol: 'P' }, { symbol: 'RU', action: 'ru', size: 2 }73 ],74 [75 { symbol: 'A' }, { symbol: 'S' }, { symbol: 'D' }, { symbol: 'F' }, { symbol: 'G' }, { symbol: 'H' },76 { symbol: 'J' }, { symbol: 'K' }, { symbol: 'L' }, { symbol: '@' }, { symbol: 'abc', action: 'lower', size: 2 }77 ],78 [79 { symbol: 'Z' }, { symbol: 'X' }, { symbol: 'C' }, { symbol: 'V' }, { symbol: 'B' }, { symbol: 'N' },80 { symbol: 'M' }, { symbol: '-' }, { symbol: '_' }, { symbol: '.' }, { symbol: '#+=', action: 'specSymbols', size: 2 }81 ],82 [83 { symbol: ' ', size: 13 }84 ]85];86const matrixSpecSymbols: Array<KeyboardItem[]> = [87 [88 { symbol: '!' }, { symbol: '#' }, { symbol: '$' }, { symbol: '%' }, { symbol: '&' }, { symbol: "'" }, { symbol: '*' }, { symbol: '+' }, { symbol: '<-', action: 'backspace', size: 2 }89 ],90 [91 { symbol: '-' }, { symbol: '/' }, { symbol: '=' }, { symbol: '?' }, { symbol: '^' }, { symbol: '_' }, { symbol: '`' }, { symbol: '{' }, { symbol: 'RU', action: 'ru', size: 2 }92 ],93 [94 { symbol: '|' }, { symbol: '}' }, { symbol: '~' }, { symbol: '"' }, { symbol: '(' }, { symbol: ')' }, { symbol: ',' }, { symbol: '.' }, { symbol: 'abc', action: 'lower', size: 2 }95 ],96 [97 { symbol: ':' }, { symbol: ';' }, { symbol: '<' }, { symbol: '>' }, { symbol: '@' }, { symbol: '[' }, { symbol: '\\' }, { symbol: ']' }, { symbol: '#+=', action: 'specSymbols', size: 2 }98 ],99 [100 { symbol: ' ', size: 13 }101 ]102];103const emails: KeyboardItem[] = [104 { symbol: '@gmail.com', size: 4 },105 { symbol: '@mail.ru', size: 4 },106 { symbol: '@yandex.ru', size: 4 },107 { symbol: '@persik.by', size: 4 }108];109export function getKeyboardLayout(settings: KeyboardSettings) {110 switch (settings.lang) {111 case 'ru':112 if (settings.isUpper) {113 if (settings.needEmail) {114 return addEmails(matrixRuUpper);115 }116 return matrixRuUpper;117 }118 if (settings.needEmail) {119 return addEmails(matrixRuLower);120 }121 return matrixRuLower;122 case 'en':123 if (settings.isUpper) {124 if (settings.needEmail) {125 return addEmails(matrixEnUpper);126 }127 return matrixEnUpper;128 }129 if (settings.needEmail) {130 return addEmails(matrixEnLower);131 }132 return matrixEnLower;133 case 'specSymbols':134 return matrixSpecSymbols;135 default:136 break;137 }138}139function addEmails(layout: Array<KeyboardItem[]>) {140 const keyboardMatrix = JSON.parse(JSON.stringify(layout));141 keyboardMatrix.forEach((row, index) => {142 if (emails[index]) {143 row.push(emails[index]);144 }145 });146 return keyboardMatrix;...
Emoji.js
Source:Emoji.js
1export const emojis = [2 { symbol: "ð" },3 { symbol: "ð" },4 { symbol: "ð" },5 { symbol: "ð" },6 { symbol: "ð" },7 { symbol: "ð
" },8 { symbol: "ð¤£" },9 { symbol: "ð" },10 { symbol: "ð" },11 { symbol: "ð" },12 { symbol: "ð" },13 { symbol: "ð" },14 { symbol: "ð" },15 { symbol: "ð¥°" },16 { symbol: "ð" },17 { symbol: "ð¤©" },18 { symbol: "ð" },19 { symbol: "ð" },20 { symbol: "ð" },21 { symbol: "ð" },22 { symbol: "ð" },23 { symbol: "ð" },24 { symbol: "ð" },25 { symbol: "ð¤ª" },26 { symbol: "ð" },27 { symbol: "ð¤" },28 { symbol: "ð¤" },29 { symbol: "ð¤" },30 { symbol: "ð¤«" },31 { symbol: "ð¤" },32 { symbol: "ð¤" },33 { symbol: "ð¤¨" },34 { symbol: "ð" },35 { symbol: "ð" },36 { symbol: "ð¶" },37 { symbol: "ð" },38 { symbol: "ð" },39 { symbol: "ð" },40 { symbol: "ð¬" },41 { symbol: "ð¤¥" },42 { symbol: "ð" },43 { symbol: "ð" },44 { symbol: "ðª" },45 { symbol: "ð¤¤" },46 { symbol: "ð´" },47 { symbol: "ð·" },48 { symbol: "ð¤" },49 { symbol: "ð¤" },50 { symbol: "ð¤¢" },51 { symbol: "ð¤®" },52 { symbol: "ð¤§" },53 { symbol: "ð¥µ" },54 { symbol: "ð¥¶" },55 { symbol: "ð¥´" },56 { symbol: "ðµ" },57 { symbol: "ð¤¯" },58 { symbol: "ð¤ " },59 { symbol: "ð¥³" },60 { symbol: "ð" },61 { symbol: "ð¤" },62 { symbol: "ð§" },63 { symbol: "ð" },64 { symbol: "ð" },65 { symbol: "ð" },66 { symbol: "ð®" },67 { symbol: "ð¯" },68 { symbol: "ð²" },69 { symbol: "ð³" },70 { symbol: "ð¥º" },71 { symbol: "ð¦" },72 { symbol: "ð§" },73 { symbol: "ð¨" },74 { symbol: "ð°" },75 { symbol: "ð¥" },76 { symbol: "ð¢" },77 { symbol: "ð" },78 { symbol: "ð±" },79 { symbol: "ð" },80 { symbol: "ð£" },81 { symbol: "ð" },82 { symbol: "ð" },83 { symbol: "ð©" },84 { symbol: "ð«" },85 { symbol: "ð¤" },86 { symbol: "ð¡" },87 { symbol: "ð " },88 { symbol: "ð¤¬" },89 { symbol: "ð" },90 { symbol: "ð¿" },...
Using AI Code Generation
1var sinon = require('sinon');2var myObject = {3 myMethod: function() {4 console.log('myMethod called');5 }6};7var spy = sinon.spy(myObject, 'myMethod');8myObject.myMethod();9spy.restore();10myObject.myMethod();11var proxyquire = require('proxyquire').noCallThru();12var sinon = require('sinon');13var stub = sinon.stub().returns('stubbed');14var myObject = proxyquire('./myObject', {15});16var td = require('testdouble');17var myObject = require('./myObject');18var stub = td.function();19td.replace('./myDependency', stub);20myObject.myMethod();21td.reset();22myObject.myMethod();23var sinon = require('sinon');24var myObject = {25 myMethod: function() {26 console.log('myMethod called');27 }28};29var sandbox = sinon.sandbox.create();30var spy = sandbox.spy(myObject, 'myMethod');31myObject.myMethod();32sandbox.restore();33myObject.myMethod();34var sinon = require('sinon');35var clock = sinon.useFakeTimers();36setTimeout(function() {37 console.log('timeout called');38}, 1000);39clock.tick(500);40clock.tick(500);41clock.restore();42var sinon = require('sinon');43var xhr = sinon.useFakeXMLHttpRequest();44var requests = [];45xhr.onCreate = function(req) {46 requests.push(req);47};48var xhr = new XMLHttpRequest();49xhr.open('GET', '/resource');50xhr.send();51xhr.restore();52var sinon = require('sinon');53var server = sinon.fakeServer.create();54server.respondWith('GET', '/resource',
Using AI Code Generation
1var sinon = require('sinon');2var assert = require('assert');3var myObject = {4 myMethod: function () {5 return 'Hello World';6 }7};8var myObject2 = {9 myMethod: function () {10 return 'Hello World';11 }12};13var sinon = require('sinon');14var assert = require('assert');15var myObject = {16 myMethod: function () {17 return 'Hello World';18 }19};20var myObject2 = {21 myMethod: function () {22 return 'Hello World';23 }24};25var sinon = require('sinon');26var assert = require('assert');27var myObject = {28 myMethod: function () {29 return 'Hello World';30 }31};
Using AI Code Generation
1const sinon = require('sinon');2const myObj = {3};4const symbol = Symbol('foo');5myObj[symbol] = 'baz';6sinon.spy(myObj, symbol);7myObj[symbol] = 'quux';8const sinon = require('sinon');9const myObj = {10};11const symbol = Symbol('foo');12myObj[symbol] = 'baz';13sinon.spy(myObj, symbol);14myObj[symbol] = 'quux';15const sinon = require('sinon');16const myObj = {17};18const symbol = Symbol('foo');19myObj[symbol] = 'baz';20sinon.spy(myObj, symbol);21myObj[symbol] = 'quux';22const sinon = require('sinon');23const myObj = {24};25const symbol = Symbol('foo');26myObj[symbol] = 'baz';27sinon.spy(myObj, symbol);
Using AI Code Generation
1var sinon = require('sinon');2var assert = require('assert');3var myObject = require('./myObject');4describe('myObject', function() {5 it('should call the callback', function() {6 var callback = sinon.spy();7 myObject.myMethod(callback);8 assert(callback.called);9 });10});11module.exports.myMethod = function(callback) {12 callback();13}14module.exports = function() {15 return new Promise(function(resolve, reject) {16 var response = {17 };18 resolve(response);19 });20}21describe('test', function() {22 it('should return a promise', function() {23 var promise = test();24 expect(promise).to.be.a('promise');25 });26});27module.exports = function() {28 return new Promise(function(resolve, reject) {29 var response = {30 };31 resolve(response);32 });33}34describe('test', function() {35 it('should return a promise', function() {36 var promise = test();37 expect(promise
Using AI Code Generation
1 var sinon = require('sinon');2 var stub = sinon.stub(obj, 'someMethod');3 stub.withArgs(42).returns('hello');4 stub.withArgs('foo').throws();5 stub.withArgs('bar').yieldsTo('success');6 stub.withArgs('baz').yieldsTo('error');7 stub.withArgs('quux').yields([1, 2, 3]);8 stub.withArgs('quuux').yieldsOn(obj, 'foo', 'bar');9 stub.withArgs('quuuux').callsArg(1);10 stub.withArgs('quuuuux').callsArgOn(1, obj, 'foo', 'bar');11 stub.withArgs('quuuuuux').callsArgWith(1, 'foo', 'bar');12 stub.withArgs('quuuuuuux').callsArgOnWith(1, obj, 'foo', 'bar', 'baz');13 stub.withArgs('quuuuuuuux').returnsArg(1);14 stub.withArgs('quuuuuuuuux').returnsThis();15 stub.withArgs('quuuuuuuuuux').callsFake(function () {16 return 'hello';17 });18 stub.withArgs('quuuuuuuuuuux').throwsArg(1);19 stub.withArgs('quuuuuuuuuuuux').throwsArgOn(1, obj);20 stub.withArgs('quuuuuuuuuuuuux').throwsArgOnWith(1, obj, 'foo');21 stub.withArgs('quuuuuuuuuuuuuux').throwsException('foo');22 stub.withArgs('quuuuuuuuuuuuuuux').throwsException(new Error('foo'));23 stub.withArgs('quuuuuuuuuuuuuuuux').throwsException(new TypeError('foo'));24 stub.withArgs('quuuuuuuuuuuuuuuuux').throwsException(new TypeError('foo'), 'bar');25 stub.withArgs('quuuuuuuuuuuuuuuuuux').returnsThis();26 stub.withArgs('quuuuuuuuuuuuuuuuuuux').returnsThis();27 stub.withArgs('quuuuuuuuuuuuuuuuuuuux').returnsThis();28 stub.withArgs('quuuuuuuuuuuuuuuuuuuuux').returnsThis();29 stub.withArgs('quuuuuuuuuuuuuuuuuuu
Using AI Code Generation
1const sinon = require('sinon');2const assert = require('chai').assert;3const expect = require('chai').expect;4const myModule = require('myModule');5describe('myModule', function(){6 it('should call the callback', function(){7 let callback = sinon.spy();8 myModule(callback);9 assert(callback.called);10 });11});12module.exports = function(callback){13 callback();14};15const sinon = require('sinon');16const assert = require('chai').assert;17const expect = require('chai').expect;18const myModule = require('myModule');19describe('myModule', function(){20 it('should call the callback', function(){21 let callback = sinon.spy();22 myModule(callback);23 assert(callback.called);24 });25});26module.exports = function(callback){27 callback();28};29const sinon = require('sinon');30const assert = require('chai').assert;31const expect = require('chai').expect;32const myModule = require('myModule');33describe('myModule', function(){34 it('should call the callback', function(){35 let callback = sinon.spy();36 myModule(callback);37 assert(callback.called);38 });39});40module.exports = function(callback){41 callback();42};43const sinon = require('sinon');44const assert = require('chai').assert;45const expect = require('chai').expect;46const myModule = require('myModule');47describe('myModule', function(){48 it('should call the callback', function(){49 let callback = sinon.spy();50 myModule(callback);51 assert(callback.called);52 });53});54module.exports = function(callback){55 callback();56};
Using AI Code Generation
1import sinon from 'sinon';2import {assert} from 'chai';3import {someFunction} from './test';4describe('Test', () => {5 it('should call someFunction', () => {6 const spy = sinon.spy(someFunction);7 spy('test');8 assert(spy.calledWith('test'));9 });10});11export function someFunction(param) {12 return param;13}14function foo() {15 return 'foo';16}17module.exports = {18};19var sinon = require('sinon');20var module = require('./module');21describe('module', function() {22 it('should stub foo', function() {23 var stub = sinon.stub(module, 'foo');24 stub.returns('bar');25 expect(module.foo()).toEqual('bar');26 stub.restore();27 });28});29at Object.<anonymous> (test.js:8:21)30at Module._compile (module.js:456:26)31at Object.Module._extensions..js (module.js:474:10)32at Module.load (module.js:356:32)33at Function.Module._load (module.js:312:12)34at Module.runMain (module.js:497:10)35at process.startup.processNextTick.process._tickCallback (node.js:244:9)36var foo = function () {37 return 'foo';38}39module.exports = {40};41var sinon = require('sinon');42var module = require('./module');43describe('
Using AI Code Generation
1const sinon = require('sinon');2const assert = require('assert');3const { stub } = sinon;4const stub1 = stub().returns(42);5const stub2 = stub().returns(42);6assert(stub1() === 42);7assert(stub2() === 42);8assert(stub1.calledOnce);9assert(stub2.calledOnce);10assert(stub1() === 42);11assert(stub2() === 42);12assert(stub1.calledOnce);13assert(stub2.calledOnce);14assert(stub1() === 42);15assert(stub2() === 42);16assert(stub1.calledOnce);17assert(stub2.calledOnce);18assert(stub1() === 42);19assert(stub2() === 42);20assert(stub1.calledOnce);21assert(stub2.calledOnce);22assert(stub1() === 42);23assert(stub2() === 42);24assert(stub1.calledOnce);25assert(stub2.calledOnce);26assert(stub1() === 42);27assert(stub2() === 42);28assert(stub1.calledOnce);29assert(stub2.calledOnce);30assert(stub1() === 42);31assert(stub2() === 42);32assert(stub1.calledOnce);33assert(stub2.calledOnce);34assert(stub1() === 42);35assert(stub2() === 42);36assert(stub1.calledOnce);37assert(stub2.calledOnce);38assert(stub1() === 42);39assert(stub2() === 42);40assert(stub1.calledOnce);41assert(stub2.calledOnce);42assert(stub1() === 42);43assert(stub2() === 42);44assert(stub1.calledOnce);45assert(stub2.calledOnce);46assert(stub1() === 42);47assert(stub2() === 42);48assert(stub1.calledOnce);49assert(stub2.calledOnce);50assert(stub1() === 42);
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!