You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

is-really-primitive

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-really-primitive

test if a value is a javascript primitive type

1.2.5
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

is-really-primitive

test if a value is primitive

it's useless so it's awesome

tl;dr

const isPrimitive = require('is-fully-primitive')

// booleans are primitive
isPrimitive(true) // true
isPrimitive(false) // true
isPrimitive(Boolean(false)) // true

// strings are primitive
isPrimitive('foo') // true
isPrimitive(String('bar')) // true

// numbers are primitive
isPrimitive(42) // true
isPrimitive(4.2) // true
isPrimitive(Number(42)) // true

// symbols are primitive
isPrimitive(Symbol('baz')) // true

// null is primitive
isPrimitive(null) // true

// undefined is primitive
isPrimitive(undefined) // true

// others are not primitive
isPrimitive(new Date()) // false
isPrimitive(new isPrimitive()) // false

Keywords

checking

FAQs

Package last updated on 12 Feb 2017

Did you know?

Socket

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.

Install

Related posts