Socket
Socket
Sign inDemoInstall

is-really-primitive

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-really-primitive

test if a value is a javascript primitive type


Version published
Maintainers
1
Created

Readme

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

FAQs

Last updated on 12 Feb 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc