Comparing version 0.5.1 to 0.6.0
{ | ||
"name": "checkit", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "Simple validations for node and the browser.", | ||
"main": "checkit.js", | ||
"main": "server.js", | ||
"browser": "browser.js", | ||
"scripts": { | ||
"test": "mocha -R spec test/index.js", | ||
"build": "npm run build:main && npm run build:dist", | ||
"build:main": "webpack --output-library Checkit --output-library-target umd checkit.js dist/checkit.js", | ||
"build:dist": "webpack --output-library Checkit --output-library-target umd --optimize-minimize checkit.js dist/checkit.min.js" | ||
"build:main": "webpack --output-library Checkit --output-library-target umd browser.js dist/checkit.js", | ||
"build:dist": "webpack --output-library Checkit --output-library-target umd --optimize-minimize browser.js dist/checkit.min.js" | ||
}, | ||
@@ -16,6 +17,6 @@ "directories": { | ||
"dependencies": { | ||
"create-error": ">=0.2.1", | ||
"bluebird": "^2.9.14", | ||
"inherits": "^2.0.1", | ||
"lodash": ">=2.0", | ||
"when": "^3.7.2" | ||
"lodash": "^2.4.0 || ^3.0.0", | ||
"when": "^3.0.0" | ||
}, | ||
@@ -22,0 +23,0 @@ "devDependencies": { |
@@ -5,3 +5,3 @@ # Checkit.js | ||
It supports both sync | ||
It supports both sync | ||
@@ -45,3 +45,3 @@ It allows you to seamlessly validate full javascript objects, defining custom messages, labels, and validations, with full support for asynchronous validations with promises. It supports [conditional validations](#conditional-validations), and has powerful, consistent [error structuring](#checkit-errors) and [utility methods](#error-utility-methods) for manipulating your errors' output any way you can imagine. | ||
Used to specify the default language key for using a particular language file, currently en and es are supported. | ||
Used to specify the default language key for using a particular language file, currently en, es, ru and fr are supported. | ||
@@ -121,3 +121,3 @@ ##### labels | ||
if (err) { | ||
} else { | ||
@@ -394,3 +394,3 @@ // ... | ||
} | ||
return query.where('email', '=', val) | ||
@@ -408,6 +408,6 @@ .andWhere('id', '<>', this.target.id) | ||
Second, you may add a custom validator to the `Checkit.Validators` object, returning a boolean value or a promise. | ||
Second, you may add a custom validator to the `Checkit.Validator` object's prototype, returning a boolean value or a promise. | ||
```js | ||
Checkit.Validators.unused = function(val, table, column) { | ||
Checkit.Validator.prototype.unused = function(val, table, column) { | ||
return knex(table).where(column, '=', val).then(function(resp) { | ||
@@ -509,2 +509,8 @@ if (resp.length > 0) { | ||
### 0.6.0 | ||
- Separate codepath for server (bluebird) and client (when.js) | ||
- Add French and Russian translations. | ||
- Allow new longer top level domains in emails. | ||
### 0.5.1 | ||
@@ -511,0 +517,0 @@ |
global.Promise = require('bluebird'); | ||
global._ = require('lodash'); | ||
global.Checkit = require('../checkit'); | ||
global.Checkit = require('../server'); | ||
@@ -5,0 +5,0 @@ global.assert = require('assert'); |
@@ -292,11 +292,2 @@ describe('Checkit', function() { | ||
describe('Checkit.Error', function () { | ||
it('should be an instanceof Error', function () { | ||
var error = new Checkit.Error(Checkit()); | ||
equal((error instanceof Error), true); | ||
}); | ||
}); | ||
describe('custom validation objects', function() { | ||
@@ -303,0 +294,0 @@ |
@@ -66,3 +66,3 @@ describe('Checkit - sync', function() { | ||
var arr = Checkit({integer: ['between:0:10']}).runSync(testBlock) | ||
assert(arr[0] instanceof Error) | ||
assert(arr[0] instanceof Checkit.Error) | ||
}); | ||
@@ -131,3 +131,3 @@ | ||
}).runSync(testBlock) | ||
assert(arr[0] instanceof Error) | ||
assert(arr[0] instanceof Checkit.Error) | ||
}); | ||
@@ -150,3 +150,3 @@ | ||
}).runSync(testBlock) | ||
assert(arr[0] instanceof Error) | ||
assert(arr[0] instanceof Checkit.Error) | ||
}); | ||
@@ -282,11 +282,2 @@ | ||
describe('Checkit.Error', function () { | ||
it('should be an instanceof Error', function () { | ||
var error = new Checkit.Error(Checkit()); | ||
equal((error instanceof Error), true); | ||
}); | ||
}); | ||
describe('custom validation objects', function() { | ||
@@ -293,0 +284,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
529
11
11
1259639
34
21864
+ Addedbluebird@^2.9.14
+ Addedbluebird@2.11.0(transitive)
+ Addedlodash@3.10.1(transitive)
- Removedcreate-error@>=0.2.1
- Removedcreate-error@0.3.1(transitive)
- Removedlodash@4.17.21(transitive)
Updatedlodash@^2.4.0 || ^3.0.0
Updatedwhen@^3.0.0