@orion-js/schema
Advanced tools
Comparing version 0.18.12 to 0.18.13
@@ -41,3 +41,3 @@ 'use strict'; | ||
value: doc, | ||
doc: doc, | ||
doc: options.forceDoc || doc, | ||
currentDoc: doc, | ||
@@ -44,0 +44,0 @@ options: options, |
@@ -189,3 +189,3 @@ 'use strict'; | ||
_context5.next = 5; | ||
return (0, _index2.default)(schema, doc); | ||
return (0, _index2.default)(schema, doc, { trimStrings: true, removeEmptyStrings: true }); | ||
@@ -192,0 +192,0 @@ case 5: |
@@ -265,2 +265,39 @@ 'use strict'; | ||
}, _callee7, undefined); | ||
}))); | ||
test('should inject doc on cleanKey', _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() { | ||
var item, user, cleaned; | ||
return regeneratorRuntime.wrap(function _callee8$(_context8) { | ||
while (1) { | ||
switch (_context8.prev = _context8.next) { | ||
case 0: | ||
item = { data: 20 }; | ||
user = { | ||
data: { | ||
type: String, | ||
clean: function clean(value, _ref10) { | ||
var doc = _ref10.doc; | ||
console.log(value, doc); | ||
expect(doc).toEqual(item); | ||
return value; | ||
} | ||
} | ||
}; | ||
_context8.next = 4; | ||
return (0, _cleanKey2.default)(user, 'data', item.data, { forceDoc: item }); | ||
case 4: | ||
cleaned = _context8.sent; | ||
expect(cleaned).toBe('20'); | ||
expect.assertions(2); | ||
case 7: | ||
case 'end': | ||
return _context8.stop(); | ||
} | ||
} | ||
}, _callee8, undefined); | ||
}))); |
{ | ||
"name": "@orion-js/schema", | ||
"version": "0.18.12", | ||
"version": "0.18.13", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "author": "nicolaslopezj", |
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
191897
4914