Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Adding base64 encoding from web-editor and removed old encoding #339

Merged
merged 2 commits into from
Jun 16, 2017

Conversation

rorticus
Copy link
Contributor

Type: bug / feature

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

Removing old encoding.ts and replaced it with the base64 methods from web-editor. It doesn't look like the code from encoding.ts was being used, so I think we can just ditch it.

Resolves #299

@rorticus rorticus requested a review from kitsonk May 26, 2017 11:58
@codecov
Copy link

codecov bot commented May 26, 2017

Codecov Report

Merging #339 into master will decrease coverage by 0.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/base64.ts 100% <100%> (ø)
src/main.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f777ae6...07f7cc4. Read the comment docs.

Copy link
Member

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially we are assuming that all supported browsers support btob/atob, since the alternative is the Node-specific Buffer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwistrand yeah, and I think we are good on that account, https://caniuse.com/#search=atob . Supported back to IE 10.

@dylans dylans added this to the 2017.05 milestone May 27, 2017
@eheasley eheasley modified the milestones: 2017.05, 2017.06 Jun 6, 2017
@dylans dylans added this to the 2017.06 milestone Jun 16, 2017
@rorticus rorticus merged commit f4f129e into dojo:master Jun 16, 2017
@rorticus rorticus deleted the issue-299 branch June 16, 2017 15:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants