Socket
Socket
Sign inDemoInstall

self-explain

Package Overview
Dependencies
10
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    self-explain

self explained tools - starting with "assert"


Version published
Weekly downloads
25
decreased by-34.21%
Maintainers
1
Install size
1.64 MB
Created
Weekly downloads
 

Readme

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

Last updated on 04 May 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc