You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
559 B
20 lines
559 B
// Polyfills friendly, therefore ES5 syntax |
|
|
|
"use strict"; |
|
|
|
var isObject = require("../object/is"); |
|
|
|
var iteratorSymbol = Symbol.iterator; |
|
|
|
if (!iteratorSymbol) { |
|
throw new Error("Cannot initialize iterator/is due to Symbol.iterator not being implemented"); |
|
} |
|
|
|
module.exports = function (value/*, options*/) { |
|
if (!isObject(value)) { |
|
var options = arguments[1]; |
|
if (!isObject(options) || !options.allowString || typeof value !== "string") return false; |
|
} |
|
try { return typeof value[iteratorSymbol] === "function"; } |
|
catch (error) { return false; } |
|
};
|
|
|