docs: update README, add some more jsdoc

This commit is contained in:
Andy Burke 2025-07-15 00:15:28 -07:00
parent 22a8b4d03f
commit 55a73c3d0a
10 changed files with 155 additions and 30 deletions

View file

@ -1,3 +1,13 @@
/**
* FSDB Organizer: By Phone
*
* Organizes by splitting a phone number into its components:
*
* Eg: 1-213-555-1234 => 1/213/555/213-555-1234.json
*
* @module
*/
import sanitize from '../utils/sanitize.ts';
const PHONE_REGEX =
@ -22,9 +32,6 @@ export default function by_phone(phone: string): string[] {
const normalized_number = `${sanitize(area_code)}-${sanitize(central_office_code)}-${sanitize(subscriber_code)}`;
// for example, a symlinking index based on this organizer might look like:
// fsdb root index country_code office_code area_code phone
// /path/to/db/root/.indexes/phone/1/213/555/213-555-1234
return [
sanitize(country_code ?? '1'),
sanitize(area_code),