MCPcopy Create free account
hub / github.com/ethereum/node-crawler / parseOs

Function parseOs

frontend/src/data/DataProcessor.ts:119–136  ·  view source on GitHub ↗
(os: string, parseOpt: ParseParam)

Source from the content-addressed store, hash-verified

117}
118
119function parseOs(os: string, parseOpt: ParseParam): OperatingSytem | undefined {
120 const match = matchAll(os, /(linux|windows|darwin|x86_64|x64|amd64)/g)
121 const matches = Array.from(match);
122
123 if (matches.length) {
124 const result: any = {};
125 matches.forEach((match) => {
126 const value = match[1];
127 const key = osMapping[value];
128 result[key] = value;
129 });
130
131 return result;
132 }
133
134 parseOpt.errorCallback('os', os, parseOpt.primaryKey);
135 return undefined;
136}
137
138function parseRuntime(runtime: string, parseOpt: ParseParam): Runtime | undefined {
139 const matches = runtime.match(/(?<name>[a-zA-Z]+)?-?(?<version>[\d+.?]+)/);

Callers 1

parseRawFunction · 0.85

Calls 1

forEachMethod · 0.80

Tested by

no test coverage detected