https://github.com/caiogondim/strict-dict.js
Object (dictionary) that throws TypeError when trying to get an undefined property.
https://github.com/caiogondim/strict-dict.js
Last synced: 3 months ago
JSON representation
Object (dictionary) that throws TypeError when trying to get an undefined property.
- Host: GitHub
- URL: https://github.com/caiogondim/strict-dict.js
- Owner: caiogondim
- License: mit
- Created: 2017-12-06T14:53:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-04T17:46:17.000Z (about 7 years ago)
- Last Synced: 2025-02-25T11:41:33.881Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# strict-dict
![]()
![]()
![]()
Object (dictionary) that throws `TypeError` when trying to get an undefined property.
## Installation
```
npm install strict-dict -S
```## Usage
```js
const obj = strictDict({
a: 1,
b: 2
})obj.a // -> 1
obj.b // -> 2
obj.c // -> throws TypeError, since c is undefined
```## Credits
- Icon by Thomas Helbig from the Noun Project---
[caiogondim.com](https://caiogondim.com) ·
GitHub [@caiogondim](https://github.com/caiogondim) ·
Twitter [@caio_gondim](https://twitter.com/caio_gondim)