Skip to content

Latest commit

 

History

History
54 lines (46 loc) · 1.62 KB

README.md

File metadata and controls

54 lines (46 loc) · 1.62 KB

axis.js Build Status

axis.js, a <1KB type checking module. Returns a Boolean for each type check.

axis.isArray([]); // true
axis.isObject({}); // true
axis.isString(''); // true
axis.isDate(new Date()); // true
axis.isRegExp(/test/i); // true
axis.isFunction(function () {}); // true
axis.isBoolean(true); // true
axis.isNumber(1); // true
axis.isNull(null); // true
axis.isUndefined(); // true
axis.isPlain( {} ); // true
axis.typeFor(1); // "number"
axis.typeFor([]); // "array"
...

Installing with Bower

Use the repository hook:

bower install https://github.com/toddmotto/axis.git

Manual installation

Ensure you're using the files from the dist directory (contains compiled production-ready code). Ensure you place the script before the closing </body> tag.

<body>
  <!-- html above -->
  <script src="dist/axis.js"></script>
  <script>
  // axis module available
  </script>
</body>

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.

Release history

  • 1.1.2
    • Export of a isPlain function to detect plain Javascript objects (without a contructor)
  • 1.1.1
    • Export of a typeFor function to get the lowercase type name of an object
    • Added a "main" entry in package.json
  • 1.1.0
  • 1.0.0
    • Initial release