fsdb/organizers/by_lurid.ts

19 lines
540 B
TypeScript
Raw Normal View History

2025-06-13 20:40:28 -07:00
import sanitize from '../utils/sanitize.ts';
export default function by_lurid(id: string): string[] {
// Replace invalid filename characters and leading dots
const sanitized_id = sanitize(id);
// assuming a lurid, eg: able-fish-cost-them-post-many-form-hope-wife-born
// ./able-fish-cost-them/able-fish-cost-them-post-many-form/able-fish-cost-them-post-many-form-hope-wife-born.json
const result: string[] = [
sanitized_id.slice(0, 14),
sanitized_id.slice(0, 34),
sanitized_id,
`${sanitized_id}.json`
];
return result;
}