New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@elliemae/ds-props-helpers

Package Overview
Dependencies
Maintainers
1
Versions
907
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elliemae/ds-props-helpers - npm Package Compare versions

Comparing version 1.54.0-next.2 to 1.54.0-next.3

20

cjs/validation/validator.js

@@ -14,2 +14,12 @@ 'use strict';

schema.properties.forEach(function (property) {
var propertyName = property.name;
var currentProp = props[propertyName];
var currentPropTypeOf = _typeof__default['default'](currentProp); // eslint-disable-next-line max-len
var currentFormat = property.format; // this is csv representing types e.g.: "string"/"string,number"/"[object],string"
var isValidReactElement = false; // this depends on react desc definition
if (property.required && !Object.prototype.hasOwnProperty.call(props, property.name)) {

@@ -19,6 +29,10 @@ validation_errorTemplates.throwRequiredError(schema.name, property.name);

if (typeof props[property.name] !== 'undefined' && props[property.name] !== null) {
if (!property.format.includes(_typeof__default['default'](props[property.name])) && !property.format.includes(props[property.name])) {
validation_errorTemplates.throwTypeError(schema.name, property.name, props[property.name], property.format);
if (currentPropTypeOf !== 'undefined' && currentProp !== null) {
if (currentPropTypeOf === 'object' && Object.prototype.hasOwnProperty.call(currentProp, '$$typeof') && (currentFormat.includes('node') || currentFormat.includes('element'))) {
isValidReactElement = true;
}
if (!currentFormat.includes(currentPropTypeOf) && !currentFormat.includes(currentProp) && !isValidReactElement) {
validation_errorTemplates.throwTypeError(schema.name, propertyName, currentProp, currentFormat);
}
}

@@ -25,0 +39,0 @@ });

@@ -6,2 +6,12 @@ import _typeof from '@babel/runtime/helpers/esm/typeof';

schema.properties.forEach(function (property) {
var propertyName = property.name;
var currentProp = props[propertyName];
var currentPropTypeOf = _typeof(currentProp); // eslint-disable-next-line max-len
var currentFormat = property.format; // this is csv representing types e.g.: "string"/"string,number"/"[object],string"
var isValidReactElement = false; // this depends on react desc definition
if (property.required && !Object.prototype.hasOwnProperty.call(props, property.name)) {

@@ -11,6 +21,10 @@ throwRequiredError(schema.name, property.name);

if (typeof props[property.name] !== 'undefined' && props[property.name] !== null) {
if (!property.format.includes(_typeof(props[property.name])) && !property.format.includes(props[property.name])) {
throwTypeError(schema.name, property.name, props[property.name], property.format);
if (currentPropTypeOf !== 'undefined' && currentProp !== null) {
if (currentPropTypeOf === 'object' && Object.prototype.hasOwnProperty.call(currentProp, '$$typeof') && (currentFormat.includes('node') || currentFormat.includes('element'))) {
isValidReactElement = true;
}
if (!currentFormat.includes(currentPropTypeOf) && !currentFormat.includes(currentProp) && !isValidReactElement) {
throwTypeError(schema.name, propertyName, currentProp, currentFormat);
}
}

@@ -17,0 +31,0 @@ });

2

package.json
{
"name": "@elliemae/ds-props-helpers",
"version": "1.54.0-next.2",
"version": "1.54.0-next.3",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Ellie Mae - Dim Sum - Validation Helpers",

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