Skip to content
This repository has been archived by the owner on May 14, 2023. It is now read-only.

Commit

Permalink
v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Pigulla committed Sep 26, 2014
1 parent 083c7c2 commit 8b2ac78
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var data = JSON.parse(rawData);
try {
signUpValidator(data);
} catch (e) {
console.warn('Data is invalid: ' + e.message);
console.warn(e.toString());
}
```
But they can of course get more complex by logically combining conditions or nesting validation structures. Please take a look at our [wiki](https://github.com/pigulla/lewd/wiki) for a thorough introduction how to use lewd and its many features.
Expand All @@ -45,7 +45,7 @@ But they can of course get more complex by logically combining conditions or nes
- runs in browsers as an [UMD](https://github.com/umdjs/umd) module (experimental)

### Contributing
You found a bug, fixed a typo or came up with a cool new feature? Feel free to open issues or send pull requests and I'll do my best to merge them. Please make sure you add tests as needed and reference the issue number in your commit (please open one if necessary). Bonus points are awarded for not breaking any JSHint and JSCS rules (`grunt test-local` is your friend).
You found a bug, fixed a typo or came up with a cool new feature? Feel free to open issues or send pull requests and I'll do my best to merge them. Please make sure you add tests as needed and reference the issue number in your commit (please open one if necessary). Pull requests must not break any JSHint and JSCS rules or let the test coverage drop below 100% (`npm test` is your friend).

### License
lewd is licensed under the BSD 2-Clause License. You can find it in the [LICENSE](LICENSE) file.
12 changes: 12 additions & 0 deletions test/misc/wiki-examples-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,17 @@ buster.testCase('wiki examples', {

post.allOptional();
}, 'ConditionLockedException');
},
'default values in FAQ': function () {
var condition = lewd({
x: lewd(Array).optional().default([])
});

var value1 = condition({});
value1.x.push(42);
assert.equals(value1, { x: [42] });

var value2 = condition({});
assert.equals(value2, { x: [42] });
}
});

0 comments on commit 8b2ac78

Please sign in to comment.