function loadTypedefs(pointerOrPointers, options) {
    return tslib.__awaiter(this, void 0, void 0, function () {
        var pointerOptionMap, globOptions, sources, validSources, limit;
        return tslib.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    pointerOptionMap = normalizePointers(pointerOrPointers);
                    globOptions = {};
                    applyDefaultOptions(options);
                    return [4 /*yield*/, collectSources({
                            pointerOptionMap: pointerOptionMap,
                            options: options,
                        })];
                case 1:
                    sources = _a.sent();
                    validSources = [];
                    limit = useLimit(CONCURRENCY_LIMIT$1);
                    return [4 /*yield*/, Promise.all(sources.map(function (partialSource) {
                            return limit(function () {
                                return parseSource({
                                    partialSource: partialSource,
                                    options: options,
                                    globOptions: globOptions,
                                    pointerOptionMap: pointerOptionMap,
                                    addValidSource: function (source) {
                                        validSources.push(source);
                                    },
                                });
                            });
                        }))];
                case 2:
                    _a.sent();
                    return [2 /*return*/, prepareResult({ options: options, pointerOptionMap: pointerOptionMap, validSources: validSources })];
            }
        });
    });
}
/**
 * Asynchronously loads any GraphQL documents (i.e. executable documents like
 * operations and fragments as well as type system definitions) from the
 * provided pointers.
 * @param pointerOrPointers Pointers to the sources to load the documents from
 * @param options Additional options
 */
Asynchronously loads any GraphQL documents  from the
provided pointers.
@param pointerOrPointers Pointers to the sources to load the documents from
@param options Additional options
Asynchronously loads any GraphQL documents from the provided pointers . @param pointerOrPointers Pointers to the sources to load the documents from @param options Additional options
function loadTypedefs(pointerOrPointers, options) {
    return tslib.__awaiter(this, void 0, void 0, function () {
        var pointerOptionMap, globOptions, sources, validSources, limit;
        return tslib.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    pointerOptionMap = normalizePointers(pointerOrPointers);
                    globOptions = {};
                    applyDefaultOptions(options);
                    return [4 , collectSources({
                            pointerOptionMap: pointerOptionMap,
                            options: options,
                        })];
                case 1:
                    sources = _a.sent();
                    validSources = [];
                    limit = useLimit(CONCURRENCY_LIMIT$1);
                    return [4 , Promise.all(sources.map(function (partialSource) {
                            return limit(function () {
                                return parseSource({
                                    partialSource: partialSource,
                                    options: options,
                                    globOptions: globOptions,
                                    pointerOptionMap: pointerOptionMap,
                                    addValidSource: function (source) {
                                        validSources.push(source);
                                    },
                                });
                            });
                        }))];
                case 2:
                    _a.sent();
                    return [2 , prepareResult({ options: options, pointerOptionMap: pointerOptionMap, validSources: validSources })];
            }
        });
    });
}
function loadTypedefs ( pointerOrPointers , options ) { return tslib . __awaiter ( this , void 0 , void 0 , function ( ) { var pointerOptionMap , globOptions , sources , validSources , limit ; return tslib . __generator ( this , function ( _a ) { switch ( _a . label ) { case 0 : pointerOptionMap = normalizePointers ( pointerOrPointers ) ; globOptions = { } ; applyDefaultOptions ( options ) ; return [ 4 , collectSources ( { pointerOptionMap : pointerOptionMap , options : options , } ) ] ; case 1 : sources = _a . sent ( ) ; validSources = [ ] ; limit = useLimit ( CONCURRENCY_LIMIT$1 ) ; return [ 4 , Promise . all ( sources . map ( function ( partialSource ) { return limit ( function ( ) { return parseSource ( { partialSource : partialSource , options : options , globOptions : globOptions , pointerOptionMap : pointerOptionMap , addValidSource : function ( source ) { validSources . push ( source ) ; } , } ) ; } ) ; } ) ) ] ; case 2 : _a . sent ( ) ; return [ 2 , prepareResult ( { options : options , pointerOptionMap : pointerOptionMap , validSources : validSources } ) ] ; } } ) ; } ) ; }
Asynchronously loads any GraphQL documents (i.e.
Asynchronously loads any GraphQL documents ( i . e .
/*yield*/ /*yield*/ /*return*/