export function createPromiseQueue(items, pGenerator) {
    return function () {
        return items.reduce(function (prevP, item) {
            return prevP.then(function () { return pGenerator(item); });
        }, Promise.resolve());
    };
}
export function execPromiseQueue(items, pGenerator) {
    return createPromiseQueue(items, pGenerator)();
}
