Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Don't pollute global scope with atob and btoa #99

Closed
moll opened this issue May 3, 2017 · 1 comment
Closed

Don't pollute global scope with atob and btoa #99

moll opened this issue May 3, 2017 · 1 comment
Assignees

Comments

@moll
Copy link

moll commented May 3, 2017

Hey,

I realize it's meant to be a polyfill, but I don't think polluting the global scope with atob and btoa as a side-effect of requiring the module is a good idea. If they ever come to V8 as a runtime, then great, but till then people using them will have to import them from somewhere manually anyways and a side-effecty require statement just ain't cool. :)

Otherwise, thanks for the module!

@LiraNuna
Copy link
Contributor

LiraNuna commented Jan 4, 2018

They seem to be unused by the project?

node-webcrypto-ossl$ git grep btoa
lib/webcrypto.ts:// Fix btoa and atob for NodeJS
lib/webcrypto.ts:g.btoa = (data: string) => new Buffer(data, "binary").toString("base64");
node-webcrypto-ossl$ git grep atob
lib/webcrypto.ts:// Fix btoa and atob for NodeJS
lib/webcrypto.ts:g.atob = (data: string) => new Buffer(data, "base64").toString("binary");

They are only defined on https://github.com/PeculiarVentures/node-webcrypto-ossl/blob/master/lib/webcrypto.ts#L9-L12

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants