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

@intelligo.ai/object-to-schema

Package Overview
Dependencies
Maintainers
6
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@intelligo.ai/object-to-schema - npm Package Compare versions

Comparing version 1.5.4 to 1.5.5

17

dist/schemaCreator.js

@@ -9,2 +9,3 @@ "use strict";

var transform_1 = require("./utils/transform");
var _ = require("lodash");
function mapObjectToSchema(obj, schema) {

@@ -16,3 +17,3 @@ if (schema === void 0) { schema = {}; }

return Object
.keys(obj)
.keys(pruneEmpty(obj))
.reduce(function (schema, key) { return resolveOperation(schema, obj, key); }, schema);

@@ -37,2 +38,16 @@ }

}
function pruneEmpty(obj) {
return function prune(current) {
_.forOwn(current, function (value, key) {
if (_.isUndefined(value) || _.isNull(value) || _.isNaN(value) ||
(_.isString(value) && _.isEmpty(value)) ||
(_.isObject(value) && _.isEmpty(prune(value)))) {
delete current[key];
}
});
if (_.isArray(current))
_.pull(current, undefined);
return current;
}(_.cloneDeep(obj));
}
function handleEmptyValue(schema, key) {

@@ -39,0 +54,0 @@ var value = schema[key];

2

package.json
{
"name": "@intelligo.ai/object-to-schema",
"version": "1.5.4",
"version": "1.5.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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