UNPKG

507 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.extractDocumentStringFromCodeFile = function (fileContent) {
4 var matches = fileContent.match(/gql`([\s\S\n\r.]*?)`/gm);
5 if (matches === null) {
6 matches = fileContent.match(/(['"](query|subscription|fragment|mutation) .*?['"])/gm);
7 }
8 return (matches || []).map(function (item) { return item.replace(/\$\{.*?\}/g, '').replace(/(gql|`)/g, ''); }).join();
9};
10//# sourceMappingURL=document-finder.js.map
\No newline at end of file