routie dev init since i didn't adhere to any proper guidance up until now

This commit is contained in:
2026-04-29 22:27:29 -06:00
commit e1dabb71e2
15301 changed files with 3562618 additions and 0 deletions
@@ -0,0 +1,30 @@
/**
* Converts a boolean value to a sort direction multiplier.
*
* Used in sorting functions to convert boolean comparisons into numeric values
* suitable for array sort callbacks. This allows for concise expression of sort
* direction logic.
*
* @example
*
* ```ts
* // In ascending sort
* convertBooleanToSign(true) // Returns: 1
* convertBooleanToSign(false) // Returns: -1
* ```
*
* @example
*
* ```ts
* // Usage in sorting
* const sortMultiplier = convertBooleanToSign(order === 'asc')
* return sortMultiplier * (a - b)
* ```
*
* @param value - Boolean value to convert to a sign.
* @returns 1 if value is true, -1 if value is false.
*/
function convertBooleanToSign(value) {
return value ? 1 : -1
}
export { convertBooleanToSign }