| 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\//, ''); |