mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-06 22:04:06 +00:00
13 lines
410 B
TypeScript
13 lines
410 B
TypeScript
/**
|
|||
|
|
* The value of a trackpoint for a category of the engine (surface, highway): `codes` has one entry
|
||
|
|
* per trackpoint, 0 when the value is unknown, else 1 + the index of the value in `names`.
|
||
|
|
*/
|
||
|
|
export function categoryAt(
|
||
|
|
codes: ArrayLike<number>,
|
||
|
|
names: readonly string[],
|
||
|
|
index: number
|
||
|
|
): string | undefined {
|
||
|
|
const code = codes[index];
|
||
|
|
return code ? names[code - 1] : undefined;
|
||
|
|
}
|