1.0.0 • Published 3 years ago

@devutil/devutil v1.0.0

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

DevUtil.js

Useful JavaScript development utilities (functions).

Usage

JavaScript file

  1. Download whole repository or just a single devutil.js file.

  2. Add to .html file (<head> section):

<script src="devutil.js"></script>

  1. Call JavaScript function from your JavaScript code, example:
<script type="application/javascript">
  console.log(DevUtil.isTrue(true));
</script>

Functions

JavaScript functionDescription
DevUtil.isDefined()true if variable is defined, false otherwise
DevUtil.isUndefined()true if variable is undefined, false otherwise
DevUtil.isTrue()true if variable's value equals to true, false otherwise
DevUtil.isFalse()true if variable's value equals to false, false otherwise

Unit tests

  1. Install npm package manager

  2. Install Jest framework. For example, via 'npm':

npm install --save-dev jest

  1. Run unit tests:

npm run test

License

MIT

Copyright (c) 2021, Andrey Kashukov