Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkochan/dfun
Optional parameters, default values and type-checking for your JavaScript method signatures
https://github.com/zkochan/dfun
Last synced: 29 days ago
JSON representation
Optional parameters, default values and type-checking for your JavaScript method signatures
- Host: GitHub
- URL: https://github.com/zkochan/dfun
- Owner: zkochan
- License: mit
- Created: 2015-03-29T16:34:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-11-25T19:48:39.000Z (about 8 years ago)
- Last Synced: 2024-11-25T08:40:58.414Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dfun
Optional parameters, default values and type-checking for your JavaScript method signatures##Example
Lets creata a function that can accept 3 parameters one of which is optional.
```js
var foo = dfun(Number, [String, 'bar'], Number, function (a, b, c) {
console.log(a + b + c);
});foo(1, 'baz', 2); // outputs 1 baz 2
foo(1, 2); // outputs 1 bar 2
```License
========The MIT License (MIT)