Function
get
(identifier: string|LossOrMetricFn)
Source from the content-addressed store, hash-verified
| 147 | }; |
| 148 | |
| 149 | export function get(identifier: string|LossOrMetricFn): LossOrMetricFn { |
| 150 | if (typeof identifier === 'string' && identifier in metricsMap) { |
| 151 | return metricsMap[identifier]; |
| 152 | } else if (typeof identifier !== 'string' && identifier != null) { |
| 153 | return identifier; |
| 154 | } else { |
| 155 | throw new ValueError(`Unknown metric ${identifier}`); |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Get the shortcut function name. |
Tested by
no test coverage detected