Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
check-depends
Advanced tools
数据对象检查、验证,灵感来自于 MongoDB 查询语法。
const checkDepends = require('check-depends');
const data = {
name: 'CheckDepends',
license: 'MIT',
author: 'Liang',
tags: ['web', 'app'],
numbers: [0, 15, 20],
empty: [],
obj: {},
object: { attr: 1, foo: 'bar' },
regexp: '/check/',
from: 2016,
awesome: true,
bugs: 0,
zero: 0,
one: 1,
no: false,
null: null,
undefined: undefined
};
checkDepends('name', data); // true
checkDepends('!name', data); // false
checkDepends('null', data); // false
checkDepends({ name: 'CheckDepends' }, data); // true
checkDepends({ 'name.length': 6 }, data); // true
checkDepends({ name: ':regexp' }, data); // true
checkDepends({ from: { $gt: 2015 } }, data); // true
checkDepends({ tags: /web/ }, data); // true
checkDepends({ obj: {} }, data); // true
checkDepends({ object: { attr: 1, foo: 'bar' } }, data); // true
checkDepends({ 'object.foo': 'bar' }, data); // true
checkDepends({ numbers: { $all: [15, 20] } }, data); // true
checkDepends({ 'tags.length': 2 }, data); // true
checkDepends({ $or: [{ name: '/check/i' }, { no: true }] }, data); // true
checkDepends({ $jsonSchema: {} }); //true
checkDepends({ $jsonSchema: { properties: { name: { type: 'number' } } } }); //false
已支持的MongoDB查询操作:
:
开头的字符串 :key
,代表data值引用差异举例:
Exp | MongoDB | check-depends |
---|---|---|
"/abc/i" | string | RegExp |
$jsonSchema: {name:{type:'number'}} | Error(' Unknown keyword: name') | true |
为了尽可能贴近MongoDB,0.8版本进行了重构,主要在两个方面:
0 < true
在JS中为真,在MongoDB和check-depends中为假FAQs
Check object depends
The npm package check-depends receives a total of 0 weekly downloads. As such, check-depends popularity was classified as not popular.
We found that check-depends demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.