New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

chaik

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chaik

can be used in unittest to compare json data format or to check existance in db

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
7
600%
Maintainers
1
Weekly downloads
 
Created
Source

to verify a json object's structure

emtpy object

  • chaik.structure({},[])

no nested field

  • chaik.structure({a:1},["a"])

nested field

  • chaik.structure({ a: 1, b: { c: 2 } },["a", { b: ["c"] }])

object array

  • chaik.structure([{ a: 1 }],[["a"]])

optional field

  • chaik.structure({},["*a"])
  • chaik.structure({ a: 1 },["*a"])
  • chaik.structure({ a: 1 },["*a"])
  • chaik.structure({ a: 1, b: { c: 2 } },["*a", { "*b": ["c"] }])

array field

  • chaik.structure({ a: { b: [1, 2, 3] }, { "a": { "b": [] } })

to verify data existance in db

init

pass in a standard knex connection config

chaik.initDbConnection(config)

to verify existance

  • chaik.in.database(objToVerify, tableName, searchCondition)
  • chaik.in.database(objectArrayToVerify, tableName, searchCondition)

ensure inexistance

  • chaik.notIn.database(tableName, searchCondition)

Keywords

unittest

FAQs

Package last updated on 08 Feb 2017

Did you know?

Socket

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.

Install

Related posts