UNPKG

sd-is

Version:

Tiny JavaScript type check utility functions with smart developer-friendly feedback.

10 lines (9 loc) 280 B
export default function isString(value) { const ok = typeof value === 'string'; return { ok: ok, verdict: ok ? "✅ Value is a string." : "❌ Not a string.", reason: ok ? null : `Expected type "string", got "${typeof value}".`, fix: () => '', }; }