Skip to content

Commit e2ed3a5

Browse files
author
Ari
committed
Updated react github fork ribbon package
1 parent 08c75b5 commit e2ed3a5

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"react": "^15.0.0",
6363
"react-addons-test-utils": "^15.0.0",
6464
"react-dom": "^15.0.0",
65-
"react-github-fork-ribbon": "^0.4.3",
65+
"react-github-fork-ribbon": "^0.5.1",
6666
"react-router-dom": "^4.2.2",
6767
"sinon": "^1.17.3",
6868
"style-loader": "^0.13.1",

src/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
33
import ReactDOM from 'react-dom';
44
import {camelize} from './lib/String';
55
import {makeCancelable} from './lib/cancelablePromise';
6-
import invariant from 'invariant';
76

87
const mapStyles = {
98
container: {
@@ -54,10 +53,9 @@ export class Map extends React.Component {
5453
constructor(props) {
5554
super(props);
5655

57-
invariant(
58-
props.hasOwnProperty('google'),
59-
'You must include a `google` prop.'
60-
);
56+
if (!props.hasOwnProperty('google')) {
57+
throw new Error('You must include a `google` prop');
58+
}
6159

6260
this.listeners = {};
6361
this.state = {

src/lib/GoogleApi.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import invariant from 'invariant';
2-
31
export const GoogleApi = function(opts) {
42
opts = opts || {};
53

6-
invariant(
7-
opts.hasOwnProperty('apiKey'),
8-
'You must pass an apiKey to use GoogleApi'
9-
);
4+
if (!opts.hasOwnProperty('apiKey')) {
5+
throw new Error('You must pass an apiKey to use GoogleApi');
6+
}
107

118
const apiKey = opts.apiKey;
129
const libraries = opts.libraries || ['places'];
@@ -16,7 +13,7 @@ export const GoogleApi = function(opts) {
1613
const googleVersion = opts.version || '3.31';
1714

1815
let script = null;
19-
let google = typeof window !== 'undefined' && window.google || null;
16+
let google = (typeof window !== 'undefined' && window.google) || null;
2017
let loading = false;
2118
let channel = null;
2219
let language = opts.language;

0 commit comments

Comments
 (0)