MCPcopy
hub / github.com/google/earthengine-api / convertAlgorithm

Function convertAlgorithm

javascript/src/encodable.js:347–366  ·  view source on GitHub ↗
(algorithm)

Source from the content-addressed store, hash-verified

345 return internalArgument;
346 };
347 const convertAlgorithm = (algorithm) => {
348 const internalAlgorithm = {};
349 internalAlgorithm['args'] =
350 (algorithm.arguments || []).map(convertArgument);
351 internalAlgorithm['description'] = algorithm.description || '';
352 internalAlgorithm['returns'] = algorithm.returnType || '';
353 if (algorithm.hidden != null) {
354 internalAlgorithm['hidden'] = algorithm.hidden;
355 }
356 if (algorithm.preview) {
357 internalAlgorithm['preview'] = algorithm.preview;
358 }
359 if (algorithm.deprecated) {
360 internalAlgorithm['deprecated'] = algorithm.deprecationReason;
361 }
362 if (algorithm.sourceCodeUri) {
363 internalAlgorithm['sourceCodeUri'] = algorithm.sourceCodeUri;
364 }
365 return internalAlgorithm;
366 };
367 const internalAlgorithms = {};
368 for (const algorithm of result.algorithms || []) {
369 const name = algorithm.name.replace(/^algorithms\//, '');

Callers 1

encodable.jsFile · 0.85

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected