monastery 1.28.3 → 1.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/Gemfile +8 -18
- package/docs/_config.yml +1 -4
- package/lib/model-validate.js +1 -2
- package/lib/rules.js +12 -17
- package/package.json +2 -2
package/docs/Gemfile
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Old
|
|
2
|
+
# source 'https://rubygems.org'
|
|
3
|
+
# gem 'github-pages', group: :jekyll_plugins
|
|
2
4
|
|
|
3
|
-
#
|
|
5
|
+
# Below pulls the latest remote_theme in development
|
|
4
6
|
source 'https://rubygems.org'
|
|
5
|
-
gem
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# # Same as github-docs
|
|
11
|
-
# gem "bundler"
|
|
12
|
-
# gem "jekyll", "~> 3.9.0"
|
|
13
|
-
# gem "jekyll-github-metadata", "~> 2.13.0"
|
|
14
|
-
# gem "jekyll-seo-tag", "~> 2.7.1"
|
|
15
|
-
# gem "kramdown-parser-gfm", "~> 1.1.0"
|
|
16
|
-
# gem "github-docs", git: "https://github.com/boycce/github-docs"
|
|
17
|
-
|
|
18
|
-
# group :jekyll_plugins do
|
|
19
|
-
# gem "jekyll-remote-theme", "~> 0.4.2"
|
|
20
|
-
# end
|
|
7
|
+
gem "github-docs", git: "https://github.com/boycce/github-docs"
|
|
8
|
+
group :jekyll_plugins do
|
|
9
|
+
gem "jekyll-remote-theme", "~> 0.4.2"
|
|
10
|
+
end
|
package/docs/_config.yml
CHANGED
|
@@ -2,16 +2,13 @@ remote_theme: boycce/github-docs
|
|
|
2
2
|
title: Monastery
|
|
3
3
|
description: A straight forward MongoDB ODM built upon MonkJS
|
|
4
4
|
github_url: "https://github.com/boycce/monastery"
|
|
5
|
-
basedir: ""
|
|
5
|
+
basedir: "docs"
|
|
6
6
|
|
|
7
7
|
# Aux links for the naviation.
|
|
8
8
|
aux_links:
|
|
9
9
|
"Monastery on GitHub":
|
|
10
10
|
- "//github.com/boycce/monastery"
|
|
11
11
|
|
|
12
|
-
plugins:
|
|
13
|
-
- jekyll-remote-theme
|
|
14
|
-
|
|
15
12
|
defaults:
|
|
16
13
|
-
|
|
17
14
|
scope:
|
package/lib/model-validate.js
CHANGED
|
@@ -259,10 +259,9 @@ module.exports = {
|
|
|
259
259
|
let ruleMessage = ruleMessageKey && this.messages[ruleMessageKey][ruleName]
|
|
260
260
|
if (!ruleMessage) ruleMessage = rule.message
|
|
261
261
|
|
|
262
|
-
|
|
263
262
|
if (ruleName !== 'required') {
|
|
264
263
|
// Ignore undefined when not testing 'required'
|
|
265
|
-
if (typeof value === 'undefined') return
|
|
264
|
+
if (typeof value === 'undefined') return
|
|
266
265
|
|
|
267
266
|
// Ignore null if not testing required
|
|
268
267
|
if (value === null && !field.isObject && !field.isArray) return
|
package/lib/rules.js
CHANGED
|
@@ -5,7 +5,6 @@ let validator = require('validator')
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
|
|
7
7
|
required: {
|
|
8
|
-
runOnUndefined: true, // integrate
|
|
9
8
|
message: 'This field is required.',
|
|
10
9
|
fn: function(x) {
|
|
11
10
|
if (util.isArray(x) && !x.length) return false
|
|
@@ -13,7 +12,7 @@ module.exports = {
|
|
|
13
12
|
}
|
|
14
13
|
},
|
|
15
14
|
|
|
16
|
-
//
|
|
15
|
+
// Rules below ignore null
|
|
17
16
|
|
|
18
17
|
'isBoolean': {
|
|
19
18
|
message: 'Value was not a boolean.',
|
|
@@ -26,6 +25,12 @@ module.exports = {
|
|
|
26
25
|
return typeof x === 'boolean'
|
|
27
26
|
}
|
|
28
27
|
},
|
|
28
|
+
'isNotEmptyString': {
|
|
29
|
+
message: 'Value was an empty string.',
|
|
30
|
+
fn: function(x) {
|
|
31
|
+
return x !== ''
|
|
32
|
+
}
|
|
33
|
+
},
|
|
29
34
|
'isArray': {
|
|
30
35
|
message: 'Value was not an array.',
|
|
31
36
|
tryParse: function(x) {
|
|
@@ -127,8 +132,6 @@ module.exports = {
|
|
|
127
132
|
return util.isObject(x) && ObjectId.isValid(x)/*x.get_inc*/? true : false
|
|
128
133
|
}
|
|
129
134
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
135
|
'max': {
|
|
133
136
|
message: (x, arg) => 'Value was greater than the configured maximum (' + arg + ')',
|
|
134
137
|
fn: function(x, arg) {
|
|
@@ -143,16 +146,8 @@ module.exports = {
|
|
|
143
146
|
return x >= arg
|
|
144
147
|
}
|
|
145
148
|
},
|
|
146
|
-
'isNotEmptyString': {
|
|
147
|
-
message: 'Value was an empty string.',
|
|
148
|
-
fn: function(x) {
|
|
149
|
-
return x !== ''
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
// Rules below ignore undefined & empty strings
|
|
154
|
-
// (e.g. an empty email field can be saved that isn't required)
|
|
155
149
|
|
|
150
|
+
// Rules below ignore null & empty strings
|
|
156
151
|
'enum': {
|
|
157
152
|
ignoreEmptyString: true,
|
|
158
153
|
message: (x, arg) => 'Invalid enum value',
|
|
@@ -162,10 +157,10 @@ module.exports = {
|
|
|
162
157
|
}
|
|
163
158
|
}
|
|
164
159
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
'hasAgreed': {
|
|
161
|
+
message: (x, arg) => 'Please agree to the terms and conditions.',
|
|
162
|
+
fn: function(x, arg) { return !x }
|
|
163
|
+
},
|
|
169
164
|
'isAfter': {
|
|
170
165
|
ignoreEmptyString: true,
|
|
171
166
|
message: (x, arg) => 'Value was before the configured time (' + arg + ')',
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "monastery",
|
|
3
3
|
"description": "⛪ A straight forward MongoDB ODM built around Monk",
|
|
4
4
|
"author": "Ricky Boyce",
|
|
5
|
-
"version": "1.28.
|
|
5
|
+
"version": "1.28.4",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github:boycce/monastery",
|
|
8
8
|
"homepage": "https://boycce.github.io/monastery/",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"aws-sdk": "^2.742.0",
|
|
29
|
-
"debug": "
|
|
29
|
+
"debug": "4.1.1",
|
|
30
30
|
"file-type": "^15.0.0",
|
|
31
31
|
"monk": "^7.3.0",
|
|
32
32
|
"nanoid": "^3.1.12",
|