Releases: umayr/uranus
Release list
The Hunter Amazon
Change Log:
This release adds a new feature to generate validation error messages with name.
Before this, Uranus supported only subjectless messages. For e.g:
var rules = {
isEmail: true
};
Uranus.validateOne('foo@..!!.com', rules);
// ['should be a valid email address.']Now, theres a way to provide name and get complete error messages, like:
var rules = {
isEmail: true
};
Uranus.validateOne({value: 'foo@..!!.com', name: 'Foo'}, rules);
// ['Foo should be a valid email address.']The functionality is backward compatible meaning it should work either way
if I provide a name or not.
For validateAll, the name can be defined with name property, like:
var result = Uranus.validateAll([
{
value: 'foo',
name: 'Foo',
rules: {
isEmail: true
}
}
], {
includeName: true
});
// ['Foo should be a valid email address.']There is an option to turn this off with a flag like includeName.
The default value is true but if you don't provide a name it should
generate subjectless message.
The less elegant while providing an object is:
var src = {
email: {
name: 'Foo',
value: 'foo@!!!.com'
}
};
var rules = {
email: {
isEmail: true
}
}
Uranus.validateAll(src, rules);
// ['Foo should be a valid email address.']The Mammoth General Lord
Change Log:
v1.4.1 doesn't bring a lot to the table but a very hot fix.
Fixes:
- #15 - Validity issues.
The Orange Sniper Shadow
Changes from Previous Release - The Yellow Raccoon Cat
The Yellow Raccoon Cat
Changes from Previous Release - The Infamous Beetle
- Removal of old
lib/folder along withJSCS&JSHintconfigs. - Addition of
dist/folder to be ignored bygit. - Removal of stupid
grunt. src/folder to be ignored bynpm.- Updated unit tests. They're now in ES6. ;3
- Several changes in
package.json:- Removed grunt & its dependencies.
- Added scripts. (prepublish, pretest, build, test, eslint)
- Added babel, babel-runtime & eslint
- Updated test script. Now, mocha runs with Babel.
- Whole new source in ES6.
- Fixed #5
- New structure:
- src/
- classes/ # contains all classes.
- utils/ # contains extensions and other minor utility methods.
The Infamous Beetle
First major release. 🎉
Changes from previous release - The Crimson Hammer:
No drastic changes has been made since last release but a few worth mentioning points:
- Separated core functionality from main
index.js. - Moved extension methods into a separate file and added documentation for each of them.
Note: None of the previous functionality has been effected by these refactoring.
The Crimson Hammer
Added a new extension method
There is an addition of new extention method optional which takes two multiple parameters. It first checks whether or not the provided input is null if its not then it applies the second validation rule that is provided as the first parameter with rest of the params as its arguments.
Pretty helpful when you want to apply validation only when the value is not null, empty or undefined.
Converted from object to array
Returning items is now an array rather than obnoxious index based object.
Add progressive option
When true it will iterate through provided rules for a value but stop when there is only one invalid rule.
Cherry and Peanut Pie
Changed the way it keeps track of all values and rules according to their indexes rather then value name. Because it was useless in case of empty values.
Infused Rosemary & Onion Moussaka
Chocolate and Licorice Soufflé
- Added
notNullextension method.