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

@sumor/validator

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sumor/validator - npm Package Compare versions

Comparing version 1.2.2 to 1.3.0

2

package.json
{
"name": "@sumor/validator",
"description": "This is a lightweight validator for Node.JS. It can validate the input string or number based on the rules you defined.",
"version": "1.2.2",
"version": "1.3.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "sumor-cloud/validator",

export default (info, value) => {
if (value === undefined || value === null) {
value = []
if (info.multiple !== true) {
return null
} else {
return []
}
}

@@ -5,0 +9,0 @@

export default (info, value) => {
const messages = []
if (info.required && value.length === 0) {
messages.push('SUMOR_REQUIRED')
return messages
if (info.multiple !== true) {
if (value === undefined || value === null) {
messages.push('SUMOR_REQUIRED')
return messages
}
} else {
if (info.required && value.length === 0) {
messages.push('SUMOR_REQUIRED')
return messages
}
if (info.length > 0 && value.length > info.length) {
messages.push('SUMOR_FILE_LENGTH')
}
}
if (info.length > 0 && value.length > info.length) {
messages.push('SUMOR_FILE_LENGTH')
}
return messages
}
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