https://github.com/hejny/unundefined
Proxies an object so that non of the properties will be undefined.
https://github.com/hejny/unundefined
draft library
Last synced: 7 months ago
JSON representation
Proxies an object so that non of the properties will be undefined.
- Host: GitHub
- URL: https://github.com/hejny/unundefined
- Owner: hejny
- License: other
- Created: 2022-06-12T10:57:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T08:31:10.000Z (7 months ago)
- Last Synced: 2025-03-10T09:39:44.929Z (7 months ago)
- Topics: draft, library
- Language: TypeScript
- Homepage:
- Size: 39.5 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 👻 Unundefined
[](https://www.npmjs.com/package/unundefined)
[](https://packagequality.com/#?package=unundefined)
[](https://github.com/hejny/unundefined/actions/workflows/lint.yml)
[](https://github.com/hejny/unundefined/actions/workflows/test.yml)
[](https://snyk.io/test/github/hejny/unundefined)
[](https://github.com/hejny/unundefined/issues)
[](https://socket.dev/npm/package/unundefined)Proxies an object so that non of the properties will be undefined.
[](https://www.midjourney.com/app/jobs/0a64d1f9-79db-48cb-b789-6253491840eb)
## Usage
```bash
npm i unundefined
``````typescript
import { unundefined } from 'unundefined';const fakeWindow = unundefined(window);
console.log(fakeWindow.contains.everything.you.want);
console.log(fakeWindow.alert /* ... but also existing stuff as usual */);
```_See more examples in [simple tests](./src/unundefined.test.ts)._
## 🖋️ Contributing
I am open to pull requests, feedback, and suggestions. Or if you like this utility, you can [☕ buy me a coffee](https://www.buymeacoffee.com/hejny) or [donate via cryptocurrencies](https://github.com/hejny/hejny/blob/main/documents/crypto.md).
You can also ⭐ star the unundefined package, [follow me on GitHub](https://github.com/hejny) or [various other social networks](https://www.pavolhejny.com/contact/).
## ✨ Partners
[Become a partner](https://www.pavolhejny.com/contact/)