joi-to-json 2.3.4 → 2.3.5

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.
@@ -117,14 +117,14 @@ class JoiJsonSchemaParser {
117
117
 
118
118
  _getConst(fieldDefn) {
119
119
  const enumList = fieldDefn[this.enumFieldName]
120
- if (fieldDefn.flags && fieldDefn.flags.only && enumList.length === 1) {
120
+ if (fieldDefn.flags && fieldDefn.flags.only && _.size(enumList) === 1) {
121
121
  return enumList[0]
122
122
  }
123
123
  }
124
124
 
125
125
  _getEnum(fieldDefn) {
126
126
  const enumList = fieldDefn[this.enumFieldName]
127
- if (fieldDefn.flags && fieldDefn.flags.only && enumList.length > 1) {
127
+ if (fieldDefn.flags && fieldDefn.flags.only && _.size(enumList) > 1) {
128
128
  return _.uniq(enumList)
129
129
  }
130
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joi-to-json",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "description": "joi to JSON / OpenAPI Schema Converter",
5
5
  "main": "index.js",
6
6
  "repository": {