How to use slug method in Best

Best JavaScript code snippet using best

realms.ts

Source:realms.ts Github

copy

Full Screen

1// via https://theunderminejournal.com/#us and https://theunderminejournal.com/#eu respectively2export const realms = [3 { slug: "aegwynn", name: "Aegwynn", region: "eu" },4 { slug: "aerie-peak", name: "Aerie Peak", region: "eu" },5 { slug: "agamaggan", name: "Agamaggan", region: "eu" },6 { slug: "aggra-portugu%C3%AAs", name: "Aggra (Português)", region: "eu" },7 { slug: "aggramar", name: "Aggramar", region: "eu" },8 { slug: "ahnqiraj", name: "Ahn'Qiraj", region: "eu" },9 { slug: "alakir", name: "Al'Akir", region: "eu" },10 { slug: "alexstrasza", name: "Alexstrasza", region: "eu" },11 { slug: "alleria", name: "Alleria", region: "eu" },12 { slug: "alonsus", name: "Alonsus", region: "eu" },13 { slug: "amanthul", name: "Aman'Thul", region: "eu" },14 { slug: "ambossar", name: "Ambossar", region: "eu" },15 { slug: "anachronos", name: "Anachronos", region: "eu" },16 { slug: "anetheron", name: "Anetheron", region: "eu" },17 { slug: "antonidas", name: "Antonidas", region: "eu" },18 { slug: "anubarak", name: "Anub'arak", region: "eu" },19 { slug: "arakarahm", name: "Arak-arahm", region: "eu" },20 { slug: "arathi", name: "Arathi", region: "eu" },21 { slug: "arathor", name: "Arathor", region: "eu" },22 { slug: "archimonde", name: "Archimonde", region: "eu" },23 { slug: "area-52", name: "Area 52", region: "eu" },24 { slug: "argent-dawn", name: "Argent Dawn", region: "eu" },25 { slug: "arthas", name: "Arthas", region: "eu" },26 { slug: "arygos", name: "Arygos", region: "eu" },27 { slug: "ashenvale", name: "Ashenvale", region: "eu" },28 { slug: "aszune", name: "Aszune", region: "eu" },29 { slug: "auchindoun", name: "Auchindoun", region: "eu" },30 { slug: "azjolnerub", name: "Azjol-Nerub", region: "eu" },31 { slug: "azshara", name: "Azshara", region: "eu" },32 { slug: "azuregos", name: "Azuregos", region: "eu" },33 { slug: "azuremyst", name: "Azuremyst", region: "eu" },34 { slug: "baelgun", name: "Baelgun", region: "eu" },35 { slug: "balnazzar", name: "Balnazzar", region: "eu" },36 { slug: "blackhand", name: "Blackhand", region: "eu" },37 { slug: "blackmoore", name: "Blackmoore", region: "eu" },38 { slug: "blackrock", name: "Blackrock", region: "eu" },39 { slug: "blackscar", name: "Blackscar", region: "eu" },40 { slug: "blades-edge", name: "Blade's Edge", region: "eu" },41 { slug: "bladefist", name: "Bladefist", region: "eu" },42 { slug: "bloodfeather", name: "Bloodfeather", region: "eu" },43 { slug: "bloodhoof", name: "Bloodhoof", region: "eu" },44 { slug: "bloodscalp", name: "Bloodscalp", region: "eu" },45 { slug: "blutkessel", name: "Blutkessel", region: "eu" },46 { slug: "booty-bay", name: "Booty Bay", region: "eu" },47 { slug: "borean-tundra", name: "Borean Tundra", region: "eu" },48 { slug: "boulderfist", name: "Boulderfist", region: "eu" },49 { slug: "bronze-dragonflight", name: "Bronze Dragonflight", region: "eu" },50 { slug: "bronzebeard", name: "Bronzebeard", region: "eu" },51 { slug: "burning-blade", name: "Burning Blade", region: "eu" },52 { slug: "burning-legion", name: "Burning Legion", region: "eu" },53 { slug: "burning-steppes", name: "Burning Steppes", region: "eu" },54 { slug: "cthun", name: "C'Thun", region: "eu" },55 { slug: "chamber-of-aspects", name: "Chamber of Aspects", region: "eu" },56 { slug: "chants-%C3%A9ternels", name: "Chants éternels", region: "eu" },57 { slug: "chogall", name: "Cho'gall", region: "eu" },58 { slug: "chromaggus", name: "Chromaggus", region: "eu" },59 { slug: "colinas-pardas", name: "Colinas Pardas", region: "eu" },60 {61 slug: "confr%C3%A9rie-du-thorium",62 name: "Confrérie du Thorium",63 region: "eu",64 },65 { slug: "conseil-des-ombres", name: "Conseil des Ombres", region: "eu" },66 { slug: "crushridge", name: "Crushridge", region: "eu" },67 {68 slug: "culte-de-la-rive-noire",69 name: "Culte de la Rive noire",70 region: "eu",71 },72 { slug: "daggerspine", name: "Daggerspine", region: "eu" },73 { slug: "dalaran", name: "Dalaran", region: "eu" },74 { slug: "dalvengyr", name: "Dalvengyr", region: "eu" },75 { slug: "darkmoon-faire", name: "Darkmoon Faire", region: "eu" },76 { slug: "darksorrow", name: "Darksorrow", region: "eu" },77 { slug: "darkspear", name: "Darkspear", region: "eu" },78 { slug: "das-konsortium", name: "Das Konsortium", region: "eu" },79 { slug: "das-syndikat", name: "Das Syndikat", region: "eu" },80 { slug: "deathguard", name: "Deathguard", region: "eu" },81 { slug: "deathweaver", name: "Deathweaver", region: "eu" },82 { slug: "deathwing", name: "Deathwing", region: "eu" },83 { slug: "deepholm", name: "Deepholm", region: "eu" },84 { slug: "defias-brotherhood", name: "Defias Brotherhood", region: "eu" },85 { slug: "dentarg", name: "Dentarg", region: "eu" },86 { slug: "der-abyssische-rat", name: "Der abyssische Rat", region: "eu" },87 { slug: "der-mithrilorden", name: "Der Mithrilorden", region: "eu" },88 { slug: "der-rat-von-dalaran", name: "Der Rat von Dalaran", region: "eu" },89 { slug: "destromath", name: "Destromath", region: "eu" },90 { slug: "dethecus", name: "Dethecus", region: "eu" },91 { slug: "die-aldor", name: "Die Aldor", region: "eu" },92 { slug: "die-arguswacht", name: "Die Arguswacht", region: "eu" },93 { slug: "die-ewige-wacht", name: "Die ewige Wacht", region: "eu" },94 { slug: "die-nachtwache", name: "Die Nachtwache", region: "eu" },95 { slug: "die-silberne-hand", name: "Die Silberne Hand", region: "eu" },96 { slug: "die-todeskrallen", name: "Die Todeskrallen", region: "eu" },97 { slug: "doomhammer", name: "Doomhammer", region: "eu" },98 { slug: "draenor", name: "Draenor", region: "eu" },99 { slug: "dragonblight", name: "Dragonblight", region: "eu" },100 { slug: "dragonmaw", name: "Dragonmaw", region: "eu" },101 { slug: "drakthul", name: "Drak'thul", region: "eu" },102 { slug: "drekthar", name: "Drek'Thar", region: "eu" },103 { slug: "dun-modr", name: "Dun Modr", region: "eu" },104 { slug: "dun-morogh", name: "Dun Morogh", region: "eu" },105 { slug: "dunemaul", name: "Dunemaul", region: "eu" },106 { slug: "durotan", name: "Durotan", region: "eu" },107 { slug: "earthen-ring", name: "Earthen Ring", region: "eu" },108 { slug: "echsenkessel", name: "Echsenkessel", region: "eu" },109 { slug: "eitrigg", name: "Eitrigg", region: "eu" },110 { slug: "eldrethalas", name: "Eldre'Thalas", region: "eu" },111 { slug: "elune", name: "Elune", region: "eu" },112 { slug: "emerald-dream", name: "Emerald Dream", region: "eu" },113 { slug: "emeriss", name: "Emeriss", region: "eu" },114 { slug: "eonar", name: "Eonar", region: "eu" },115 { slug: "eredar", name: "Eredar", region: "eu" },116 { slug: "eversong", name: "Eversong", region: "eu" },117 { slug: "executus", name: "Executus", region: "eu" },118 { slug: "exodar", name: "Exodar", region: "eu" },119 {120 slug: "festung-der-st%C3%BCrme",121 name: "Festung der Stürme",122 region: "eu",123 },124 { slug: "fordragon", name: "Fordragon", region: "eu" },125 { slug: "forscherliga", name: "Forscherliga", region: "eu" },126 { slug: "frostmane", name: "Frostmane", region: "eu" },127 { slug: "frostmourne", name: "Frostmourne", region: "eu" },128 { slug: "frostwhisper", name: "Frostwhisper", region: "eu" },129 { slug: "frostwolf", name: "Frostwolf", region: "eu" },130 { slug: "galakrond", name: "Galakrond", region: "eu" },131 { slug: "garona", name: "Garona", region: "eu" },132 { slug: "garrosh", name: "Garrosh", region: "eu" },133 { slug: "genjuros", name: "Genjuros", region: "eu" },134 { slug: "ghostlands", name: "Ghostlands", region: "eu" },135 { slug: "gilneas", name: "Gilneas", region: "eu" },136 { slug: "goldrinn", name: "Goldrinn", region: "eu" },137 { slug: "gordunni", name: "Gordunni", region: "eu" },138 { slug: "gorgonnash", name: "Gorgonnash", region: "eu" },139 { slug: "greymane", name: "Greymane", region: "eu" },140 { slug: "grim-batol", name: "Grim Batol", region: "eu" },141 { slug: "grom", name: "Grom", region: "eu" },142 { slug: "guldan", name: "Gul'dan", region: "eu" },143 { slug: "hakkar", name: "Hakkar", region: "eu" },144 { slug: "haomarush", name: "Haomarush", region: "eu" },145 { slug: "hellfire", name: "Hellfire", region: "eu" },146 { slug: "hellscream", name: "Hellscream", region: "eu" },147 { slug: "howling-fjord", name: "Howling Fjord", region: "eu" },148 { slug: "hyjal", name: "Hyjal", region: "eu" },149 { slug: "illidan", name: "Illidan", region: "eu" },150 { slug: "jaedenar", name: "Jaedenar", region: "eu" },151 { slug: "kaelthas", name: "Kael'thas", region: "eu" },152 { slug: "karazhan", name: "Karazhan", region: "eu" },153 { slug: "kargath", name: "Kargath", region: "eu" },154 { slug: "kazzak", name: "Kazzak", region: "eu" },155 { slug: "kelthuzad", name: "Kel'Thuzad", region: "eu" },156 { slug: "khadgar", name: "Khadgar", region: "eu" },157 { slug: "khaz-modan", name: "Khaz Modan", region: "eu" },158 { slug: "khazgoroth", name: "Khaz'goroth", region: "eu" },159 { slug: "kiljaeden", name: "Kil'jaeden", region: "eu" },160 { slug: "kilrogg", name: "Kilrogg", region: "eu" },161 { slug: "kirin-tor", name: "Kirin Tor", region: "eu" },162 { slug: "korgall", name: "Kor'gall", region: "eu" },163 { slug: "kragjin", name: "Krag'jin", region: "eu" },164 { slug: "krasus", name: "Krasus", region: "eu" },165 { slug: "kul-tiras", name: "Kul Tiras", region: "eu" },166 { slug: "kult-der-verdammten", name: "Kult der Verdammten", region: "eu" },167 {168 slug: "la-croisade-%C3%A9carlate",169 name: "La Croisade écarlate",170 region: "eu",171 },172 { slug: "laughing-skull", name: "Laughing Skull", region: "eu" },173 { slug: "les-clairvoyants", name: "Les Clairvoyants", region: "eu" },174 { slug: "les-sentinelles", name: "Les Sentinelles", region: "eu" },175 { slug: "lich-king", name: "Lich King", region: "eu" },176 { slug: "lightbringer", name: "Lightbringer", region: "eu" },177 { slug: "lightnings-blade", name: "Lightning's Blade", region: "eu" },178 { slug: "lordaeron", name: "Lordaeron", region: "eu" },179 { slug: "los-errantes", name: "Los Errantes", region: "eu" },180 { slug: "lothar", name: "Lothar", region: "eu" },181 { slug: "madmortem", name: "Madmortem", region: "eu" },182 { slug: "magtheridon", name: "Magtheridon", region: "eu" },183 { slug: "malganis", name: "Mal'Ganis", region: "eu" },184 { slug: "malfurion", name: "Malfurion", region: "eu" },185 { slug: "malorne", name: "Malorne", region: "eu" },186 { slug: "malygos", name: "Malygos", region: "eu" },187 { slug: "mannoroth", name: "Mannoroth", region: "eu" },188 {189 slug: "mar%C3%A9cage-de-zangar",190 name: "Marécage de Zangar",191 region: "eu",192 },193 { slug: "mazrigos", name: "Mazrigos", region: "eu" },194 { slug: "medivh", name: "Medivh", region: "eu" },195 { slug: "minahonda", name: "Minahonda", region: "eu" },196 { slug: "moonglade", name: "Moonglade", region: "eu" },197 { slug: "mugthol", name: "Mug'thol", region: "eu" },198 { slug: "nagrand", name: "Nagrand", region: "eu" },199 { slug: "nathrezim", name: "Nathrezim", region: "eu" },200 { slug: "naxxramas", name: "Naxxramas", region: "eu" },201 { slug: "nazjatar", name: "Nazjatar", region: "eu" },202 { slug: "nefarian", name: "Nefarian", region: "eu" },203 { slug: "nemesis", name: "Nemesis", region: "eu" },204 { slug: "neptulon", name: "Neptulon", region: "eu" },205 { slug: "nerzhul", name: "Ner'zhul", region: "eu" },206 { slug: "nerathor", name: "Nera'thor", region: "eu" },207 { slug: "nethersturm", name: "Nethersturm", region: "eu" },208 { slug: "nordrassil", name: "Nordrassil", region: "eu" },209 { slug: "norgannon", name: "Norgannon", region: "eu" },210 { slug: "nozdormu", name: "Nozdormu", region: "eu" },211 { slug: "onyxia", name: "Onyxia", region: "eu" },212 { slug: "outland", name: "Outland", region: "eu" },213 { slug: "perenolde", name: "Perenolde", region: "eu" },214 {215 slug: "pozzo-delleternit%C3%A0",216 name: "Pozzo dell'Eternità",217 region: "eu",218 },219 { slug: "proudmoore", name: "Proudmoore", region: "eu" },220 { slug: "quelthalas", name: "Quel'Thalas", region: "eu" },221 { slug: "ragnaros", name: "Ragnaros", region: "eu" },222 { slug: "rajaxx", name: "Rajaxx", region: "eu" },223 { slug: "rashgarroth", name: "Rashgarroth", region: "eu" },224 { slug: "ravencrest", name: "Ravencrest", region: "eu" },225 { slug: "ravenholdt", name: "Ravenholdt", region: "eu" },226 { slug: "razuvious", name: "Razuvious", region: "eu" },227 { slug: "rexxar", name: "Rexxar", region: "eu" },228 { slug: "runetotem", name: "Runetotem", region: "eu" },229 { slug: "sanguino", name: "Sanguino", region: "eu" },230 { slug: "sargeras", name: "Sargeras", region: "eu" },231 { slug: "saurfang", name: "Saurfang", region: "eu" },232 { slug: "scarshield-legion", name: "Scarshield Legion", region: "eu" },233 { slug: "senjin", name: "Sen'jin", region: "eu" },234 { slug: "shadowsong", name: "Shadowsong", region: "eu" },235 { slug: "shattered-halls", name: "Shattered Halls", region: "eu" },236 { slug: "shattered-hand", name: "Shattered Hand", region: "eu" },237 { slug: "shattrath", name: "Shattrath", region: "eu" },238 { slug: "shendralar", name: "Shen'dralar", region: "eu" },239 { slug: "silvermoon", name: "Silvermoon", region: "eu" },240 { slug: "sinstralis", name: "Sinstralis", region: "eu" },241 { slug: "skullcrusher", name: "Skullcrusher", region: "eu" },242 { slug: "soulflayer", name: "Soulflayer", region: "eu" },243 { slug: "spinebreaker", name: "Spinebreaker", region: "eu" },244 { slug: "sporeggar", name: "Sporeggar", region: "eu" },245 { slug: "steamwheedle-cartel", name: "Steamwheedle Cartel", region: "eu" },246 { slug: "stormrage", name: "Stormrage", region: "eu" },247 { slug: "stormreaver", name: "Stormreaver", region: "eu" },248 { slug: "stormscale", name: "Stormscale", region: "eu" },249 { slug: "sunstrider", name: "Sunstrider", region: "eu" },250 { slug: "suramar", name: "Suramar", region: "eu" },251 { slug: "sylvanas", name: "Sylvanas", region: "eu" },252 { slug: "taerar", name: "Taerar", region: "eu" },253 { slug: "talnivarr", name: "Talnivarr", region: "eu" },254 { slug: "tarren-mill", name: "Tarren Mill", region: "eu" },255 { slug: "teldrassil", name: "Teldrassil", region: "eu" },256 { slug: "temple-noir", name: "Temple noir", region: "eu" },257 { slug: "terenas", name: "Terenas", region: "eu" },258 { slug: "terokkar", name: "Terokkar", region: "eu" },259 { slug: "terrordar", name: "Terrordar", region: "eu" },260 { slug: "the-maelstrom", name: "The Maelstrom", region: "eu" },261 { slug: "the-shatar", name: "The Sha'tar", region: "eu" },262 { slug: "the-venture-co", name: "The Venture Co", region: "eu" },263 { slug: "theradras", name: "Theradras", region: "eu" },264 { slug: "thermaplugg", name: "Thermaplugg", region: "eu" },265 { slug: "thrall", name: "Thrall", region: "eu" },266 { slug: "throkferoth", name: "Throk'Feroth", region: "eu" },267 { slug: "thunderhorn", name: "Thunderhorn", region: "eu" },268 { slug: "tichondrius", name: "Tichondrius", region: "eu" },269 { slug: "tirion", name: "Tirion", region: "eu" },270 { slug: "todeswache", name: "Todeswache", region: "eu" },271 { slug: "trollbane", name: "Trollbane", region: "eu" },272 { slug: "turalyon", name: "Turalyon", region: "eu" },273 { slug: "twilights-hammer", name: "Twilight's Hammer", region: "eu" },274 { slug: "twisting-nether", name: "Twisting Nether", region: "eu" },275 { slug: "tyrande", name: "Tyrande", region: "eu" },276 { slug: "uldaman", name: "Uldaman", region: "eu" },277 { slug: "ulduar", name: "Ulduar", region: "eu" },278 { slug: "uldum", name: "Uldum", region: "eu" },279 { slug: "ungoro", name: "Un'Goro", region: "eu" },280 { slug: "varimathras", name: "Varimathras", region: "eu" },281 { slug: "vashj", name: "Vashj", region: "eu" },282 { slug: "veklor", name: "Vek'lor", region: "eu" },283 { slug: "veknilash", name: "Vek'nilash", region: "eu" },284 { slug: "voljin", name: "Vol'jin", region: "eu" },285 { slug: "wildhammer", name: "Wildhammer", region: "eu" },286 { slug: "wrathbringer", name: "Wrathbringer", region: "eu" },287 { slug: "xavius", name: "Xavius", region: "eu" },288 { slug: "ysera", name: "Ysera", region: "eu" },289 { slug: "ysondre", name: "Ysondre", region: "eu" },290 { slug: "zenedar", name: "Zenedar", region: "eu" },291 { slug: "zirkel-des-cenarius", name: "Zirkel des Cenarius", region: "eu" },292 { slug: "zuljin", name: "Zul'jin", region: "eu" },293 { slug: "zuluhed", name: "Zuluhed", region: "eu" },294 { slug: "aegwynn", name: "Aegwynn", region: "us" },295 { slug: "aerie-peak", name: "Aerie Peak", region: "us" },296 { slug: "agamaggan", name: "Agamaggan", region: "us" },297 { slug: "aggramar", name: "Aggramar", region: "us" },298 { slug: "akama", name: "Akama", region: "us" },299 { slug: "alexstrasza", name: "Alexstrasza", region: "us" },300 { slug: "alleria", name: "Alleria", region: "us" },301 { slug: "altar-of-storms", name: "Altar of Storms", region: "us" },302 { slug: "alterac-mountains", name: "Alterac Mountains", region: "us" },303 { slug: "amanthul", name: "Aman'Thul", region: "us" },304 { slug: "andorhal", name: "Andorhal", region: "us" },305 { slug: "anetheron", name: "Anetheron", region: "us" },306 { slug: "antonidas", name: "Antonidas", region: "us" },307 { slug: "anubarak", name: "Anub'arak", region: "us" },308 { slug: "anvilmar", name: "Anvilmar", region: "us" },309 { slug: "arathor", name: "Arathor", region: "us" },310 { slug: "archimonde", name: "Archimonde", region: "us" },311 { slug: "area-52", name: "Area 52", region: "us" },312 { slug: "argent-dawn", name: "Argent Dawn", region: "us" },313 { slug: "arthas", name: "Arthas", region: "us" },314 { slug: "arygos", name: "Arygos", region: "us" },315 { slug: "auchindoun", name: "Auchindoun", region: "us" },316 { slug: "azgalor", name: "Azgalor", region: "us" },317 { slug: "azjolnerub", name: "Azjol-Nerub", region: "us" },318 { slug: "azralon", name: "Azralon", region: "us" },319 { slug: "azshara", name: "Azshara", region: "us" },320 { slug: "azuremyst", name: "Azuremyst", region: "us" },321 { slug: "baelgun", name: "Baelgun", region: "us" },322 { slug: "balnazzar", name: "Balnazzar", region: "us" },323 { slug: "barthilas", name: "Barthilas", region: "us" },324 { slug: "black-dragonflight", name: "Black Dragonflight", region: "us" },325 { slug: "blackhand", name: "Blackhand", region: "us" },326 { slug: "blackrock", name: "Blackrock", region: "us" },327 { slug: "blackwater-raiders", name: "Blackwater Raiders", region: "us" },328 { slug: "blackwing-lair", name: "Blackwing Lair", region: "us" },329 { slug: "blades-edge", name: "Blade's Edge", region: "us" },330 { slug: "bladefist", name: "Bladefist", region: "us" },331 { slug: "bleeding-hollow", name: "Bleeding Hollow", region: "us" },332 { slug: "blood-furnace", name: "Blood Furnace", region: "us" },333 { slug: "bloodhoof", name: "Bloodhoof", region: "us" },334 { slug: "bloodscalp", name: "Bloodscalp", region: "us" },335 { slug: "bonechewer", name: "Bonechewer", region: "us" },336 { slug: "borean-tundra", name: "Borean Tundra", region: "us" },337 { slug: "boulderfist", name: "Boulderfist", region: "us" },338 { slug: "bronzebeard", name: "Bronzebeard", region: "us" },339 { slug: "burning-blade", name: "Burning Blade", region: "us" },340 { slug: "burning-legion", name: "Burning Legion", region: "us" },341 { slug: "caelestrasz", name: "Caelestrasz", region: "us" },342 { slug: "cairne", name: "Cairne", region: "us" },343 { slug: "cenarion-circle", name: "Cenarion Circle", region: "us" },344 { slug: "cenarius", name: "Cenarius", region: "us" },345 { slug: "chogall", name: "Cho'gall", region: "us" },346 { slug: "chromaggus", name: "Chromaggus", region: "us" },347 { slug: "coilfang", name: "Coilfang", region: "us" },348 { slug: "crushridge", name: "Crushridge", region: "us" },349 { slug: "daggerspine", name: "Daggerspine", region: "us" },350 { slug: "dalaran", name: "Dalaran", region: "us" },351 { slug: "dalvengyr", name: "Dalvengyr", region: "us" },352 { slug: "dark-iron", name: "Dark Iron", region: "us" },353 { slug: "darkspear", name: "Darkspear", region: "us" },354 { slug: "darrowmere", name: "Darrowmere", region: "us" },355 { slug: "dathremar", name: "Dath'Remar", region: "us" },356 { slug: "dawnbringer", name: "Dawnbringer", region: "us" },357 { slug: "deathwing", name: "Deathwing", region: "us" },358 { slug: "demon-soul", name: "Demon Soul", region: "us" },359 { slug: "dentarg", name: "Dentarg", region: "us" },360 { slug: "destromath", name: "Destromath", region: "us" },361 { slug: "dethecus", name: "Dethecus", region: "us" },362 { slug: "detheroc", name: "Detheroc", region: "us" },363 { slug: "doomhammer", name: "Doomhammer", region: "us" },364 { slug: "draenor", name: "Draenor", region: "us" },365 { slug: "dragonblight", name: "Dragonblight", region: "us" },366 { slug: "dragonmaw", name: "Dragonmaw", region: "us" },367 { slug: "draktharon", name: "Drak'Tharon", region: "us" },368 { slug: "drakthul", name: "Drak'thul", region: "us" },369 { slug: "draka", name: "Draka", region: "us" },370 { slug: "drakkari", name: "Drakkari", region: "us" },371 { slug: "dreadmaul", name: "Dreadmaul", region: "us" },372 { slug: "drenden", name: "Drenden", region: "us" },373 { slug: "dunemaul", name: "Dunemaul", region: "us" },374 { slug: "durotan", name: "Durotan", region: "us" },375 { slug: "duskwood", name: "Duskwood", region: "us" },376 { slug: "earthen-ring", name: "Earthen Ring", region: "us" },377 { slug: "echo-isles", name: "Echo Isles", region: "us" },378 { slug: "eitrigg", name: "Eitrigg", region: "us" },379 { slug: "eldrethalas", name: "Eldre'Thalas", region: "us" },380 { slug: "elune", name: "Elune", region: "us" },381 { slug: "emerald-dream", name: "Emerald Dream", region: "us" },382 { slug: "eonar", name: "Eonar", region: "us" },383 { slug: "eredar", name: "Eredar", region: "us" },384 { slug: "executus", name: "Executus", region: "us" },385 { slug: "exodar", name: "Exodar", region: "us" },386 { slug: "farstriders", name: "Farstriders", region: "us" },387 { slug: "feathermoon", name: "Feathermoon", region: "us" },388 { slug: "fenris", name: "Fenris", region: "us" },389 { slug: "firetree", name: "Firetree", region: "us" },390 { slug: "fizzcrank", name: "Fizzcrank", region: "us" },391 { slug: "frostmane", name: "Frostmane", region: "us" },392 { slug: "frostmourne", name: "Frostmourne", region: "us" },393 { slug: "frostwolf", name: "Frostwolf", region: "us" },394 { slug: "galakrond", name: "Galakrond", region: "us" },395 { slug: "gallywix", name: "Gallywix", region: "us" },396 { slug: "garithos", name: "Garithos", region: "us" },397 { slug: "garona", name: "Garona", region: "us" },398 { slug: "garrosh", name: "Garrosh", region: "us" },399 { slug: "ghostlands", name: "Ghostlands", region: "us" },400 { slug: "gilneas", name: "Gilneas", region: "us" },401 { slug: "gnomeregan", name: "Gnomeregan", region: "us" },402 { slug: "goldrinn", name: "Goldrinn", region: "us" },403 { slug: "gorefiend", name: "Gorefiend", region: "us" },404 { slug: "gorgonnash", name: "Gorgonnash", region: "us" },405 { slug: "greymane", name: "Greymane", region: "us" },406 { slug: "grizzly-hills", name: "Grizzly Hills", region: "us" },407 { slug: "guldan", name: "Gul'dan", region: "us" },408 { slug: "gundrak", name: "Gundrak", region: "us" },409 { slug: "gurubashi", name: "Gurubashi", region: "us" },410 { slug: "hakkar", name: "Hakkar", region: "us" },411 { slug: "haomarush", name: "Haomarush", region: "us" },412 { slug: "hellscream", name: "Hellscream", region: "us" },413 { slug: "hydraxis", name: "Hydraxis", region: "us" },414 { slug: "hyjal", name: "Hyjal", region: "us" },415 { slug: "icecrown", name: "Icecrown", region: "us" },416 { slug: "illidan", name: "Illidan", region: "us" },417 { slug: "jaedenar", name: "Jaedenar", region: "us" },418 { slug: "jubeithos", name: "Jubei'Thos", region: "us" },419 { slug: "kaelthas", name: "Kael'thas", region: "us" },420 { slug: "kalecgos", name: "Kalecgos", region: "us" },421 { slug: "kargath", name: "Kargath", region: "us" },422 { slug: "kelthuzad", name: "Kel'Thuzad", region: "us" },423 { slug: "khadgar", name: "Khadgar", region: "us" },424 { slug: "khaz-modan", name: "Khaz Modan", region: "us" },425 { slug: "khazgoroth", name: "Khaz'goroth", region: "us" },426 { slug: "kiljaeden", name: "Kil'jaeden", region: "us" },427 { slug: "kilrogg", name: "Kilrogg", region: "us" },428 { slug: "kirin-tor", name: "Kirin Tor", region: "us" },429 { slug: "korgath", name: "Korgath", region: "us" },430 { slug: "korialstrasz", name: "Korialstrasz", region: "us" },431 { slug: "kul-tiras", name: "Kul Tiras", region: "us" },432 { slug: "laughing-skull", name: "Laughing Skull", region: "us" },433 { slug: "lethon", name: "Lethon", region: "us" },434 { slug: "lightbringer", name: "Lightbringer", region: "us" },435 { slug: "lightnings-blade", name: "Lightning's Blade", region: "us" },436 { slug: "lightninghoof", name: "Lightninghoof", region: "us" },437 { slug: "llane", name: "Llane", region: "us" },438 { slug: "lothar", name: "Lothar", region: "us" },439 { slug: "madoran", name: "Madoran", region: "us" },440 { slug: "maelstrom", name: "Maelstrom", region: "us" },441 { slug: "magtheridon", name: "Magtheridon", region: "us" },442 { slug: "maiev", name: "Maiev", region: "us" },443 { slug: "malganis", name: "Mal'Ganis", region: "us" },444 { slug: "malfurion", name: "Malfurion", region: "us" },445 { slug: "malorne", name: "Malorne", region: "us" },446 { slug: "malygos", name: "Malygos", region: "us" },447 { slug: "mannoroth", name: "Mannoroth", region: "us" },448 { slug: "medivh", name: "Medivh", region: "us" },449 { slug: "misha", name: "Misha", region: "us" },450 { slug: "moknathal", name: "Mok'Nathal", region: "us" },451 { slug: "moon-guard", name: "Moon Guard", region: "us" },452 { slug: "moonrunner", name: "Moonrunner", region: "us" },453 { slug: "mugthol", name: "Mug'thol", region: "us" },454 { slug: "muradin", name: "Muradin", region: "us" },455 { slug: "nagrand", name: "Nagrand", region: "us" },456 { slug: "nathrezim", name: "Nathrezim", region: "us" },457 { slug: "nazgrel", name: "Nazgrel", region: "us" },458 { slug: "nazjatar", name: "Nazjatar", region: "us" },459 { slug: "nemesis", name: "Nemesis", region: "us" },460 { slug: "nerzhul", name: "Ner'zhul", region: "us" },461 { slug: "nesingwary", name: "Nesingwary", region: "us" },462 { slug: "nordrassil", name: "Nordrassil", region: "us" },463 { slug: "norgannon", name: "Norgannon", region: "us" },464 { slug: "onyxia", name: "Onyxia", region: "us" },465 { slug: "perenolde", name: "Perenolde", region: "us" },466 { slug: "proudmoore", name: "Proudmoore", region: "us" },467 { slug: "queldorei", name: "Quel'dorei", region: "us" },468 { slug: "quelthalas", name: "Quel'Thalas", region: "us" },469 { slug: "ragnaros", name: "Ragnaros", region: "us" },470 { slug: "ravencrest", name: "Ravencrest", region: "us" },471 { slug: "ravenholdt", name: "Ravenholdt", region: "us" },472 { slug: "rexxar", name: "Rexxar", region: "us" },473 { slug: "rivendare", name: "Rivendare", region: "us" },474 { slug: "runetotem", name: "Runetotem", region: "us" },475 { slug: "sargeras", name: "Sargeras", region: "us" },476 { slug: "saurfang", name: "Saurfang", region: "us" },477 { slug: "scarlet-crusade", name: "Scarlet Crusade", region: "us" },478 { slug: "scilla", name: "Scilla", region: "us" },479 { slug: "senjin", name: "Sen'jin", region: "us" },480 { slug: "sentinels", name: "Sentinels", region: "us" },481 { slug: "shadow-council", name: "Shadow Council", region: "us" },482 { slug: "shadowmoon", name: "Shadowmoon", region: "us" },483 { slug: "shadowsong", name: "Shadowsong", region: "us" },484 { slug: "shandris", name: "Shandris", region: "us" },485 { slug: "shattered-halls", name: "Shattered Halls", region: "us" },486 { slug: "shattered-hand", name: "Shattered Hand", region: "us" },487 { slug: "shuhalo", name: "Shu'halo", region: "us" },488 { slug: "silver-hand", name: "Silver Hand", region: "us" },489 { slug: "silvermoon", name: "Silvermoon", region: "us" },490 { slug: "sisters-of-elune", name: "Sisters of Elune", region: "us" },491 { slug: "skullcrusher", name: "Skullcrusher", region: "us" },492 { slug: "skywall", name: "Skywall", region: "us" },493 { slug: "smolderthorn", name: "Smolderthorn", region: "us" },494 { slug: "spinebreaker", name: "Spinebreaker", region: "us" },495 { slug: "spirestone", name: "Spirestone", region: "us" },496 { slug: "staghelm", name: "Staghelm", region: "us" },497 { slug: "steamwheedle-cartel", name: "Steamwheedle Cartel", region: "us" },498 { slug: "stonemaul", name: "Stonemaul", region: "us" },499 { slug: "stormrage", name: "Stormrage", region: "us" },500 { slug: "stormreaver", name: "Stormreaver", region: "us" },501 { slug: "stormscale", name: "Stormscale", region: "us" },502 { slug: "suramar", name: "Suramar", region: "us" },503 { slug: "tanaris", name: "Tanaris", region: "us" },504 { slug: "terenas", name: "Terenas", region: "us" },505 { slug: "terokkar", name: "Terokkar", region: "us" },506 { slug: "thaurissan", name: "Thaurissan", region: "us" },507 { slug: "the-forgotten-coast", name: "The Forgotten Coast", region: "us" },508 { slug: "the-scryers", name: "The Scryers", region: "us" },509 { slug: "the-underbog", name: "The Underbog", region: "us" },510 { slug: "the-venture-co", name: "The Venture Co", region: "us" },511 { slug: "thorium-brotherhood", name: "Thorium Brotherhood", region: "us" },512 { slug: "thrall", name: "Thrall", region: "us" },513 { slug: "thunderhorn", name: "Thunderhorn", region: "us" },514 { slug: "thunderlord", name: "Thunderlord", region: "us" },515 { slug: "tichondrius", name: "Tichondrius", region: "us" },516 { slug: "tol-barad", name: "Tol Barad", region: "us" },517 { slug: "tortheldrin", name: "Tortheldrin", region: "us" },518 { slug: "trollbane", name: "Trollbane", region: "us" },519 { slug: "turalyon", name: "Turalyon", region: "us" },520 { slug: "twisting-nether", name: "Twisting Nether", region: "us" },521 { slug: "uldaman", name: "Uldaman", region: "us" },522 { slug: "uldum", name: "Uldum", region: "us" },523 { slug: "undermine", name: "Undermine", region: "us" },524 { slug: "ursin", name: "Ursin", region: "us" },525 { slug: "uther", name: "Uther", region: "us" },526 { slug: "vashj", name: "Vashj", region: "us" },527 { slug: "veknilash", name: "Vek'nilash", region: "us" },528 { slug: "velen", name: "Velen", region: "us" },529 { slug: "warsong", name: "Warsong", region: "us" },530 { slug: "whisperwind", name: "Whisperwind", region: "us" },531 { slug: "wildhammer", name: "Wildhammer", region: "us" },532 { slug: "windrunner", name: "Windrunner", region: "us" },533 { slug: "winterhoof", name: "Winterhoof", region: "us" },534 { slug: "wyrmrest-accord", name: "Wyrmrest Accord", region: "us" },535 { slug: "ysera", name: "Ysera", region: "us" },536 { slug: "ysondre", name: "Ysondre", region: "us" },537 { slug: "zangarmarsh", name: "Zangarmarsh", region: "us" },538 { slug: "zuljin", name: "Zul'jin", region: "us" },539 { slug: "zuluhed", name: "Zuluhed", region: "us" },...

Full Screen

Full Screen

getslug.js

Source:getslug.js Github

copy

Full Screen

1/**2 * Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.3 * For licensing, see LICENSE.md or http://ckeditor.com/license4 */5/* exported initSample */6 function ChangeToSlug(){7 var title, slug;8 //alert ("a");9 //Lấy text từ thẻ input title 10 title = document.getElementById("title").value;11 document.getElementById('title_seo').value = title;12 //Đổi chữ hoa thành chữ thường13 slug = title.toLowerCase();14 15 //Đổi ký tự có dấu thành không dấu16 slug = slug.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, 'a');17 slug = slug.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, 'e');18 slug = slug.replace(/i|í|ì|ỉ|ĩ|ị/gi, 'i');19 slug = slug.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, 'o');20 slug = slug.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, 'u');21 slug = slug.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, 'y');22 slug = slug.replace(/đ/gi, 'd');23 //Xóa các ký tự đặt biệt24 slug = slug.replace(/\`|\~|\!|\@|\#|\||\$|\%|\^|\&|\*|\(|\)|\+|\=|\,|\.|\/|\?|\>|\<|\'|\"|\:|\;|_/gi, '');25 //Đổi khoảng trắng thành ký tự gạch ngang26 slug = slug.replace(/ /gi, "-");27 //Đổi nhiều ký tự gạch ngang liên tiếp thành 1 ký tự gạch ngang28 //Phòng trường hợp người nhập vào quá nhiều ký tự trắng29 slug = slug.replace(/\-\-\-\-\-/gi, '-');30 slug = slug.replace(/\-\-\-\-/gi, '-');31 slug = slug.replace(/\-\-\-/gi, '-');32 slug = slug.replace(/\-\-/gi, '-');33 //Xóa các ký tự gạch ngang ở đầu và cuối34 slug = '@' + slug + '@';35 slug = slug.replace(/\@\-|\-\@|\@/gi, '');36 //In slug ra textbox có id “slug”37 document.getElementById('slug1').value = slug;38 document.getElementById('title_seo').value = title;39 // $.ajax({40 // url : "xuly.php",41 // type : "get",42 // dataText : "text",43 // data : {44 // slug : $('#slug1').val(),45 // table : $('#table').val()46 // },47 // success : function(html){48 // $('#slug1').val(html);49 // }50 // });51 }52 function ChangeToSlug_vn(){53 var title, slug;54 //alert ("a");55 //Lấy text từ thẻ input title 56 title = document.getElementById("lang[vn][lang_page_name]").value;57 document.getElementById('lang[vn][title_seo]').value = title;58 //Đổi chữ hoa thành chữ thường59 slug = title.toLowerCase();60 61 //Đổi ký tự có dấu thành không dấu62 slug = slug.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, 'a');63 slug = slug.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, 'e');64 slug = slug.replace(/i|í|ì|ỉ|ĩ|ị/gi, 'i');65 slug = slug.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, 'o');66 slug = slug.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, 'u');67 slug = slug.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, 'y');68 slug = slug.replace(/đ/gi, 'd');69 //Xóa các ký tự đặt biệt70 slug = slug.replace(/\`|\~|\!|\@|\#|\||\$|\%|\^|\&|\*|\(|\)|\+|\=|\,|\.|\/|\?|\>|\<|\'|\"|\:|\;|_/gi, '');71 //Đổi khoảng trắng thành ký tự gạch ngang72 slug = slug.replace(/ /gi, "-");73 //Đổi nhiều ký tự gạch ngang liên tiếp thành 1 ký tự gạch ngang74 //Phòng trường hợp người nhập vào quá nhiều ký tự trắng75 slug = slug.replace(/\-\-\-\-\-/gi, '-');76 slug = slug.replace(/\-\-\-\-/gi, '-');77 slug = slug.replace(/\-\-\-/gi, '-');78 slug = slug.replace(/\-\-/gi, '-');79 //Xóa các ký tự gạch ngang ở đầu và cuối80 slug = '@' + slug + '@';81 slug = slug.replace(/\@\-|\-\@|\@/gi, '');82 //In slug ra textbox có id “slug”83 document.getElementById('lang[vn][friendly_url]').value = slug;84 document.getElementById('lang[vn][title_seo]').value = title;85 // $.ajax({86 // url : "xuly.php",87 // type : "get",88 // dataText : "text",89 // data : {90 // slug : $('#slug1').val(),91 // table : $('#table').val()92 // },93 // success : function(html){94 // $('#slug1').val(html);95 // }96 // });97 }...

Full Screen

Full Screen

resource.js

Source:resource.js Github

copy

Full Screen

1/**2 * The resource mixin is responsible for adding, retrieving and updating3 * from an existing project.4 * @module mixins/resource5 */6 module.exports = (axios, urls) => ({7 /**8 * Retrieve the resources of the specified project.9 * @param {string} project_slug - The projects slug10 * @example txApi.resources().then(function(data) {})11 **/12 resources(project_slug) {13 var path = urls['resources'].14 replace('<project_slug>', project_slug);15 return axios.get(path);16 },17 /**18 * Add a new resource to a project19 * @param {string} project_slug - The projects slug20 * @param {object} form - An object containing the resource definition21 * @example22 txApi.resourceCreate('autotest', {23 slug: 'resourcetest',24 name: 'resourcetest',25 i18n_type: 'KEYVALUEJSON',26 content: JSON.stringify({"hello world": "hello world"}),27 })28 **/29 resourceCreate(project_slug, form, options) {30 var path = urls['resources'].31 replace('<project_slug>', project_slug);32 return axios.post(path, form, options);33 },34 /**35 * Retrieve the details of a project's resource36 * @param {string} project_slug - The projects slug37 * @param {string} resource_slug - The resource slug38 * @example txApi.resource('autotest', 'resourcetest')39 **/40 resource(project_slug, resource_slug) {41 var path = urls['resource'].42 replace('<project_slug>', project_slug).43 replace('<resource_slug>', resource_slug);44 return axios.get(path);45 },46 /**47 * Retrieves the source file of the resource48 * @param {string} project_slug - The projects slug49 * @param {string} resource_slug - The resource slug50 * @example txApi.resourceFile('autotest', 'resourcetest')51 **/52 resourceFile(project_slug, resource_slug) {53 var path = urls['resourceUpdate'].54 replace('<project_slug>', project_slug).55 replace('<resource_slug>', resource_slug);56 return axios.get(path, { params: { file: true } });57 },58 /**59 * Update the details of an existing resource60 * @param {string} project_slug - The projects slug61 * @param {string} resource_slug - The resource slug62 * @param {object} form - An object containing the resource definition63 * @example64 txApi.resourceDetailsUpdate('autotest', 'resourcetest', {65 name: 'updatedresourcetest',66 })67 **/68 resourceDetailsUpdate(project_slug, resource_slug, form) {69 var path = urls['resource'].70 replace('<project_slug>', project_slug).71 replace('<resource_slug>', resource_slug);72 return axios.put(path, form);73 },74 /**75 * Update the resource strings of an existing resource76 * @param {string} project_slug - The projects slug77 * @param {string} resource_slug - The resource slug78 * @param {object} form - An object containing the resource definition79 * @example80 txApi.resourceStringsUpdate('autotest', 'resourcetest', {81 name: 'updatedresourcetest',82 })83 **/84 resourceSourceStringsUpdate(project_slug, resource_slug, form) {85 var path = urls['resourceUpdate'].86 replace('<project_slug>', project_slug).87 replace('<resource_slug>', resource_slug);88 return axios.put(path, form);89 },90 /**91 * Delete an existing resource92 * @param {string} project_slug - The projects slug93 * @param {string} resource_slug - The resource slug94 * @example95 txApi.resourceDelete('autotest', 'resourcetest)96 **/97 resourceDelete(project_slug, resource_slug) {98 var path = urls['resource'].99 replace('<project_slug>', project_slug).100 replace('<resource_slug>', resource_slug);101 return axios.delete(path);102 },...

Full Screen

Full Screen

speakingurl-tests.ts

Source:speakingurl-tests.ts Github

copy

Full Screen

1import getSlug = require("speakingurl");2let slug: string;3// Examples from https://github.com/pid/speakingurl#usage4slug = getSlug("Schöner Titel läßt grüßen!? Bel été !");5slug = getSlug("Schöner Titel läßt grüßen!? Bel été !", '*');6slug = getSlug("Schöner Titel läßt grüßen!? Bel été !", {7 separator: '_'8});9slug = getSlug("Schöner Titel läßt grüßen!? Bel été !", {10 uric: true11});12slug = getSlug("Schöner Titel läßt grüßen!? Bel été !", {13 uricNoSlash: true14});15slug = getSlug("Schöner Titel läßt grüßen!? Bel été !", {16 mark: true17});18slug = getSlug("Schöner Titel läßt grüßen!? Bel été !", {19 truncate: 2020});21slug = getSlug("Schöner Titel läßt grüßen!? Bel été !", {22 maintainCase: true23});24slug = getSlug("Äpfel & Birnen!", {25 lang: 'de'26});27slug = getSlug("မြန်မာ သာဓက", {28 lang: 'my'29});30slug = getSlug('މިއަދަކީ ހދ ރީތި ދވހކވ', {31 lang: 'dv'32});33slug = getSlug("Apple & Pear!", {34 lang: 'en' // lang: "en" is default, just to clarify35});36slug = getSlug('Foo & Bar * Baz', {37 custom: {38 '&': ' doo '39 },40 uric: true41});42slug = getSlug('Foo ♥ Bar');43slug = getSlug('Foo & Bar | (Baz) * Doo', {44 custom: {45 '*': 'Boo'46 },47 mark: true48});49slug = getSlug('Foo and Bar or Baz', {50 custom: {51 and: 'und',52 or: ''53 }54});55slug = getSlug('[Knöpfe]', {56 custom: [57 '[',58 ']'59 ]60});61slug = getSlug('NEXUS4 only $299');62slug = getSlug('NEXUS4 only €299', {63 maintainCase: true64});65slug = getSlug('Don\'t drink and drive', {66 titleCase: true67});68slug = getSlug('Don\'t drink and drive', {69 titleCase: ['and']70});71slug = getSlug('Foo & Bar ♥ Foo < Bar', {72 lang: false73});74slug = getSlug('Foo & Bar ♥ Foo < Bar', {75 symbols: false76});77slug = getSlug('ä♥ä', {78 lang: 'tr',79 symbols: false80});81const options = {82 titleCase: [83 "a", "an", "and", "as", "at", "but",84 "by", "en", "for", "if", "in", "nor",85 "of", "on", "or", "per", "the", "to", "vs"86 ]87};88const mySlug = getSlug.createSlug(options);...

Full Screen

Full Screen

change_slug.js

Source:change_slug.js Github

copy

Full Screen

1$(document).ready(function() {2 function ChangeToSlug()3 {4 var title, slug;5 //Lấy text từ thẻ input title 6 title = document.getElementById("name_slug").value;7 //Đổi chữ hoa thành chữ thường8 slug = title.toLowerCase();9 //Đổi ký tự có dấu thành không dấu10 slug = slug.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, 'a');11 slug = slug.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, 'e');12 slug = slug.replace(/i|í|ì|ỉ|ĩ|ị/gi, 'i');13 slug = slug.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, 'o');14 slug = slug.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, 'u');15 slug = slug.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, 'y');16 slug = slug.replace(/đ/gi, 'd');17 //Xóa các ký tự đặt biệt18 slug = slug.replace(/\`|\~|\!|\@|\#|\||\$|\%|\^|\&|\*|\(|\)|\+|\=|\,|\.|\/|\?|\>|\<|\'|\"|\:|\;|_/gi, '');19 //Đổi khoảng trắng thành ký tự gạch ngang20 slug = slug.replace(/ /gi, "-");21 //Đổi khoảng daaus cham thành ký tự rong22 // slug = slug.replace(/\./gi, "");23 //Đổi nhiều ký tự gạch ngang liên tiếp thành 1 ký tự gạch ngang24 //Phòng trường hợp người nhập vào quá nhiều ký tự trắng25 slug = slug.replace(/[^a-zA-Z0-9]/gi, '-');26 slug = slug.replace(/\-\-\-\-\-/gi, '-');27 slug = slug.replace(/\-\-\-\-/gi, '-');28 slug = slug.replace(/\-\-\-/gi, '-');29 slug = slug.replace(/\-\-/gi, '-');30 // $str = slug.replace('/([\s]+)/gi', '-');31 //Xóa các ký tự gạch ngang ở đầu và cuối32 slug = '@' + slug + '@';33 slug = slug.replace(/\@\-|\-\@|\@/gi, '');34 //Đổi chữ hoa thành chữ thường35 slug = slug.toLowerCase();36 //In slug ra textbox có id “slug”37 document.getElementById('seo_slug').value = slug;38 }39 40 $("#name_slug").blur(function(event) {41 ChangeToSlug();42 if ($("#seo_title").length) {43 $("#seo_title").val($(this).val());44 }45 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const mongoose = require('mongoose');2const BestSeller = require('./models/bestSeller');3 .then(() => {4 console.log("Mongo connection open!");5 })6 .catch(err => {7 console.log("Mongo connection error");8 console.log(err);9 })10const findBestSeller = async () => {11 const bestSeller = await BestSeller.findOne({ name: 'The Midnight Library' });12 console.log(bestSeller.slug);13}14findBestSeller();15const mongoose = require('mongoose');16const slugify = require('slugify');17const bestSellerSchema = new mongoose.Schema({18 name: {19 },

Full Screen

Using AI Code Generation

copy

Full Screen

1var maxProfit = function(prices) {2 let max = 0;3 let min = prices[0];4 for (let i = 0; i < prices.length; i++) {5 if (prices[i] < min) {6 min = prices[i];7 } else if (prices[i] - min > max) {8 max = prices[i] - min;9 }10 }11 return max;12};

Full Screen

Using AI Code Generation

copy

Full Screen

1const slug = require('slug');2const express = require('express');3const bodyParser = require('body-parser');4const morgan = require('morgan');5const methodOverride = require('method-override');6const exphbs = require('express-handlebars');7const cookieParser = require('cookie-parser');8const session = require('express-session');9const flash = require('connect-flash');10const passport = require('passport');11const LocalStrategy = require('passport-local').Strategy;12const mongoose = require('mongoose');13const bcrypt = require('bcrypt-nodejs');14const path = require('path');15const multer = require('multer');16const GridFsStorage = require('multer-gridfs-storage');17const Grid = require('gridfs-stream');18const crypto = require('crypto');19const nodemailer = require('nodemailer');20const async = require('async');21const crypto = require('crypto');22const hbs = require('nodemailer-express-handlebars');23const dotenv = require('dotenv').config();

Full Screen

Using AI Code Generation

copy

Full Screen

1const BestMatch = require('best-match');2const bestMatch = new BestMatch();3const slugify = require('slugify');4const string = 'This is a string';5const slug = slugify(string, {6 remove: /[*+~.()'"!:@]/g,7});8bestMatch.add(slug, string);9const string2 = 'This is another string';10const slug2 = slugify(string2, {11 remove: /[*+~.()'"!:@]/g,12});13const result = bestMatch.match(slug2);14console.log(result);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Best automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful