Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@analytics/type-utils
Advanced tools
A tiny tree shakable utility library for runtime type checking in 327 bytes
.
This package exposes re-usable runtime type checking functions. This is useful for shrinking bundle sizes.
Install @analytics/types-utils
from npm.
npm install @analytics/types-utils
Below is the api for @analytics/types-utils
.
isBrowser
Check if currently in browser context
import { isBrowser } from '@analytics/types-utils'
if (isBrowser) {
console.log('do things in browser env')
}
isString
Check if value is string
import { isString } from '@analytics/types-utils'
const xyz = 'hi'
console.log(isString(xyz))
// true
isBoolean
Check if value is boolean
import { isBoolean } from '@analytics/types-utils'
const myBool = true
console.log(isBoolean(myBool))
// true
isArray
Check if value is array
import { isArray } from '@analytics/types-utils'
const myArr = ['x', 'y']
console.log(isArray(myArr))
// true
isObject
Check if value is object
import { isObject } from '@analytics/types-utils'
const myObj = { cool: 'hello' }
console.log(isObject(myObj))
// true
isUndefined
Check if value is undefined
import { isUndefined } from '@analytics/types-utils'
let myval
console.log(isUndefined(myval))
// true
FAQs
Tiny runtime type checking utils
The npm package @analytics/type-utils receives a total of 143,828 weekly downloads. As such, @analytics/type-utils popularity was classified as popular.
We found that @analytics/type-utils 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.