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

check-data

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-data - npm Package Compare versions

Comparing version 1.3.6 to 1.3.7

21

index.js

@@ -66,14 +66,2 @@ "use strict";

// 包含
else if (options.contain) {
// 对Number类型特殊照顾,将字符串转数值
if (options.type === Number) {
data = Number(data)
}
let result = options.contain.indexOf(data)
if (result === -1) {
return `${key}参数值不包含${typeof data}:${data}`
}
}
// type为JS内置数据类型

@@ -98,2 +86,3 @@ else if (typeof options.type === 'function') {

}
if (options.maxLength) {

@@ -153,2 +142,10 @@ if (data.length > options.maxLength) {

// 包含
if (options.contain) {
let result = options.contain.indexOf(data)
if (result === -1) {
return `${key}参数可选值必须为${typeof data}类型${options.contain}`
}
}
// 数值转布尔值

@@ -155,0 +152,0 @@ if (options.conversion) {

{
"name": "check-data",
"version": "1.3.6",
"version": "1.3.7",
"description": "JS数据验证器",

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

@@ -20,3 +20,3 @@ let Verify = require('../index')

"lala": 168,
"kaka": 595959
"kaka": 2
},

@@ -70,2 +70,3 @@ "email": "xxx@xx.xx"

"type": Number,
"contain": [1, 2, 3],
"allowNull": true

@@ -72,0 +73,0 @@ }

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