global: renames and fixes

This commit is contained in:
nym21
2025-07-08 21:33:18 +02:00
parent 8cc1f8d691
commit f45fb6efe6
39 changed files with 2355 additions and 2270 deletions

View File

@@ -61,17 +61,34 @@ export const VERSION = \"v{VERSION}\";
);
contents += "
/** @typedef {ReturnType<typeof createVecIdToIndexes>} VecIdToIndexes
/** @typedef {keyof VecIdToIndexes} VecId */
/** @typedef {ReturnType<typeof createIndexes>} Indexes */
export function createIndexes() {
return {
";
contents += &indexes
.iter()
.enumerate()
.map(|(i_of_i, i)| {
let lowered = i.to_string().to_lowercase();
format!(" {lowered}: /** @satisfies {{{i}}} */ ({i_of_i}),",)
})
.collect::<Vec<_>>()
.join("\n");
contents += " };\n}\n";
contents += "
/** @typedef {ReturnType<typeof createVecIdToIndexes>} VecIdToIndexes
/** @typedef {keyof VecIdToIndexes} VecId */
/**
* @returns {Record<any, number[]>}
*/
export function createVecIdToIndexes() {\n";
contents += " return {\n";
export function createVecIdToIndexes() {
return {
";
self.id_to_index_to_vec()
.iter()