accountdown-parser
Advanced tools
Comparing version 0.1.1 to 0.1.2
19
index.js
var extend = require('extend') | ||
var formBody = require('body/any') | ||
//var formBody = require('body/form') | ||
module.exports = forms2accounts | ||
module.exports = accountdown-parser | ||
function forms2accounts (accountdown, opts) { | ||
if (!(this instanceof forms2accounts)) { | ||
return new forms2accounts(accountdown, opts) | ||
function accountdown-parser (accountdown, opts) { | ||
if (!(this instanceof accountdown-parser)) { | ||
return new accountdown-parser(accountdown, opts) | ||
} | ||
@@ -29,3 +28,3 @@ if (!opts) opts = {}; | ||
forms2accounts.prototype.create = function (req, res, cb) { | ||
accountdown-parser.prototype.create = function (req, res, cb) { | ||
var self = this; | ||
@@ -36,6 +35,6 @@ | ||
// { login: {...}, value: {key: .., ...} } | ||
if (err) return console.log("forms2accounts: body did not parse:", err) | ||
if (err) return console.log("accountdown-parser: body did not parse:", err) | ||
if (self.format) body = self.format(body) | ||
if (!self.validate(body)) | ||
return console.log("\nforms2accounts.create: invalid body: ", self.validate.errors) | ||
return console.log("\naccountdown-parser.create: invalid body: ", self.validate.errors) | ||
@@ -49,3 +48,3 @@ self.accountdown.create(body.value.key, body, function (err) { | ||
forms2accounts.prototype.update = function (req, res, key, cb) { | ||
accountdown-parser.prototype.update = function (req, res, key, cb) { | ||
var self = this; | ||
@@ -60,3 +59,3 @@ self.accountdown.get(key, function (err, existingAccountValue) { | ||
if (!self.validate(body)) | ||
return console.log("\nforms2accounts.update: invalid body: ", self.validate.errors) | ||
return console.log("\naccountdown-parser.update: invalid body: ", self.validate.errors) | ||
@@ -63,0 +62,0 @@ // Overwrite all new values in existing account, and retain any values not |
{ | ||
"name": "accountdown-parser", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Facilitates account creation and user input validation using accountdown and json-schema", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
7252
3
1
119
75