MCPcopy Index your code
hub / github.com/ethereum/node-crawler / queryData

Function queryData

frontend/src/data/DataProcessor.ts:249–337  ·  view source on GitHub ↗
(options: Option = {}, filters?: Filter[])

Source from the content-addressed store, hash-verified

247 }
248
249 const queryData = (options: Option = {}, filters?: Filter[]): ClientResponse => {
250
251 const convert = (a: [string, number]) => ({
252 name: a[0],
253 count: a[1]
254 })
255
256 const versionToString = (version: Version): string => {
257 let versionString = '' + version.major
258
259 if (version.minor !== undefined) {
260 versionString += '.' + version.minor
261 }
262
263 if (version.patch !== undefined) {
264 versionString += '.' + version.patch
265 }
266
267 if (version.tag !== undefined) {
268 versionString += '-' + version.tag
269 }
270
271 return versionString
272 }
273
274 const runtimeToString = (runtime: Runtime): string => {
275 let runtimeString = ''
276
277 if (runtime.name) {
278 runtimeString += runtime.name
279 }
280
281 if (options.showRuntimeVersion && runtime.version) {
282 runtimeString += versionToString(runtime.version)
283 }
284
285 return runtimeString
286 }
287
288 const operatingSystemToString = (os: OperatingSytem): string => {
289 let osString = []
290
291 if (os.vendor) {
292 osString.push(os.vendor)
293 }
294
295 if (options.showOperatingSystemArchitecture && os.architecture) {
296 osString.push(os.architecture)
297 }
298
299 return osString.join('-')
300 }
301
302 const cache = {
303 clients: SortedMap<string, number>((a, b) => b[1] - a[1]),
304 versions: SortedMap<string, number>((a, b) => b[1] - a[1]),
305 runtimes: SortedMap<string, number>((a, b) => b[1] - a[1]),
306 operatingSystems: SortedMap<string, number>((a, b) => b[1] - a[1])

Callers

nothing calls this directly

Calls 7

SortedMapFunction · 0.90
matchesFiltersFunction · 0.85
versionToStringFunction · 0.85
runtimeToStringFunction · 0.85
operatingSystemToStringFunction · 0.85
setMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected