1.3.2 • Published 3 years ago

variablechecker v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Badges

Pipelines

  • ci_main
  • cd_main
  • code_analysis

Code analysis

  • GitHub language count
  • GitHub top language
  • Snyk Vulnerabilities for npm package

Version infos

  • GitHub tag (latest SemVer)
  • GitHub

npm

  • npm
  • npm bundle size
  • npm bundle size
  • npm

variableChecker

Simple helper to do variable checks and keep complexity low.

How to use it

Samples

const variableChecker = require('variablechecker');

(async () => {
  try {
    const a = 1;
    await variableChecker.checkAsync(a, 'a'); // This will success
    
    const b = undefined;
    await variableChecker.checkAsync(b, 'b'); // This will fail and rejects an error message
    
    const c = 0;
    const condition = (x) => x >= 0;
    await variableChecker.checkAsync(c, 'c', { condition }); // This will success
    
    const c = -1;
    const condition = (x) => x >= 0;
    await variableChecker.checkAsync(c, 'c', { condition }); // This will fail and rejects an error message
    
    console.log('DONE');
  } catch (err) {
    console.log(err);
  }
})();

Update & Migration

0.1.1 => 1.0.0

The variableChecker now ships as object containing a method called checkAsync. If you're using v0.1.1, then you change all existing calls from await variableChecker(...); to await variableChecker.checkAsync(...);.

1.3.2

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago