Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@orion-js/schema

Package Overview
Dependencies
Maintainers
2
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orion-js/schema - npm Package Compare versions

Comparing version 0.5.9 to 0.5.13

42

lib/clean/cleanType.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc