Comparing version 1.0.0 to 1.0.1
@@ -6,13 +6,125 @@ 'use strict'; | ||
}); | ||
exports.isset = exports.isNull = exports.isUndefined = exports.isString = exports.isNumber = exports.isBoolean = exports.isObject = exports.isFunction = exports.isArray = exports.isType = exports._isType = undefined; | ||
var _is = require('./is'); | ||
var _fjlTypeof = require('fjl-typeof'); | ||
Object.keys(_is).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _is[key]; | ||
} | ||
}); | ||
}); | ||
var _fjlCurry = require('fjl-curry'); | ||
/** | ||
* Created by elyde on 12/18/2016. | ||
* @module fjlIs | ||
*/ | ||
var | ||
/** | ||
* Type checker. Note** The `Type` passed in, if a constructor, should | ||
* be a named constructor/function-instance; E.g., | ||
* ``` | ||
* function SomeName () {} // or | ||
* var SomeName = function SomeName () {} // or | ||
* class SomeName {} | ||
* ``` | ||
* @function module:fjlIs._isType | ||
* @param type {Function|String} - Constructor or constructor name | ||
* @param obj {*} | ||
* @return {Boolean} | ||
*/ | ||
_isType = exports._isType = function _isType(type, obj) { | ||
return (0, _fjlTypeof.typeOf)(obj) === (isFunction(type) ? type.name : type); | ||
}, | ||
/** | ||
* Same as `_isType` but curried. | ||
* @function module:fjlIs.isType | ||
* @param type {Function|String} - Constructor or constructor name | ||
* @param obj {*} | ||
* @return {Boolean} | ||
* @curried | ||
*/ | ||
isType = exports.isType = (0, _fjlCurry.curry)(_isType), | ||
/** | ||
* Checks if value is an array. | ||
* @function module:fjlIs.isArray | ||
* @param value {*} | ||
* @returns {boolean} | ||
*/ | ||
isArray = exports.isArray = Array.isArray, | ||
/** | ||
* Returns whether a value is a function or not. | ||
* @function module:fjlIs.isFunction | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isFunction = exports.isFunction = function isFunction(value) { | ||
return value instanceof Function; | ||
}, | ||
/** | ||
* Checks whether value is an object or not. | ||
* @function module:fjlIs.isObject | ||
* @param value | ||
* @returns {Boolean} | ||
*/ | ||
isObject = exports.isObject = isType(Object), | ||
/** | ||
* Checks if value is a boolean. | ||
* @function module:fjlIs.isBoolean | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isBoolean = exports.isBoolean = isType(Boolean), | ||
/** | ||
* Checks if value is a valid number (also checks if isNaN so that you don't have to). | ||
* @function module:fjlIs.isNumber | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isNumber = exports.isNumber = isType(Number), | ||
/** | ||
* Checks whether value is a string or not. | ||
* @function module:fjlIs.isString | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isString = exports.isString = isType(String), | ||
/** | ||
* Checks if value is undefined. | ||
* @function module:fjlIs.isUndefined | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isUndefined = exports.isUndefined = isType('Undefined'), | ||
/** | ||
* Checks if value is null. | ||
* @function module:fjlIs.isNull | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isNull = exports.isNull = isType('Null'), | ||
/** | ||
* Returns whether passed in values is defined and not null or not. | ||
* @function module:fjlIs.isset | ||
* @param x {*} | ||
* @returns {Boolean} | ||
*/ | ||
isset = exports.isset = function isset(x) { | ||
return x !== null && x !== undefined; | ||
}; |
@@ -6,13 +6,125 @@ 'use strict'; | ||
}); | ||
exports.isset = exports.isNull = exports.isUndefined = exports.isString = exports.isNumber = exports.isBoolean = exports.isObject = exports.isFunction = exports.isArray = exports.isType = exports._isType = undefined; | ||
var _is = require('./is'); | ||
var _fjlTypeof = require('fjl-typeof'); | ||
Object.keys(_is).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _is[key]; | ||
} | ||
}); | ||
}); | ||
var _fjlCurry = require('fjl-curry'); | ||
/** | ||
* Created by elyde on 12/18/2016. | ||
* @module fjlIs | ||
*/ | ||
var | ||
/** | ||
* Type checker. Note** The `Type` passed in, if a constructor, should | ||
* be a named constructor/function-instance; E.g., | ||
* ``` | ||
* function SomeName () {} // or | ||
* var SomeName = function SomeName () {} // or | ||
* class SomeName {} | ||
* ``` | ||
* @function module:fjlIs._isType | ||
* @param type {Function|String} - Constructor or constructor name | ||
* @param obj {*} | ||
* @return {Boolean} | ||
*/ | ||
_isType = exports._isType = function _isType(type, obj) { | ||
return (0, _fjlTypeof.typeOf)(obj) === (isFunction(type) ? type.name : type); | ||
}, | ||
/** | ||
* Same as `_isType` but curried. | ||
* @function module:fjlIs.isType | ||
* @param type {Function|String} - Constructor or constructor name | ||
* @param obj {*} | ||
* @return {Boolean} | ||
* @curried | ||
*/ | ||
isType = exports.isType = (0, _fjlCurry.curry)(_isType), | ||
/** | ||
* Checks if value is an array. | ||
* @function module:fjlIs.isArray | ||
* @param value {*} | ||
* @returns {boolean} | ||
*/ | ||
isArray = exports.isArray = Array.isArray, | ||
/** | ||
* Returns whether a value is a function or not. | ||
* @function module:fjlIs.isFunction | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isFunction = exports.isFunction = function isFunction(value) { | ||
return value instanceof Function; | ||
}, | ||
/** | ||
* Checks whether value is an object or not. | ||
* @function module:fjlIs.isObject | ||
* @param value | ||
* @returns {Boolean} | ||
*/ | ||
isObject = exports.isObject = isType(Object), | ||
/** | ||
* Checks if value is a boolean. | ||
* @function module:fjlIs.isBoolean | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isBoolean = exports.isBoolean = isType(Boolean), | ||
/** | ||
* Checks if value is a valid number (also checks if isNaN so that you don't have to). | ||
* @function module:fjlIs.isNumber | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isNumber = exports.isNumber = isType(Number), | ||
/** | ||
* Checks whether value is a string or not. | ||
* @function module:fjlIs.isString | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isString = exports.isString = isType(String), | ||
/** | ||
* Checks if value is undefined. | ||
* @function module:fjlIs.isUndefined | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isUndefined = exports.isUndefined = isType('Undefined'), | ||
/** | ||
* Checks if value is null. | ||
* @function module:fjlIs.isNull | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isNull = exports.isNull = isType('Null'), | ||
/** | ||
* Returns whether passed in values is defined and not null or not. | ||
* @function module:fjlIs.isset | ||
* @param x {*} | ||
* @returns {Boolean} | ||
*/ | ||
isset = exports.isset = function isset(x) { | ||
return x !== null && x !== undefined; | ||
}; |
@@ -20,7 +20,3 @@ import { typeOf } from 'fjl-typeof'; | ||
/** | ||
* @module fjlIs | ||
*/ | ||
export { _isType, isType, isArray, isFunction, isObject, isBoolean, isNumber, isString, isUndefined, isNull, isset }; | ||
//# sourceMappingURL=fjl-is.js.map |
@@ -26,6 +26,2 @@ var fjlIs = (function (exports,fjlTypeof,fjlCurry) { | ||
/** | ||
* @module fjlIs | ||
*/ | ||
exports._isType = _isType; | ||
@@ -32,0 +28,0 @@ exports.isType = isType; |
@@ -1,1 +0,1 @@ | ||
/**! fjl-is.min.js 1.0.0 | License: BSD-3-Clause | md5checksum: 770415df6f76546b93f4def97cb28fea | Built-on: Wed Jan 10 2018 21:25:15 GMT-0500 (Eastern Standard Time) **/var fjlIs=function(n,i,r){"use strict";var e=function(n,r){return i.typeOf(r)===(s(n)?n.name:n)},t=r.curry(e),u=Array.isArray,s=function(n){return n instanceof Function},o=t(Object),f=t(Boolean),c=t(Number),l=t(String),a=t("Undefined"),y=t("Null");return n._isType=e,n.isType=t,n.isArray=u,n.isFunction=s,n.isObject=o,n.isBoolean=f,n.isNumber=c,n.isString=l,n.isUndefined=a,n.isNull=y,n.isset=function(n){return null!==n&&void 0!==n},n}({},fjlTypeof,fjlCurry); | ||
/**! fjl-is.min.js 1.0.1 | License: BSD-3-Clause | md5checksum: 770415df6f76546b93f4def97cb28fea | Built-on: Wed Jan 10 2018 22:19:25 GMT-0500 (Eastern Standard Time) **/var fjlIs=function(n,i,r){"use strict";var e=function(n,r){return i.typeOf(r)===(s(n)?n.name:n)},t=r.curry(e),u=Array.isArray,s=function(n){return n instanceof Function},o=t(Object),f=t(Boolean),c=t(Number),l=t(String),a=t("Undefined"),y=t("Null");return n._isType=e,n.isType=t,n.isArray=u,n.isFunction=s,n.isObject=o,n.isBoolean=f,n.isNumber=c,n.isString=l,n.isUndefined=a,n.isNull=y,n.isset=function(n){return null!==n&&void 0!==n},n}({},fjlTypeof,fjlCurry); |
@@ -6,13 +6,125 @@ 'use strict'; | ||
}); | ||
exports.isset = exports.isNull = exports.isUndefined = exports.isString = exports.isNumber = exports.isBoolean = exports.isObject = exports.isFunction = exports.isArray = exports.isType = exports._isType = undefined; | ||
var _is = require('./is'); | ||
var _fjlTypeof = require('fjl-typeof'); | ||
Object.keys(_is).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _is[key]; | ||
} | ||
}); | ||
}); | ||
var _fjlCurry = require('fjl-curry'); | ||
/** | ||
* Created by elyde on 12/18/2016. | ||
* @module fjlIs | ||
*/ | ||
var | ||
/** | ||
* Type checker. Note** The `Type` passed in, if a constructor, should | ||
* be a named constructor/function-instance; E.g., | ||
* ``` | ||
* function SomeName () {} // or | ||
* var SomeName = function SomeName () {} // or | ||
* class SomeName {} | ||
* ``` | ||
* @function module:fjlIs._isType | ||
* @param type {Function|String} - Constructor or constructor name | ||
* @param obj {*} | ||
* @return {Boolean} | ||
*/ | ||
_isType = exports._isType = function _isType(type, obj) { | ||
return (0, _fjlTypeof.typeOf)(obj) === (isFunction(type) ? type.name : type); | ||
}, | ||
/** | ||
* Same as `_isType` but curried. | ||
* @function module:fjlIs.isType | ||
* @param type {Function|String} - Constructor or constructor name | ||
* @param obj {*} | ||
* @return {Boolean} | ||
* @curried | ||
*/ | ||
isType = exports.isType = (0, _fjlCurry.curry)(_isType), | ||
/** | ||
* Checks if value is an array. | ||
* @function module:fjlIs.isArray | ||
* @param value {*} | ||
* @returns {boolean} | ||
*/ | ||
isArray = exports.isArray = Array.isArray, | ||
/** | ||
* Returns whether a value is a function or not. | ||
* @function module:fjlIs.isFunction | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isFunction = exports.isFunction = function isFunction(value) { | ||
return value instanceof Function; | ||
}, | ||
/** | ||
* Checks whether value is an object or not. | ||
* @function module:fjlIs.isObject | ||
* @param value | ||
* @returns {Boolean} | ||
*/ | ||
isObject = exports.isObject = isType(Object), | ||
/** | ||
* Checks if value is a boolean. | ||
* @function module:fjlIs.isBoolean | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isBoolean = exports.isBoolean = isType(Boolean), | ||
/** | ||
* Checks if value is a valid number (also checks if isNaN so that you don't have to). | ||
* @function module:fjlIs.isNumber | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isNumber = exports.isNumber = isType(Number), | ||
/** | ||
* Checks whether value is a string or not. | ||
* @function module:fjlIs.isString | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isString = exports.isString = isType(String), | ||
/** | ||
* Checks if value is undefined. | ||
* @function module:fjlIs.isUndefined | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isUndefined = exports.isUndefined = isType('Undefined'), | ||
/** | ||
* Checks if value is null. | ||
* @function module:fjlIs.isNull | ||
* @param value {*} | ||
* @returns {Boolean} | ||
*/ | ||
isNull = exports.isNull = isType('Null'), | ||
/** | ||
* Returns whether passed in values is defined and not null or not. | ||
* @function module:fjlIs.isset | ||
* @param x {*} | ||
* @returns {Boolean} | ||
*/ | ||
isset = exports.isset = function isset(x) { | ||
return x !== null && x !== undefined; | ||
}; |
{ | ||
"name": "fjl-is", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"main": "./dist/cjs/fjlIs.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/es6-module/fjl-is.js", |
@@ -9,2 +9,20 @@ [![Build Status](https://travis-ci.org/functional-jslib/fjl-is.png)](https://travis-ci.org/functional-jslib/fjl-is) | ||
## Installation | ||
- `npm install fjl-is` or | ||
- `yarn add fjl-is` | ||
## Including module | ||
- Module exported for es6 and commonjs modules by way of package.json by default. | ||
``` | ||
// Es6/2015 | ||
import {isNumber, isType} from 'fjl-is'; | ||
// CommonJs | ||
const {isNumber, isType} = require('fjl-is'); | ||
``` | ||
- Module is also exported to other formats available via './dist' folder. Other formats here | ||
are: | ||
- iife, umd, and amd as well as the other two mentioned above (es6-module and cjs). | ||
## Usage: | ||
@@ -11,0 +29,0 @@ ``` |
/** | ||
* Content generated by '{project-root}/build-scripts/VersionNumberReadStream.js'. | ||
* Generated Wed Jan 10 2018 21:25:14 GMT-0500 (Eastern Standard Time) | ||
* Generated Wed Jan 10 2018 22:19:24 GMT-0500 (Eastern Standard Time) | ||
* @property {String} module:fjlTypeOf.version | ||
*/ | ||
export const version = '1.0.0'; | ||
export const version = '1.0.1'; | ||
export default version; | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
118
1294715
57
1445