⚡ Introducing sd-is
– A Smarter Way to Handle Type Checks in JavaScript
“Do we really need another type-checking utility?”
Probably not.
But I built one anyway — and it might just save you some sanity.
🧩 What is sd-is
?
sd-is
is a tiny JavaScript utility library built to simplify common type-checks in a clean, expressive, and developer-friendly way.
It helps answer those everyday questions like:
- Is this object empty?
- Is this value undefined?
- Is this a plain object or something else?
No frills. Just clarity.
✅ Key Features
- Minimal API:
isEmptyObject
,isEmptyArray
,isPlainObject
,isUndefined
,isNotUndefined
- 🔍 New:
smartCheck
– returns a verdict, reason, and fix suggestion - Lightweight and zero dependencies
- Built by a developer, for developers
📦 Installation
npm install sd-is
🧪 Usage
1. Simple Type Checks
const { isEmptyObject, isUndefined } = require('sd-is');
console.log(isEmptyObject({})); // true
console.log(isUndefined(undefined)); // true
2. Smart Checks with Context
Want more than just true
or false
?
const { smartCheck } = require('sd-is');
const result = smartCheck.isPlainObject(new Date());
console.log(result.ok); // false
console.log(result.verdict); // ❌ Not a plain object
console.log(result.reason); // It's a Date object, not a literal
console.log(result.fix()); // returns {}
Perfect for debugging, logging, and validation logic.
🤔 Why I Built It
I was tired of writing the same verbose checks every day:
typeof x !== 'undefined' && x !== null && Object.keys(x).length === 0
So I decided to make something that felt easier and more readable — and then added smartCheck
to give context and optional fallbacks too.
This isn’t a groundbreaking package, and it’s not trying to replace Lodash — it’s just a developer-first tool I wanted to exist.
🌱 What’s Next?
I'm planning to expand the smart check library with:
- Type-safe checks (boolean, string, number, etc.)
- Customizable
fix()
functions - CLI helper for validating data
🔗 Links
- 📦 NPM: sd-is
- 💻 GitHub: sandeepdara-sd/sd-is
💬 Feedback?
If you try it, I’d love your thoughts!
Feel free to open an issue or drop feedback on GitHub.
🧑💻 Built by Sandeep Dara
Just a developer sharing something I found useful — maybe it’ll help you too.
npm install sd-is
One package, many checks. Clean code, happy dev.
Top comments (0)