feat: wip

This commit is contained in:
David Nguyen
2023-12-27 13:04:24 +11:00
parent f7cf33c61b
commit 9d626473c8
140 changed files with 9604 additions and 536 deletions

View File

@ -0,0 +1,17 @@
// Common util functions for parsing params.
/**
* From an unknown string, parse it into a number array.
*
* Filter out unknown values.
*/
export const parseToNumberArray = (value: unknown): number[] => {
if (typeof value !== 'string') {
return [];
}
return value
.split(',')
.map((value) => parseInt(value, 10))
.filter((value) => !isNaN(value));
};