Comparing version 8.1.6 to 8.1.7
@@ -6,4 +6,4 @@ /** | ||
var _ = require('lodash'); | ||
var TYPES = require('./helpers/types'); | ||
/** | ||
@@ -18,2 +18,9 @@ * Given a value, return a human-readable type string representing **its type**. | ||
// `undefined` should take precedence over special exemplar syntax | ||
// (i.e. '===') | ||
if (_.isUndefined(val)) return 'undefined'; | ||
if (TYPES.json.isExemplar(val)) return 'json'; | ||
if (TYPES.lamda.isExemplar(val)) return 'lamda'; | ||
if (TYPES.ref.isExemplar(val)) return 'ref'; | ||
if (_.isEqual(val, Infinity) || _.isEqual(val, -Infinity) || _.isNaN(val)) { | ||
@@ -26,3 +33,2 @@ return 'invalid number'; | ||
if (_.isNull(val)) return 'null'; | ||
if (_.isUndefined(val)) return 'undefined'; | ||
if (_.isArray(val)) return 'array'; | ||
@@ -29,0 +35,0 @@ if (_.isFunction(val)) return 'function'; |
{ | ||
"name": "rttc", | ||
"version": "8.1.6", | ||
"version": "8.1.7", | ||
"description": "Runtime type-checking for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -411,3 +411,4 @@ # rttc | ||
Given a value, return its type as a human-readable string (this is not limited to rttc types-- it can return strings like `"Error"` and `"Date"`) | ||
Given a value, return its type as a human-readable string (this is not limited to rttc types-- it can return strings like `"Error"` and `"Date"`). | ||
If special rttc exemplar syntax is used, it is respected. | ||
@@ -414,0 +415,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
214262
4567
561