MCPcopy Create free account
hub / github.com/bpk68/g-sheets-api / gsheetProcessor

Function gsheetProcessor

src/gsheetsprocessor.js:125–152  ·  view source on GitHub ↗
(options, callback, onError)

Source from the content-addressed store, hash-verified

123}
124
125const gsheetProcessor = function (options, callback, onError) {
126 const {apiKey, sheetId, sheetName, sheetNumber, returnAllResults, filter, filterOptions} = options
127
128 if(!options.apiKey || options.apiKey === undefined) {
129 throw new Error('Missing Sheets API key');
130 }
131
132 return GSheetsapi({
133 apiKey,
134 sheetId,
135 sheetName,
136 sheetNumber
137 })
138 .then(result => {
139 const filteredResults = processGSheetResults(
140 result,
141 returnAllResults || false,
142 filter || false,
143 filterOptions || {
144 operator: 'or',
145 matching: 'loose'
146 }
147 );
148
149 callback(filteredResults);
150 })
151 .catch(err => onError(err.message));
152};
153
154export default gsheetProcessor;

Callers

nothing calls this directly

Calls 1

processGSheetResultsFunction · 0.85

Tested by

no test coverage detected