New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kommissar

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kommissar - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

6

package.json
{
"author": "Mark Engel <mark.c.engel@gmail.com> (http://engel.cx)",
"author": "Mark Engel <mark@engel.io> (http://www.engel.io)",
"name": "kommissar",
"version": "1.0.9",
"version": "1.0.10",
"main": "src/index",
"dependencies": {
"underscore": "1.3.3",
"underscore": "1.4.2",
"async": "0.1.22",

@@ -9,0 +9,0 @@ "hashish": "0.0.4"

@@ -29,3 +29,5 @@ Kommissar

customRule = (objectToValidate, parameter0, ..., parameterN)
```coffeescript
customRule = (objectToValidate, parameter0, ..., parameterN)
```

@@ -39,14 +41,16 @@ which should return a boolean value

userRule = (check)
# simple rule
check('email').isEmail()
# optional error messages are supported
check('password', 'Your Password is too short.').len 8
# rule are chainable
check('string').len(8,64).isAlpha()
# check if a field is valid in dependency on another field
# this rule makes sense if the user wants to edit its
# profile and the rule has to check if *no other* user
# has this email
check.('email').isUnique().with('id')
```coffeescript
userRule = (check)
# simple rule
check('email').isEmail()
# optional error messages are supported
check('password', 'Your Password is too short.').len 8
# rule are chainable
check('string').len(8,64).isAlpha()
# check if a field is valid in dependency on another field
# this rule makes sense if the user wants to edit its
# profile and the rule has to check if *no other* user
# has this email
check.('email').isUnique().with('id')
```

@@ -65,5 +69,7 @@ Rules should be stored in a single file that is made available to the

app.post '/route',
kommissar.middleware() userRule,
updateModelWithNewDataMiddleware
```coffeescript
app.post '/route',
kommissar.middleware() userRule,
updateModelWithNewDataMiddleware
```

@@ -76,3 +82,5 @@

kommissar.middleware = (validations, failureMiddleware, successMiddleware)
```coffeescript
kommissar.middleware = (validations, failureMiddleware, successMiddleware)
```

@@ -98,4 +106,6 @@ `validations` are the available validations.

form = $ '#form'
kommissar.clientValidate form, validations, rule, callback
```coffeescript
form = $ '#form'
kommissar.clientValidate form, validations, rule, callback
```

@@ -102,0 +112,0 @@ Enables the form `#form` for the validation.

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