UNPKG

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