Skip to content

Commit

Permalink
Merge pull request #2 from mobilusoss/issue-1
Browse files Browse the repository at this point in the history
close #1
  • Loading branch information
mohemohe authored Nov 12, 2019
2 parents d82c204 + 2732eaa commit b92def5
Show file tree
Hide file tree
Showing 16 changed files with 523 additions and 21 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Module dependencies
*/

var util = require('@sailshq/lodash');
var util = require('lodash');
var sanitize = require('validator').sanitize;
var _ = require('@sailshq/lodash');
var _ = require('lodash');



Expand Down
8 changes: 4 additions & 4 deletions lib/match/errorFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Module dependencies
*/

var _ = require('@sailshq/lodash');
var _ = require('lodash');
var util = require('util');


Expand Down Expand Up @@ -48,7 +48,7 @@ module.exports = function errorFactory(value, ruleName, keyName, customMessage)
// Default to just saying 'Value' if we don't have the property name of the value.
keyName ? ('`' + keyName + '`') : 'Value',
// Adjust the article ("a" or "an") based on whether the next word starts with a vowel.
_.contains(['a','e','i','o','u'], ruleName[0]) ? 'n' : '',
_.includes(['a','e','i','o','u'], ruleName[0]) ? 'n' : '',
// Output the name of the expected data type (e.g. "string" or "boolean").
ruleName
);
Expand All @@ -75,13 +75,13 @@ module.exports = function errorFactory(value, ruleName, keyName, customMessage)
// Default to just saying 'Value' if we don't have the property name of the value.
keyName ? ('`' + keyName + '`') : 'Value',
// Adjust the article ("a" or "an") based on whether the next word starts with a vowel.
_.contains(['a','e','i','o','u'], ruleName[0]) ? 'n' : '',
_.includes(['a','e','i','o','u'], ruleName[0]) ? 'n' : '',
// Output the name of the expected data type (e.g. "string" or "boolean").
ruleName,
// Output the actual value that was passed in here.
stringifiedValue,
// Adjust the article ("a" or "an") based on whether the next word starts with a vowel.
_.contains(['a','e','i','o','u'], actualType[0]) ? 'n' : '',
_.includes(['a','e','i','o','u'], actualType[0]) ? 'n' : '',
// Output the type of the value that was passed in.
actualType
);
Expand Down
2 changes: 1 addition & 1 deletion lib/match/matchRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

var util = require('util');
var _ = require('@sailshq/lodash');
var _ = require('lodash');
var rules = require('./rules');


Expand Down
2 changes: 1 addition & 1 deletion lib/match/matchType.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

var util = require('util');
var _ = require('@sailshq/lodash');
var _ = require('lodash');
var rules = require('./rules');
var errorFactory = require('./errorFactory');

Expand Down
2 changes: 1 addition & 1 deletion lib/match/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Module dependencies
*/

var _ = require('@sailshq/lodash');
var _ = require('lodash');
var validator = require('validator');
var geojsonhint = require('@mapbox/geojsonhint');

Expand Down
Loading

0 comments on commit b92def5

Please sign in to comment.