This commit is contained in:
Paul Frazee 2023-10-30 19:26:23 -07:00
commit 40752982da
6 changed files with 64 additions and 5 deletions

View file

@ -147,3 +147,4 @@ export const HITSLOP_10 = createHitslop(10)
export const HITSLOP_20 = createHitslop(20)
export const HITSLOP_30 = createHitslop(30)
export const BACK_HITSLOP = HITSLOP_30
export const MAX_POST_LINES = 25

View file

@ -32,3 +32,8 @@ export function toHashCode(str: string, seed = 0): number {
return 4294967296 * (2097151 & h2) + (h1 >>> 0)
}
export function countLines(str: string | undefined): number {
if (!str) return 0
return str.match(/\n/g)?.length ?? 0
}