diff --git a/lib/services/schema-helper.service.ts b/lib/services/schema-helper.service.ts index 7db1b1b2..be35f3b1 100644 --- a/lib/services/schema-helper.service.ts +++ b/lib/services/schema-helper.service.ts @@ -137,16 +137,16 @@ const injectors = { check: (propertySchema) => (propertySchema.type === 'integer' || propertySchema.type === 'number'), inject: (injectTo, propertySchema = injectTo) => { var range = ''; - if (propertySchema.minimum != null && propertySchema.maximum != null) { + if (propertySchema.minimum != undefined && propertySchema.maximum != undefined) { range += propertySchema.exclusiveMinimum ? '( ' : '[ '; range += propertySchema.minimum; range += ' .. '; range += propertySchema.maximum; range += propertySchema.exclusiveMaximum ? ' )' : ' ]'; - } else if (propertySchema.maximum != null) { + } else if (propertySchema.maximum != undefined) { range += propertySchema.exclusiveMaximum? '< ' : '<= '; range += propertySchema.maximum; - } else if (propertySchema.minimum != null) { + } else if (propertySchema.minimum != undefined) { range += propertySchema.exclusiveMinimum ? '> ' : '>= '; range += propertySchema.minimum; } @@ -160,11 +160,11 @@ const injectors = { check: propertySchema => (propertySchema.type === 'string'), inject: (injectTo, propertySchema = injectTo) => { var range; - if (propertySchema.minLength != null && propertySchema.maxLength != null) { + if (propertySchema.minLength != undefined && propertySchema.maxLength != undefined) { range = `[ ${propertySchema.minLength} .. ${propertySchema.maxLength} ]`; - } else if (propertySchema.maxLength != null) { + } else if (propertySchema.maxLength != undefined) { range = '<= ' + propertySchema.maxLength; - } else if (propertySchema.minLength != null) { + } else if (propertySchema.minLength != undefined) { range = '>= ' + propertySchema.minLength; } diff --git a/package.json b/package.json index fcae6ed2..2cebb9e6 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "awesome-typescript-loader": "^2.2.1", "branch-release": "^1.0.3", "chalk": "^1.1.3", - "codelyzer": "^1.0.0-beta.0", + "codelyzer": "^1.0.0-beta.2", "copy-webpack-plugin": "^3.0.1", "core-js": "^2.4.1", "coveralls": "^2.11.9",