https://github.com/aleclarson/asserttypes
Throw a TypeError if a property is not its expected type(s)
https://github.com/aleclarson/asserttypes
Last synced: 12 months ago
JSON representation
Throw a TypeError if a property is not its expected type(s)
- Host: GitHub
- URL: https://github.com/aleclarson/asserttypes
- Owner: aleclarson
- License: mit
- Created: 2016-05-13T07:45:24.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-12-05T16:51:50.000Z (over 7 years ago)
- Last Synced: 2025-01-18T02:44:03.613Z (over 1 year ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# assertTypes v2.0.2 
Calls [`assertType`](https://github.com/aleclarson/assertType) on each key-value pair in an `Object`.
Does **not** support nested types.
```coffee
const assertTypes = require('assertTypes');
const types = {
foo: Number,
bar: String,
};
assertTypes(obj, types);
```