-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: node support #1
Conversation
@@ -1,7 +1,9 @@ | |||
import window from 'global/window'; | |||
|
|||
const atob = (s) => window.atob ? window.atob(s) : Buffer.from(s, 'base64').toString('binary'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node does not have window.atob
@@ -9,7 +9,7 @@ const resolveUrl = (baseUrl, relativeUrl) => { | |||
|
|||
// if the base URL is relative then combine with the current location | |||
if (!(/\/\//i).test(baseUrl)) { | |||
baseUrl = URLToolkit.buildAbsoluteURL(window.location.href, baseUrl); | |||
baseUrl = URLToolkit.buildAbsoluteURL(window.location && window.location.href || '', baseUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node does not have a location.
91bb7b2
to
315ab8d
Compare
const currentLocation = window.location.protocol + '//' + window.location.host; | ||
let currentLocation = ''; | ||
|
||
if (window.location && window.location.protocol) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node does not have a location.
See code comments.