diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-10-30 19:26:23 -0700 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-10-30 19:26:23 -0700 |
commit | 40752982da07ff05001129e26f3ea1bca39c7ad9 (patch) | |
tree | 57ef81428b1595974e01fc8a7d21f6d6e2991d7c /src/lib | |
parent | 68c809b09a056fd5e28f15fe6a114dfbb8295ba4 (diff) | |
parent | 7fa0708e0e471c6c04864400f7e212147ba73765 (diff) | |
download | voidsky-40752982da07ff05001129e26f3ea1bca39c7ad9.tar.zst |
Merge branch 'main' of https://github.com/haideralipunjabi/social-app into main
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/constants.ts | 1 | ||||
-rw-r--r-- | src/lib/strings/helpers.ts | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 81a6d4e77..472b59d76 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -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 diff --git a/src/lib/strings/helpers.ts b/src/lib/strings/helpers.ts index ef93a366f..381ae32f3 100644 --- a/src/lib/strings/helpers.ts +++ b/src/lib/strings/helpers.ts @@ -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 +} |