Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

checkit

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkit - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

browser.js

15

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc