Adding base64 encoding from web-editor and removed old encoding#339
Adding base64 encoding from web-editor and removed old encoding#339rorticus merged 2 commits intodojo:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #339 +/- ##
==========================================
- Coverage 94.14% 93.98% -0.16%
==========================================
Files 40 40
Lines 2202 2063 -139
Branches 408 380 -28
==========================================
- Hits 2073 1939 -134
+ Misses 51 50 -1
+ Partials 78 74 -4
Continue to review full report at Codecov.
|
kitsonk
left a comment
There was a problem hiding this comment.
The only thing is I would want to get someone else's opinion on naming of the module... I don't trust my own judgement. (Someone else should review this too since it is porting of code I wrote)
| return decodeURIComponent(Array.prototype.map.call(atob(encodedString), (char: string) => '%' + ('00' + char.charCodeAt(0).toString(16)).slice(-2)).join('')); | ||
| } : function (encodedString: string): string { | ||
| return new Buffer(encodedString.toString(), 'base64').toString('utf8'); | ||
| }; |
There was a problem hiding this comment.
Essentially we are assuming that all supported browsers support btob/atob, since the alternative is the Node-specific Buffer?
There was a problem hiding this comment.
@mwistrand yeah, and I think we are good on that account, https://caniuse.com/#search=atob . Supported back to IE 10.
Type: bug / feature
The following has been addressed in the PR:
Description:
Removing old
encoding.tsand replaced it with the base64 methods fromweb-editor. It doesn't look like the code fromencoding.tswas being used, so I think we can just ditch it.Resolves #299