Socket
Socket
Sign inDemoInstall

@orion-js/schema

Package Overview
Dependencies
Maintainers
2
Versions
110
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.12.0 to 0.14.0

20

lib/fieldTypes/ID.js

@@ -29,3 +29,23 @@ 'use strict';

if (!(0, _isString2.default)(value) && !(0, _isInteger2.default)(value)) return _Errors2.default.NOT_AN_ID;
},
clean: function clean(value, _ref) {
var options = _ref.options;
if (!(0, _isString2.default)(value) && !(0, _isInteger2.default)(value)) return value;
var trimStrings = options.trimStrings,
removeEmptyStrings = options.removeEmptyStrings;
value = String(value);
if (trimStrings) {
value = value.trim();
}
if (removeEmptyStrings && value === '') {
return undefined;
}
return value;
}
});

2

lib/fieldTypes/ID.test.js

@@ -39,3 +39,3 @@ 'use strict';

case 0:
expect(_ID2.default.validate(1234)).toBeFalsy();
expect(_ID2.default.clean(1234)).toBe('1234');
expect(_ID2.default.validate('helloworld')).toBeFalsy();

@@ -42,0 +42,0 @@ expect(_ID2.default.validate('123456')).toBeFalsy();

{
"name": "@orion-js/schema",
"version": "0.12.0",
"version": "0.14.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "author": "nicolaslopezj",

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