Skip to content

Commit

Permalink
remove return outside of function as it not es6 module compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzPoize committed Dec 3, 2019
1 parent 424e38e commit 9894c3d
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,39 @@
var $Map = typeof Map === 'function' && Map.prototype ? Map : null;
var $Set = typeof Set === 'function' && Set.prototype ? Set : null;

if (!$Map) {
// eslint-disable-next-line no-unused-vars
if ($Map) {
var $mapHas = $Map ? Map.prototype.has : null;
var $setHas = $Set ? Set.prototype.has : null;
if (!$mapHas) {
// eslint-disable-next-line no-unused-vars
module.exports = function isMap(x) {
// `Map` does not have a `has` method
return false;
};
return;
}

module.exports = function isMap(x) {
// `Map` is not present in this environment.
if (!x || typeof x !== 'object') {
return false;
}
try {
$mapHas.call(x);
if ($setHas) {
try {
$setHas.call(x);
} catch (e) {
return true;
}
}
return x instanceof $Map; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
};
return;
}

var $mapHas = $Map ? Map.prototype.has : null;
var $setHas = $Set ? Set.prototype.has : null;
if (!$mapHas) {
} else {
// eslint-disable-next-line no-unused-vars
module.exports = function isMap(x) {
// `Map` does not have a `has` method
// `Map` is not present in this environment.
return false;
};
return;
}

module.exports = function isMap(x) {
if (!x || typeof x !== 'object') {
return false;
}
try {
$mapHas.call(x);
if ($setHas) {
try {
$setHas.call(x);
} catch (e) {
return true;
}
}
return x instanceof $Map; // core-js workaround, pre-v2.5.0
} catch (e) {}
return false;
};

0 comments on commit 9894c3d

Please sign in to comment.