Skip to content

Commit cb922ef

Browse files
author
Artem
committed
Change the version + refactor isBrowser
1 parent ef4fa76 commit cb922ef

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@foxcomm/api-js",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "Javascript Library for interacting with FoxCommerce API",
55
"main": "lib/index.js",
66
"publishConfig": {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default class Api {
5050
// add the stripe.js script if in the browser
5151
let stripeLoaded = Promise.resolve();
5252

53-
if (isBrowser()) {
53+
if (isBrowser) {
5454
stripeLoaded = loadScript('https://js.stripe.com/v2/').then(() => {
5555
Stripe.setPublishableKey(this.stripe_key);
5656
});

src/utils/browser.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import _ from 'lodash';
22

3-
export function isBrowser() {
4-
try {
5-
return window;
6-
} catch (e) {
7-
return false;
8-
}
9-
}
3+
export const isBrowser = typeof window != 'undefined';
104

115
function scriptExists(path) {
126
const scripts = document.getElementsByTagName('script');

0 commit comments

Comments
 (0)