UNPKG

fontoxpath

Version:

A minimalistic XPath 3.1 engine in JavaScript

14 lines (13 loc) 270 B
import { DONE_TOKEN, ready } from './iterators'; export default function createSingleValueIterator (onlyValue) { let hasPassed = false; return { next: () => { if (hasPassed) { return DONE_TOKEN; } hasPassed = true; return ready(onlyValue); } }; }