mongoose-auto-api.models
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,2 +0,2 @@ | ||
var assert, info, should; | ||
var assert, models, should; | ||
@@ -7,3 +7,3 @@ assert = require('chai').assert; | ||
info = require('../index'); | ||
models = require('../index'); | ||
@@ -13,15 +13,15 @@ // Main import | ||
it('Returns object', function() { | ||
return info.should.be.a('object'); | ||
return models.should.be.a('object'); | ||
}); | ||
it('User Auth info exists', function() { | ||
return assert.equal(info.userAuth != null, true); | ||
return assert.equal(models.userAuth != null, true); | ||
}); | ||
it('User Auth "model" key exists', function() { | ||
return assert.equal(info.userAuth.modelName != null, true); | ||
return assert.equal(models.userAuth.modelName != null, true); | ||
}); | ||
it('Secret Key info exists', function() { | ||
return assert.equal(info.secretKey != null, true); | ||
return assert.equal(models.secretKey != null, true); | ||
}); | ||
return it('Secret Key "model" key exists', function() { | ||
return assert.equal(info.secretKey.modelName != null, true); | ||
return assert.equal(models.secretKey.modelName != null, true); | ||
}); | ||
@@ -28,0 +28,0 @@ }); |
@@ -11,3 +11,3 @@ var bcrypt, encryptField, listCreateHook, listCreateMethod, saveEncryptHook, saveEncryptMethod, updateEncryptHook, updateEncryptMethod; | ||
SALT_WORK_FACTOR = 10; | ||
if (recType = 'doc' && !doc.isModified(key) && !doc.isNew) { | ||
if (recType = 'doc' && !rec.isModified(key) && !rec.isNew) { | ||
return; | ||
@@ -17,3 +17,3 @@ } | ||
salt = (await bcrypt.genSalt(SALT_WORK_FACTOR)); | ||
doc[key] = (await bcrypt.hash(doc[key], salt)); | ||
rec[key] = (await bcrypt.hash(rec[key], salt)); | ||
} catch (error1) { | ||
@@ -26,3 +26,3 @@ error = error1; | ||
} | ||
return doc; | ||
return rec; | ||
}; | ||
@@ -29,0 +29,0 @@ |
{ | ||
"name": "mongoose-auto-api.models", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Automatic Mongoose REST API - Module to generate models", | ||
@@ -49,2 +49,2 @@ "main": "./js/index.js", | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# Mongoose Auto API - Models Modules | ||
# Mongoose Auto API - Models Module | ||
[![Build Status](https://travis-ci.org/edmundpf/mongoose-auto-api-models.svg?branch=master)](https://travis-ci.org/edmundpf/mongoose-auto-api-models) | ||
@@ -3,0 +3,0 @@ [![npm version](https://badge.fury.io/js/mongoose-auto-api.models.svg)](https://badge.fury.io/js/mongoose-auto-api.models) |
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
6897