MCPcopy Create free account
hub / github.com/ampproject/amphtml / createCommonIterator

Function createCommonIterator

build-system/tasks/e2e/driver/query-xpath.js:141–146  ·  view source on GitHub ↗

* Create an iterator from an object with iterator-like behavior but a * different API name for the iteration method. * @template T * @param {!NodeIterator|!XPathResult} iterator * @param {string} nextProperty * @return {!Iterable }

(iterator, nextProperty)

Source from the content-addressed store, hash-verified

139 * @return {!Iterable<T>}
140 */
141function* createCommonIterator(iterator, nextProperty) {
142 let item;
143 while (Boolean((item = iterator[nextProperty]()))) {
144 yield item;
145 }
146}
147
148/**
149 * Create an iterator from an existing iterator, which nests the original

Callers 2

createElementIteratorFunction · 0.85
createXpathIteratorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected