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

self-explain

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

self-explain

self explained tools - starting with "assert"

0.11.0
latest
Source
npmnpm
Version published
Weekly downloads
20
-31.03%
Maintainers
1
Weekly downloads
 
Created
Source

self-explained

self explained tools - starting with "assert"

Install

$ npm install self-explained

extending npm-version downloads build coverage climate dependencies qa-control

language: English also available in: Spanish

Use

var assert = require('self-exlain').assert;

var alpha = 10;
var betha = 7;

assert(alpha / 2 > betha -1);

It controls the expression like assert does. If the expression evaluates to false it will show the expression and the value. (also throws the Exception)

ASSERT FAILED
alpha / 2 > betha -1 ==== false

Much more info

var assert = require('self-exlain').assert;

var alpha = 10;
var betha = 7;

eval(assert(alpha / 2 > betha -1));

Adding eval to the assert It will shows the evaluation of all subexpressions

ASSERT FAILED
alpha / 2 > betha -1 ==== false
alpha / 2 ==== 5
betha -1 ==== 6
alpha ==== 10
betha ==== 7

Exceptions

Function assertCatch controls that an Error been throwed.

assertCatch(function{
    if(error){
        throw new Error('an error');
    }
}, /an error/);

Tests with real devices

NPM versionDeviceOSnav
0.10.0HTC DesireAndroid 2.2.2Android 2.2.2
0.10.0Samgsung Galaxy Note 4Android 5.1.1Samsung Internet 4.0.0
0.10.2Samgsung Galaxy Note 4Android 6.0.1Chrome Mobile 50.0.2661
0.10.0Blue Vivo Air LTEAndroid 5.0.2Chrome Mobile 50.0.2661
0.10.0iPad mini RetinaiOS 8.4.0Mobile Safari 8.0.0
0.10.0VMWareWinXPIE 8.0.0

License

MIT

FAQs

Package last updated on 04 May 2024

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