divedex
v0.0.2
Published
Diving Index for all FINA dives
Readme
divedex
A small TypeScript library that provides a searchable catalog of competitive dive codes and names.
Install
Install from npm:
npm install divedexQuick usage
Import from the package (ESM/TypeScript):
import {
getAllDives,
getAllPositions,
getDivesByApproach,
getPositionName,
getDiveName,
getDiveNameWithPosition,
} from 'divedex';
// list all dives
const all = getAllDives();
console.log(`Total dives: ${all.length}`);
// list dives for an approach
const forward = getDivesByApproach('forward');
// lookup a dive name by number
const name = getDiveName('101');
// lookup position name (case-insensitive)
const pos = getPositionName('a');
// combined lookup: dive + position
const combo = getDiveNameWithPosition('101', 'A');
if (combo) console.log(`${combo.diveName} — ${combo.positionName}`);
API
Exports match the functions in src/utils/getDives.ts:
getAllDives(): Dive[]getAllPositions(): Position[]getDivesByApproach(approach: string): Dive[]getPositionName(positionCode: string): string | nullgetDiveName(diveNumber: string): string | nullgetDiveNameWithPosition(diveNumber: string, positionCode: string): { diveName: string; positionName: string } | null
License
MIT
