@orion-js/schema
Advanced tools
Comparing version 0.5.9 to 0.5.13
@@ -25,3 +25,3 @@ 'use strict'; | ||
var _ref2, clean, defaultValue, autoValue; | ||
var _ref2, clean, needReClean, defaultValue, autoValue; | ||
@@ -51,43 +51,59 @@ return regeneratorRuntime.wrap(function _callee$(_context) { | ||
case 8: | ||
needReClean = false; | ||
defaultValue = fieldSchema.defaultValue; | ||
if (!((0, _isNil2.default)(value) && !(0, _isNil2.default)(defaultValue))) { | ||
_context.next = 17; | ||
_context.next = 19; | ||
break; | ||
} | ||
needReClean = true; | ||
if (!(typeof defaultValue === 'function')) { | ||
_context.next = 16; | ||
_context.next = 18; | ||
break; | ||
} | ||
_context.next = 13; | ||
_context.next = 15; | ||
return defaultValue.apply(undefined, [info].concat(args)); | ||
case 13: | ||
case 15: | ||
value = _context.sent; | ||
_context.next = 17; | ||
_context.next = 19; | ||
break; | ||
case 16: | ||
case 18: | ||
value = defaultValue; | ||
case 17: | ||
case 19: | ||
autoValue = fieldSchema.autoValue; | ||
if (!autoValue) { | ||
_context.next = 22; | ||
_context.next = 25; | ||
break; | ||
} | ||
_context.next = 21; | ||
needReClean = true; | ||
_context.next = 24; | ||
return autoValue.apply(undefined, [value, info].concat(args)); | ||
case 21: | ||
case 24: | ||
value = _context.sent; | ||
case 22: | ||
case 25: | ||
if (!(needReClean && clean && !(0, _isNil2.default)(value))) { | ||
_context.next = 29; | ||
break; | ||
} | ||
_context.next = 28; | ||
return clean.apply(undefined, [value, info].concat(args)); | ||
case 28: | ||
value = _context.sent; | ||
case 29: | ||
return _context.abrupt('return', value); | ||
case 23: | ||
case 30: | ||
case 'end': | ||
@@ -94,0 +110,0 @@ return _context.stop(); |
@@ -400,3 +400,3 @@ 'use strict'; | ||
expect(cleaned).toEqual({ | ||
text: { s: 'no', type: 'text' }, | ||
text: { s: 'no' }, | ||
texts: [{ s: 'no' }, 'yes'] | ||
@@ -403,0 +403,0 @@ }); |
{ | ||
"name": "@orion-js/schema", | ||
"version": "0.5.9", | ||
"version": "0.5.13", | ||
"main": "index.js", | ||
@@ -17,7 +17,7 @@ "author": "nicolaslopezj", | ||
"devDependencies": { | ||
"babel-jest": "^23.0.1", | ||
"babel-jest": "^23.4.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"eslint-config-orionsoft": "^1.2.8", | ||
"jest": "^23.1.0" | ||
"jest": "^23.4.1" | ||
}, | ||
@@ -24,0 +24,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
176171
4479