-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use toString to check if param is a Map or Set
- Loading branch information
1 parent
3ad4dfe
commit ca35f9a
Showing
5 changed files
with
6 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import _Array$from from "../../core-js/array/from"; | ||
import _Set from "../../core-js/set"; | ||
import _Map from "../../core-js/map"; | ||
import _isIterable from "../../core-js/is-iterable"; | ||
import _Symbol from "../../core-js/symbol"; | ||
import _Array$isArray from "../../core-js/array/is-array"; | ||
export default function _iterableToArray(iter) { | ||
if (_Array$isArray(iter) || typeof iter === 'string' || typeof _Symbol === 'function' && _isIterable(Object(iter)) || iter && 'length' in iter || typeof _Map !== 'undefined' && iter instanceof _Map || typeof _Set !== 'undefined' && iter instanceof _Set || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter); | ||
if (_Array$isArray(iter) || typeof iter === 'string' || typeof _Symbol === 'function' && _isIterable(Object(iter)) || iter && 'length' in iter || Object.prototype.toString.call(iter) === "[object Map]" || Object.prototype.toString.call(iter) === "[object Set]" || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
var _Array$from = require("../core-js/array/from"); | ||
|
||
var _Set = require("../core-js/set"); | ||
|
||
var _Map = require("../core-js/map"); | ||
|
||
var _isIterable = require("../core-js/is-iterable"); | ||
|
||
var _Symbol = require("../core-js/symbol"); | ||
|
||
var _Array$isArray = require("../core-js/array/is-array"); | ||
|
||
function _iterableToArray(iter) { | ||
if (_Array$isArray(iter) || typeof iter === 'string' || typeof _Symbol === 'function' && _isIterable(Object(iter)) || iter && 'length' in iter || typeof _Map !== 'undefined' && iter instanceof _Map || typeof _Set !== 'undefined' && iter instanceof _Set || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter); | ||
if (_Array$isArray(iter) || typeof iter === 'string' || typeof _Symbol === 'function' && _isIterable(Object(iter)) || iter && 'length' in iter || Object.prototype.toString.call(iter) === "[object Map]" || Object.prototype.toString.call(iter) === "[object Set]" || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter); | ||
} | ||
|
||
module.exports = _iterableToArray; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function _iterableToArray(iter) { | ||
if (Array.isArray(iter) || typeof iter === 'string' || typeof Symbol === 'function' && Symbol.iterator in Object(iter) || iter && 'length' in iter || typeof Map !== 'undefined' && iter instanceof Map || typeof Set !== 'undefined' && iter instanceof Set || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
if (Array.isArray(iter) || typeof iter === 'string' || typeof Symbol === 'function' && Symbol.iterator in Object(iter) || iter && 'length' in iter || Object.prototype.toString.call(iter) === "[object Map]" || Object.prototype.toString.call(iter) === "[object Set]" || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
} | ||
|
||
module.exports = _iterableToArray; |