You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

easily-expect

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easily-expect - npm Package Compare versions

Comparing version

to
1.0.4

checkBelow.js

1

index.js

@@ -83,4 +83,5 @@ 'use strict'

exports.checkNotEmpty = require('./checkNotEmpty')
exports.checkBelow = require('./checkBelow')
exports.init = data => {
cacheData = data
}

2

package.json
{
"name": "easily-expect",
"version": "1.0.3",
"version": "1.0.4",
"description": "You can easily use expect",

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

[![Build Status](https://travis-ci.org/KSH-code/easily-expect.svg?branch=master)](https://travis-ci.org/KSH-code/easily-expect)
![Npm Version](https://img.shields.io/npm/v/easily-expect.svg?style=flat-square)
# HOW TO USE ?
# Usage
```
npm install --save easily-expect
```
```
const { checkType, checkMatch, checkEqual, checkObject, init, checkValue } = require('easily-expect')
describe (...)
init({
test1: {
test2: /^\d*$/
},
test3: /^[a-z]{1,10}$/,
test4: [/^[a-z]{1,10}$/, /^\d*$/, {
test5: /^\d*$/
}]
})
it (...)
checkType('string', '123', '0')
it (...)
checkMatch(/\d/, '1', '123', '1234')
it (...)
checkEqual('abc', 'abc', 'aaa') // aaa is false
it (...)
checkObject({ test1: { test2: '123123123' } })
it(...)
checkObject({ test4: ['aaa', '123', { test5: '123' }, 'aaa', '123', { test5: '123' }] })
it(...)
checkArray([/^\d*$/, /[a-z]{1,10}/, { test1: /^\d*$/ }], ['123', 'a', { test1: '123' }, '123','a', { test1: '123' }], ['123', 'a', { test1: '123' }])
it('Test Object type', () => {
checkValue({ a: 1 }, { b: true }, {})
})
it('Check Strings in Array', () => {
checkArray([/^\d*$/, /[a-z]{1,10}/], ['123', 'a', '123', 'a'], ['123', 'a', '123', 'a'])
})
it('1. simple test', () => {
checkAbove(2, 3, 4, 'abc'.length, 'abcd'.length)
})
```
## Example

@@ -52,3 +16,4 @@ * [checkType](https://github.com/KSH-code/easily-expect/blob/master/test/checkType.test.js)

* [checkAbove](https://github.com/KSH-code/easily-expect/blob/master/test/checkAbove.test.js)
* [checkBelow](https://github.com/KSH-code/easily-expect/blob/master/test/checkBelow.test.js)
* [checkEmpty](https://github.com/KSH-code/easily-expect/blob/master/test/checkEmpty.test.js)
* [checkNotEmpty](https://github.com/KSH-code/easily-expect/blob/master/test/checkNotEmpty.test.js)