Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typical

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typical - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

22

lib/typical.js

@@ -11,2 +11,4 @@ "use strict";

exports.isNumber = isNumber;
exports.isString = isString;
exports.isBoolean = isBoolean;
exports.isPlainObject = isPlainObject;

@@ -101,1 +103,21 @@ exports.isArrayLike = isArrayLike;

}
/**
Returns true if the input value is a string
@param {*} - the input to test
@returns {boolean}
@static
*/
function isString(input){
return typeof input === "string";
}
/**
Returns true if the input value is a boolean
@param {*} - the input to test
@returns {boolean}
@static
*/
function isBoolean(input){
return typeof input === "boolean";
}

2

package.json
{
"name": "typical",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "2.3.0",
"version": "2.3.1",
"description": "For type-checking Javascript values.",

@@ -6,0 +6,0 @@ "repository": "https://github.com/75lb/typical.git",

@@ -21,2 +21,4 @@ [![view on npm](http://img.shields.io/npm/v/typical.svg)](https://www.npmjs.org/package/typical)

* [.isDefined(input)](#module_typical.isDefined) ⇒ <code>boolean</code>
* [.isString(input)](#module_typical.isString) ⇒ <code>boolean</code>
* [.isBoolean(input)](#module_typical.isBoolean) ⇒ <code>boolean</code>

@@ -112,5 +114,25 @@ <a name="module_typical.isNumber"></a>

<a name="module_typical.isString"></a>
### t.isString(input) ⇒ <code>boolean</code>
Returns true if the input value is a string
**Kind**: static method of <code>[typical](#module_typical)</code>
| Param | Type | Description |
| --- | --- | --- |
| input | <code>\*</code> | the input to test |
<a name="module_typical.isBoolean"></a>
### t.isBoolean(input) ⇒ <code>boolean</code>
Returns true if the input value is a boolean
**Kind**: static method of <code>[typical](#module_typical)</code>
| Param | Type | Description |
| --- | --- | --- |
| input | <code>\*</code> | the input to test |
* * *
&copy; 2015 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

@@ -34,2 +34,22 @@ var test = require("tape");

t.end();
});
});
test(".isString(value)", function(t){
t.equal(type.isString(0), false);
t.equal(type.isString("1"), true);
t.equal(type.isString(1.1), false);
t.equal(type.isString(NaN), false);
t.equal(type.isString(Infinity), false);
t.end();
});
test(".isBoolean(value)", function(t){
t.equal(type.isBoolean(true), true);
t.equal(type.isBoolean(false), true);
t.equal(type.isBoolean(0), false);
t.equal(type.isBoolean("1"), false);
t.equal(type.isBoolean(1.1), false);
t.equal(type.isBoolean(NaN), false);
t.equal(type.isBoolean(Infinity), false);
t.end();
});
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc