the name of the column in the table that will be assigned to the 'default' property of each entry.
the names of properties you want in the generated lookup table. This must be a subset of the columns of the tables except for the name 'default' which is looked from the previous argument.
the names of the columns of the name
the default value by column for any element in a row of the table that is undefined
named table rows.
Generated using TypeDoc
Creates an info lookup object from a more nicely-formatted table.
Note: Using
as const
on the arguments to this function is necessary to infer the correct type.Example:
MAINTENANCE_TODO:
ZipKeysWithValues<Members, Table[k], Defaults>
is incorrect because Members no longer maps to Table[k]. It's not clear if this is even possible to fix because it requires mapping, not zipping. Maybe passing in a index mapping would fix it (which is gross) but if you have columnsKept as [0, 2, 3] then maybe it would be possible to generate the correct type? I don't think we can generate the map at compile time so we'd have to hand code it. Other ideas, don't generate kLimitsInfoCore and kLimitsInfoCompat where they are keys of infos. Instead, generate kLimitsInfoCoreDefaults, kLimitsInfoCoreMaximums, kLimitsInfoCoreClasses where each is just a{[k: string]: type}
. Could zip those after or, maybe that suggests passing in the hard coded indices would work.