MCPcopy Create free account
hub / github.com/alephdata/aleph / parseQueryText

Function parseQueryText

ui/src/components/AdvancedSearch/util.js:45–56  ·  view source on GitHub ↗
(queryText)

Source from the content-addressed store, hash-verified

43];
44
45export const parseQueryText = (queryText) => {
46 const parsedResults = {};
47 let qt = queryText;
48
49 [...FIELDS].reverse().forEach(({ key, re, process }) => {
50 const matches = qt.match(re) || [];
51 parsedResults[key] = matches.map(process).flat();
52 qt = qt.replace(re, '');
53 });
54
55 return parsedResults;
56};
57
58export const composeQueryText = (queryParts) => {
59 return FIELDS.map(({ key, compose }) => {

Callers 1

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected