Remove unused toIterable function (#857)

This commit is contained in:
toasted-nutbread 2020-09-22 22:59:07 -04:00 committed by GitHub
parent 7d78e8737f
commit c8b738ddf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 17 deletions

View File

@ -101,7 +101,6 @@
"jsonToError": "readonly",
"isObject": "readonly",
"hasOwn": "readonly",
"toIterable": "readonly",
"stringReverse": "readonly",
"promiseTimeout": "readonly",
"parseUrl": "readonly",

View File

@ -67,22 +67,6 @@ function escapeRegExp(string) {
return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&');
}
// toIterable is required on Edge for cross-window origin objects.
function toIterable(value) {
if (typeof Symbol !== 'undefined' && typeof value[Symbol.iterator] !== 'undefined') {
return value;
}
if (value !== null && typeof value === 'object') {
const length = value.length;
if (typeof length === 'number' && Number.isFinite(length)) {
return Array.from(value);
}
}
throw new Error('Could not convert to iterable');
}
function stringReverse(string) {
return string.split('').reverse().join('').replace(/([\uDC00-\uDFFF])([\uD800-\uDBFF])/g, '$2$1');
}