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

fi-is

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fi-is - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

58

lib/type.js

@@ -6,4 +6,3 @@ /**

module.exports = function (is) {
module.exports = function(is) {
/**

@@ -19,6 +18,6 @@ * Checks if the given value is of arguments type with a fallback check for

*/
is.arguments = function (val) {
return is.not.null(val) && (
Object.prototype.toString.call(val) === '[object Arguments]' ||
(typeof val === 'object' && 'callee' in val)
is.arguments = function(val) {
return (
is.not.null(val) &&
(Object.prototype.toString.call(val) === '[object Arguments]' || (typeof val === 'object' && 'callee' in val))
);

@@ -37,3 +36,3 @@ };

*/
is.array = function (val) {
is.array = function(val) {
if (typeof Array.isArray === 'function') {

@@ -56,5 +55,4 @@ return Array.isArray(val);

*/
is.boolean = function (val) {
return val === true || val === false ||
Object.prototype.toString.call(val) === '[object Boolean]';
is.boolean = function(val) {
return val === true || val === false || Object.prototype.toString.call(val) === '[object Boolean]';
};

@@ -71,3 +69,3 @@

*/
is.date = function (val) {
is.date = function(val) {
return Object.prototype.toString.call(val) === '[object Date]';

@@ -85,3 +83,3 @@ };

*/
is.error = function (val) {
is.error = function(val) {
return Object.prototype.toString.call(val) === '[object Error]';

@@ -99,5 +97,8 @@ };

*/
is.function = function (val) {
return Object.prototype.toString.call(val) === '[object Function]' ||
typeof value === 'function';
is.function = function(val) {
return (
Object.prototype.toString.call(val) === '[object Function]' ||
Object.prototype.toString.call(val) === '[object AsyncFunction]' ||
typeof val === 'function'
);
};

@@ -117,3 +118,3 @@

*/
is.nan = function (val) {
is.nan = function(val) {
return val !== val;

@@ -132,3 +133,3 @@ };

*/
is.null = function (val) {
is.null = function(val) {
return val === null;

@@ -147,5 +148,4 @@ };

*/
is.number = function (val) {
return is.not.nan(val) &&
Object.prototype.toString.call(val) === '[object Number]';
is.number = function(val) {
return is.not.nan(val) && Object.prototype.toString.call(val) === '[object Number]';
};

@@ -163,3 +163,3 @@

*/
is.object = function (val) {
is.object = function(val) {
return Object.prototype.toString.call(val) === '[object Object]';

@@ -178,3 +178,3 @@ };

*/
is.json = function (val) {
is.json = function(val) {
if (is.string(val)) {

@@ -201,3 +201,3 @@ try {

*/
is.regexp = function (val) {
is.regexp = function(val) {
return Object.prototype.toString.call(val) === '[object RegExp]';

@@ -219,3 +219,3 @@ };

*/
is.sameType = function (val1, val2) {
is.sameType = function(val1, val2) {
if (is.nan(val1) || is.nan(val2)) {

@@ -225,4 +225,3 @@ return is.nan(val1) && is.nan(val2);

return Object.prototype.toString.call(val1) ===
Object.prototype.toString.call(val2);
return Object.prototype.toString.call(val1) === Object.prototype.toString.call(val2);
};

@@ -243,3 +242,3 @@

*/
is.string = function (value) {
is.string = function(value) {
return Object.prototype.toString.call(value) === '[object String]';

@@ -259,3 +258,3 @@ };

*/
is.char = function (val) {
is.char = function(val) {
return is.string(val) && val.length === 1;

@@ -273,6 +272,5 @@ };

*/
is.undefined = function (val) {
is.undefined = function(val) {
return val === void 0;
};
};
{
"name": "fi-is",
"title": "Fi is",
"version": "1.3.0",
"version": "1.3.1",
"main": "index.js",

@@ -6,0 +6,0 @@ "license": "MIT",

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