Skip to content

Commit

Permalink
Use typeof to check presence of process instead of truthyness (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
急須 authored and bukinoshita committed May 17, 2019
1 parent c58cf92 commit c12841d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var _objectAssign2 = _interopRequireDefault(_objectAssign);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var IS_NODE = typeof document === 'undefined' || process && process.env && process.env.NODE_ENV === 'test';
var IS_NODE = typeof document === 'undefined' || typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test';
var _rawCookie = {};
var _res = void 0;

Expand Down
4 changes: 3 additions & 1 deletion src/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import objectAssign from 'object-assign'

const IS_NODE =
typeof document === 'undefined' ||
(process && process.env && process.env.NODE_ENV === 'test')
(typeof process !== 'undefined' &&
process.env &&
process.env.NODE_ENV === 'test')
let _rawCookie = {}
let _res

Expand Down

0 comments on commit c12841d

Please sign in to comment.