@bluedot-innovation/models 2.0.7-alpha.5 → 2.0.7-alpha.6
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/models/Beacon.js
CHANGED
|
@@ -49,9 +49,8 @@ function validateMajorMinor (v) {
|
|
|
49
49
|
return v >= 1 && v <= 65535
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
function validateBeaconType (v,
|
|
52
|
+
function validateBeaconType (v, magicCallback) {
|
|
53
53
|
'use strict'
|
|
54
|
-
let magicCallback = cb
|
|
55
54
|
const beaconType = v
|
|
56
55
|
const minor = this.minor
|
|
57
56
|
const major = this.major
|
package/models/BearingFilter.js
CHANGED
|
@@ -18,8 +18,7 @@ BearingFilterSchema.add({
|
|
|
18
18
|
{type: String, required: true}
|
|
19
19
|
})
|
|
20
20
|
|
|
21
|
-
function validateAngles (toAngle,
|
|
22
|
-
let magicCallback = cb
|
|
21
|
+
function validateAngles (toAngle, magicCallback) {
|
|
23
22
|
let fromAngle = this.fromAngle
|
|
24
23
|
|
|
25
24
|
if (!toAngle && toAngle !== 0) {
|
|
@@ -4,7 +4,7 @@ let uuidv4 = require('uuid/v4')
|
|
|
4
4
|
let schema = {
|
|
5
5
|
_id: {type: String, default: uuidv4},
|
|
6
6
|
startDate: {type: Date},
|
|
7
|
-
endDate: {type: Date, validate: validateDateRange}
|
|
7
|
+
endDate: {type: Date, validate: {isAsync: true, validator: validateDateRange}}
|
|
8
8
|
}
|
|
9
9
|
let CalendarDateRangeFilterSchema = new mongoose.Schema(
|
|
10
10
|
schema,
|
package/models/SpeedFilter.js
CHANGED
|
@@ -16,8 +16,7 @@ SpeedFilterSchema.add({
|
|
|
16
16
|
type: {type: String, required: true}
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
function validateMaxSpeed (v,
|
|
20
|
-
let magicCallback = cb
|
|
19
|
+
function validateMaxSpeed (v, magicCallback) {
|
|
21
20
|
let minSpeed = this.minimumSpeed
|
|
22
21
|
let maxSpeed = v
|
|
23
22
|
let speedDifference = maxSpeed - minSpeed
|
package/models/UrlAction.js
CHANGED
|
@@ -29,8 +29,7 @@ URLActionSchema.add({
|
|
|
29
29
|
{type: String, required: true}
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
function validateURL (url,
|
|
33
|
-
let magicCallback = cb
|
|
32
|
+
function validateURL (url, magicCallback) {
|
|
34
33
|
let urlRegex = new RegExp('^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|www\\.){1}([0-9A-Za-z-\\.@:%_+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?')
|
|
35
34
|
if (!urlRegex.test(url)) {
|
|
36
35
|
return magicCallback(false, `${url} is not a valid URL`)
|