ts-util-is
Advanced tools
Comparing version
@@ -5,2 +5,9 @@ # Changelog | ||
## [1.3.0](https://github.com/justinlettau/ts-util-is/compare/v1.2.1...v1.3.0) (2021-08-29) | ||
### Features | ||
* output esm ([69eab82](https://github.com/justinlettau/ts-util-is/commit/69eab8274ffeea699e01a34b31efeca3199c77bb)) | ||
### [1.2.1](https://github.com/justinlettau/ts-util-is/compare/v1.2.0...v1.2.1) (2020-11-28) | ||
@@ -7,0 +14,0 @@ |
@@ -1,14 +0,2 @@ | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./src/index"), exports); | ||
export * from './src/index'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isInstance = exports.isNil = exports.isUndefined = exports.isSymbol = exports.isString = exports.isRegExp = exports.isPlainObject = exports.isObject = exports.isNumber = exports.isNull = exports.isInfinity = exports.isGuid = exports.isFunction = exports.isError = exports.isDefined = exports.isDateValid = exports.isDate = exports.isBoolean = exports.isBase64 = exports.isArray = void 0; | ||
/** | ||
@@ -9,6 +6,5 @@ * Determines if a reference is an `Array`. | ||
*/ | ||
function isArray(value) { | ||
export function isArray(value) { | ||
return Array.isArray(value); | ||
} | ||
exports.isArray = isArray; | ||
/** | ||
@@ -19,7 +15,6 @@ * Determines if a reference is a valid base64 string. | ||
*/ | ||
function isBase64(value) { | ||
var base64 = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/; | ||
export function isBase64(value) { | ||
const base64 = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/; | ||
return isString(value) && base64.test(value); | ||
} | ||
exports.isBase64 = isBase64; | ||
/** | ||
@@ -30,6 +25,5 @@ * Determines if a reference is a `Boolean`. | ||
*/ | ||
function isBoolean(value) { | ||
export function isBoolean(value) { | ||
return typeof value === 'boolean'; | ||
} | ||
exports.isBoolean = isBoolean; | ||
/** | ||
@@ -40,6 +34,5 @@ * Determines if a reference is a `Date`. | ||
*/ | ||
function isDate(value) { | ||
export function isDate(value) { | ||
return Object.prototype.toString.call(value) === '[object Date]'; | ||
} | ||
exports.isDate = isDate; | ||
/** | ||
@@ -50,6 +43,5 @@ * Determines if a reference is a valid `Date`. | ||
*/ | ||
function isDateValid(value) { | ||
export function isDateValid(value) { | ||
return isDate(value) && !isNaN(value.getTime()); | ||
} | ||
exports.isDateValid = isDateValid; | ||
/** | ||
@@ -60,6 +52,5 @@ * Determines if a reference is defined. | ||
*/ | ||
function isDefined(value) { | ||
export function isDefined(value) { | ||
return typeof value !== 'undefined'; | ||
} | ||
exports.isDefined = isDefined; | ||
/** | ||
@@ -70,7 +61,6 @@ * Determines if a reference is an `Error`. | ||
*/ | ||
function isError(value) { | ||
export function isError(value) { | ||
return (Object.prototype.toString.call(value) === '[object Error]' || | ||
value instanceof Error); | ||
} | ||
exports.isError = isError; | ||
/** | ||
@@ -82,6 +72,5 @@ * Determines if a reference is a `Function`. | ||
// tslint:disable-next-line:ban-types | ||
function isFunction(value) { | ||
export function isFunction(value) { | ||
return typeof value === 'function'; | ||
} | ||
exports.isFunction = isFunction; | ||
/** | ||
@@ -92,7 +81,6 @@ * Determines if a reference is a valid GUID string. | ||
*/ | ||
function isGuid(value) { | ||
var guid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; | ||
export function isGuid(value) { | ||
const guid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; | ||
return isString(value) && guid.test(value); | ||
} | ||
exports.isGuid = isGuid; | ||
/** | ||
@@ -103,6 +91,5 @@ * Determines if a reference is `Infinity` (positive or negative). | ||
*/ | ||
function isInfinity(value) { | ||
export function isInfinity(value) { | ||
return value === Infinity || value === -Infinity; | ||
} | ||
exports.isInfinity = isInfinity; | ||
/** | ||
@@ -113,6 +100,5 @@ * Determines if a reference is `null`. | ||
*/ | ||
function isNull(value) { | ||
export function isNull(value) { | ||
return value === null; | ||
} | ||
exports.isNull = isNull; | ||
/** | ||
@@ -123,6 +109,5 @@ * Determines if a reference is a `Number`. | ||
*/ | ||
function isNumber(value) { | ||
export function isNumber(value) { | ||
return typeof value === 'number'; | ||
} | ||
exports.isNumber = isNumber; | ||
/** | ||
@@ -133,6 +118,5 @@ * Determines if a reference is an 'Object'. | ||
*/ | ||
function isObject(value) { | ||
export function isObject(value) { | ||
return typeof value === 'object'; | ||
} | ||
exports.isObject = isObject; | ||
/** | ||
@@ -145,7 +129,6 @@ * Determines if a reference is a plain `Object`. A "plain" object is typically created by `{}` or | ||
*/ | ||
function isPlainObject(value) { | ||
export function isPlainObject(value) { | ||
return (isObject(value) && | ||
Object.prototype.toString.call(value) === '[object Object]'); | ||
} | ||
exports.isPlainObject = isPlainObject; | ||
/** | ||
@@ -156,6 +139,5 @@ * Determines if a reference is a `RegExp`. | ||
*/ | ||
function isRegExp(value) { | ||
export function isRegExp(value) { | ||
return Object.prototype.toString.call(value) === '[object RegExp]'; | ||
} | ||
exports.isRegExp = isRegExp; | ||
/** | ||
@@ -166,6 +148,5 @@ * Determines if a reference is a `String`. | ||
*/ | ||
function isString(value) { | ||
export function isString(value) { | ||
return typeof value === 'string'; | ||
} | ||
exports.isString = isString; | ||
/** | ||
@@ -176,6 +157,5 @@ * Determines if a reference is a `Symbol`. | ||
*/ | ||
function isSymbol(value) { | ||
export function isSymbol(value) { | ||
return typeof value === 'symbol'; | ||
} | ||
exports.isSymbol = isSymbol; | ||
/** | ||
@@ -186,6 +166,5 @@ * Determines if a reference is `undefined`. | ||
*/ | ||
function isUndefined(value) { | ||
export function isUndefined(value) { | ||
return typeof value === 'undefined'; | ||
} | ||
exports.isUndefined = isUndefined; | ||
/** | ||
@@ -196,6 +175,5 @@ * Determines if a reference is null or undefined. | ||
*/ | ||
function isNil(value) { | ||
export function isNil(value) { | ||
return value === null || value === undefined; | ||
} | ||
exports.isNil = isNil; | ||
/** | ||
@@ -207,6 +185,5 @@ * Determines if a reference is an instance of `type`. | ||
*/ | ||
function isInstance(value, ctor) { | ||
export function isInstance(value, ctor) { | ||
return value instanceof ctor; | ||
} | ||
exports.isInstance = isInstance; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "ts-util-is", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "TypeScript typeof utility helper with no dependencies.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,0 +0,0 @@ [](https://badge.fury.io/js/ts-util-is) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%16385
-7.52%293
-10.94%