Idk, maybe somebody just copied the code into there from a release bundle to avoid dependencies. The only time you are ever going to see a piece of checking whether a default global class is undefined is in a polyfill.
Bro I have no idea, I'm lost as balls in this shit, and it's one of the few open source projects that has some kind of integration with a payment api I'm using
It checks if the type and value are the same. If Textencoder is of type undefined, it will return a string called "undefined", so he needs to compare to another string "undefined". I think he could just used TextEncoder === undefined and the result would be the same lol.
19
u/[deleted] Nov 18 '21
I dont really get what he is trying to do
4
u/Konsti219 Nov 18 '21 edited Nov 18 '21
This looks like reindented minified code.
Edit: looks like a TextEncoder poly fill
3
u/wwelna Nov 18 '21
Everything looks perfectly fine and normal to me
11
u/Jimmy_Slim Nov 18 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
8
u/jzaprint Nov 18 '21
i dont get why ppl still use var instead of let and const.
5
u/shizzy0 Nov 18 '21
“Bruh, Juno?”
“no idk”
2
u/PositiveUse Nov 18 '21
What is „undefined“ === typeof Textencoder
3
u/[deleted] Nov 18 '21
what the fuuck, who needs variables am i rite
2
u/lttitus Nov 18 '21
Looks to be a half-assed deobfuscation...
1
u/tekion23 Nov 25 '21
I know that Juno is an Object but besides that...
1
u/blackjezza Nov 29 '21
Looks like a polyfill for TextEncoder. Probably reimplementing logic from other browsers.