Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
javascript-type-checker
Advanced tools
Utility to validate or fetch type of given argument in javascript.
A NPM module to validate or fetch type of given argument in javascript.
npm install javascript-type-checker --save
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isArray(['A','B',3])); // true
console.log(javascriptTypeChecker.isArray('A')); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isObject({'key':'value'})); // true
console.log(javascriptTypeChecker.isObject(['A','B',3])); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isNumber(123)); // true
console.log(javascriptTypeChecker.isNumber('123')); // false
console.log(javascriptTypeChecker.isNumber(NaN)); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isError(new Error('Test Error'))); // true
console.log(javascriptTypeChecker.isError('Test Error')); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isString('123')); // true
console.log(javascriptTypeChecker.isString(123)); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isBoolean(false)); // true
console.log(javascriptTypeChecker.isBoolean('false')); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isNull(null)); // true
console.log(javascriptTypeChecker.isNull('ABC')); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isUndefined({}.testKey)); // true
console.log(javascriptTypeChecker.isUndefined({})); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isEmptyObject({})); // true
console.log(javascriptTypeChecker.isEmptyObject({'key':'value'})); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isEmptyArray([])); // true
console.log(javascriptTypeChecker.isEmptyArray(['A'])); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.isArrayOfEmptyArrays([[[[]], [[]]], [])); // true
console.log(javascriptTypeChecker.isArrayOfEmptyArrays([[[[[]]]], 'A'])); // false
const javascriptTypeChecker = require('javascript-type-checker');
console.log(javascriptTypeChecker.getType('123')); // string
console.log(javascriptTypeChecker.getType(123)); // number
console.log(javascriptTypeChecker.getType(true)); // boolean
console.log(javascriptTypeChecker.getType(NaN)); // NaN
console.log(javascriptTypeChecker.getType(null)); // null
console.log(javascriptTypeChecker.getType(undefined)); // undefined
console.log(javascriptTypeChecker.getType({})); // object
console.log(javascriptTypeChecker.getType([])); // array
console.log(javascriptTypeChecker.getType(new Error('test'))); // error
FAQs
Utility to validate or fetch type of given argument in javascript.
The npm package javascript-type-checker receives a total of 5 weekly downloads. As such, javascript-type-checker popularity was classified as not popular.
We found that javascript-type-checker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.