uni-ticket-system/node_modules/core-js/modules/esnext.async-iterator.from.js

18 lines
814 B
JavaScript
Raw Normal View History

2023-12-05 02:11:10 +00:00
var $ = require('../internals/export');
var toObject = require('../internals/to-object');
var isPrototypeOf = require('../internals/object-is-prototype-of');
var getAsyncIteratorFlattenable = require('../internals/get-async-iterator-flattenable');
var AsyncIteratorPrototype = require('../internals/async-iterator-prototype');
var WrapAsyncIterator = require('../internals/async-iterator-wrap');
// `AsyncIterator.from` method
// https://github.com/tc39/proposal-async-iterator-helpers
$({ target: 'AsyncIterator', stat: true }, {
from: function from(O) {
var iteratorRecord = getAsyncIteratorFlattenable(typeof O == 'string' ? toObject(O) : O);
return isPrototypeOf(AsyncIteratorPrototype, iteratorRecord.iterator)
? iteratorRecord.iterator
: new WrapAsyncIterator(iteratorRecord);
}
});