about summary refs log tree commit diff
path: root/src/state/lib/type-guards.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/lib/type-guards.ts')
-rw-r--r--src/state/lib/type-guards.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/state/lib/type-guards.ts b/src/state/lib/type-guards.ts
index 4ae31f3ac..8fe651ffb 100644
--- a/src/state/lib/type-guards.ts
+++ b/src/state/lib/type-guards.ts
@@ -8,3 +8,7 @@ export function hasProp<K extends PropertyKey>(
 ): data is Record<K, unknown> {
   return prop in data
 }
+
+export function isStrArray(v: unknown): v is string[] {
+  return Array.isArray(v) && v.every(item => typeof item === 'string')
+}