| export declare function isNumeric(x: string): boolean; | ||
| export declare function isArrayIndex(x: string): boolean; | ||
| export declare function isObjectKey(x: string): boolean; | ||
| export declare function isFlag(arg: string): boolean; | ||
| export declare function isNotFlag(arg: string): boolean; | ||
| export declare function hasAColon(arg: string): boolean; | ||
| export declare function isSingleFlag(x: string): boolean; | ||
| export declare function isDoubleFlag(x: string): boolean; | ||
| export declare function isTripleFlag(x: string): boolean; |
+58
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.isTripleFlag = exports.isDoubleFlag = exports.isSingleFlag = exports.hasAColon = exports.isNotFlag = exports.isFlag = exports.isObjectKey = exports.isArrayIndex = exports.isNumeric = void 0; | ||
| function isNumeric(x) { | ||
| if (typeof x !== "string") { | ||
| return false; | ||
| } | ||
| return !isNaN(x) && !isNaN(parseFloat(x)); | ||
| } | ||
| exports.isNumeric = isNumeric; | ||
| function isArrayIndex(x) { | ||
| return isNumeric(x); | ||
| } | ||
| exports.isArrayIndex = isArrayIndex; | ||
| function isObjectKey(x) { | ||
| // basically anything that isn't a flag can be an ovject key | ||
| if (x[0] !== "-") { | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
| exports.isObjectKey = isObjectKey; | ||
| function isFlag(arg) { | ||
| if (arg.startsWith("-") && !hasAColon(arg)) { | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
| exports.isFlag = isFlag; | ||
| function isNotFlag(arg) { | ||
| return !isFlag(arg); | ||
| } | ||
| exports.isNotFlag = isNotFlag; | ||
| function hasAColon(arg) { | ||
| return arg.includes(":"); | ||
| } | ||
| exports.hasAColon = hasAColon; | ||
| function isSingleFlag(x) { | ||
| if (x.length > 1 && x[0] === "-" && x[1] !== "-" && !isArrayIndex(x.slice(1))) { | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
| exports.isSingleFlag = isSingleFlag; | ||
| function isDoubleFlag(x) { | ||
| if (x.length > 2 && x[0] === "-" && x[1] === "-" && x[2] !== "-") { | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
| exports.isDoubleFlag = isDoubleFlag; | ||
| function isTripleFlag(x) { | ||
| if (x.length > 3 && x[0] === "-" && x[1] === "-" && x[2] === "-" && x[3] !== "-") { | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
| exports.isTripleFlag = isTripleFlag; |
+1
-0
| export { isArray, isBoolean, isChar, isNumber, isObject, isString, isNull, isUndefined, isPrimitive, isReference, } from "./basictypes"; | ||
| export { isNotArray, isNotBoolean, isNotChar, isNotNumber, isNotObject, isNotString, isNotNull, isNotUndefined, isNotPrimitive, isNotReference, } from './inverses'; | ||
| export { isNumeric, isArrayIndex, isObjectKey, isFlag, isNotFlag, hasAColon, isSingleFlag, isDoubleFlag, isTripleFlag, } from './args'; | ||
| export { isEmptyArray, isArrayOfArrays, isArrayOfBooleans, isArrayOfChars, isArrayOfNumbers, isArrayOfObjects, isArrayOfStrings, } from './array'; | ||
@@ -4,0 +5,0 @@ export { isEmptyObject, isObjectOfArrays, isObjectOfBooleans, isObjectOfChars, isObjectOfNumbers, isObjectOfObjects, isObjectOfStrings, } from './object'; |
+11
-1
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.isURL = exports.isHttps = exports.isHttp = exports.isUpperCase = exports.isLowerCase = exports.isObjectOfStrings = exports.isObjectOfObjects = exports.isObjectOfNumbers = exports.isObjectOfChars = exports.isObjectOfBooleans = exports.isObjectOfArrays = exports.isEmptyObject = exports.isArrayOfStrings = exports.isArrayOfObjects = exports.isArrayOfNumbers = exports.isArrayOfChars = exports.isArrayOfBooleans = exports.isArrayOfArrays = exports.isEmptyArray = exports.isNotReference = exports.isNotPrimitive = exports.isNotUndefined = exports.isNotNull = exports.isNotString = exports.isNotObject = exports.isNotNumber = exports.isNotChar = exports.isNotBoolean = exports.isNotArray = exports.isReference = exports.isPrimitive = exports.isUndefined = exports.isNull = exports.isString = exports.isObject = exports.isNumber = exports.isChar = exports.isBoolean = exports.isArray = void 0; | ||
| exports.isURL = exports.isHttps = exports.isHttp = exports.isUpperCase = exports.isLowerCase = exports.isObjectOfStrings = exports.isObjectOfObjects = exports.isObjectOfNumbers = exports.isObjectOfChars = exports.isObjectOfBooleans = exports.isObjectOfArrays = exports.isEmptyObject = exports.isArrayOfStrings = exports.isArrayOfObjects = exports.isArrayOfNumbers = exports.isArrayOfChars = exports.isArrayOfBooleans = exports.isArrayOfArrays = exports.isEmptyArray = exports.isTripleFlag = exports.isDoubleFlag = exports.isSingleFlag = exports.hasAColon = exports.isNotFlag = exports.isFlag = exports.isObjectKey = exports.isArrayIndex = exports.isNumeric = exports.isNotReference = exports.isNotPrimitive = exports.isNotUndefined = exports.isNotNull = exports.isNotString = exports.isNotObject = exports.isNotNumber = exports.isNotChar = exports.isNotBoolean = exports.isNotArray = exports.isReference = exports.isPrimitive = exports.isUndefined = exports.isNull = exports.isString = exports.isObject = exports.isNumber = exports.isChar = exports.isBoolean = exports.isArray = void 0; | ||
| var basictypes_1 = require("./basictypes"); | ||
@@ -26,2 +26,12 @@ Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return basictypes_1.isArray; } }); | ||
| Object.defineProperty(exports, "isNotReference", { enumerable: true, get: function () { return inverses_1.isNotReference; } }); | ||
| var args_1 = require("./args"); | ||
| Object.defineProperty(exports, "isNumeric", { enumerable: true, get: function () { return args_1.isNumeric; } }); | ||
| Object.defineProperty(exports, "isArrayIndex", { enumerable: true, get: function () { return args_1.isArrayIndex; } }); | ||
| Object.defineProperty(exports, "isObjectKey", { enumerable: true, get: function () { return args_1.isObjectKey; } }); | ||
| Object.defineProperty(exports, "isFlag", { enumerable: true, get: function () { return args_1.isFlag; } }); | ||
| Object.defineProperty(exports, "isNotFlag", { enumerable: true, get: function () { return args_1.isNotFlag; } }); | ||
| Object.defineProperty(exports, "hasAColon", { enumerable: true, get: function () { return args_1.hasAColon; } }); | ||
| Object.defineProperty(exports, "isSingleFlag", { enumerable: true, get: function () { return args_1.isSingleFlag; } }); | ||
| Object.defineProperty(exports, "isDoubleFlag", { enumerable: true, get: function () { return args_1.isDoubleFlag; } }); | ||
| Object.defineProperty(exports, "isTripleFlag", { enumerable: true, get: function () { return args_1.isTripleFlag; } }); | ||
| var array_1 = require("./array"); | ||
@@ -28,0 +38,0 @@ Object.defineProperty(exports, "isEmptyArray", { enumerable: true, get: function () { return array_1.isEmptyArray; } }); |
+1
-1
| { | ||
| "name": "whichtype", | ||
| "version": "1.1.0", | ||
| "version": "1.2.0", | ||
| "description": "Whichtype is a small JavaScript library for checking the type of your variables.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
+1
-1
@@ -86,3 +86,3 @@ | ||
| | `Description` | `Whichtype is a small JavaScript library for checking the type of your variables.` | | ||
| | `Version` | `1.1.0` | | ||
| | `Version` | `1.2.0` | | ||
| | `Author` | `iaseth` | | ||
@@ -89,0 +89,0 @@ | `Homepage` | `https://github.com/iaseth/whichtype` | |
34280
11.53%23
9.52%523
17.53%