Socket
Book a DemoInstallSign in
Socket

is-boxed-primitive

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-boxed-primitive

Is this value a boxed primitive? Shim for node's util.isBoxedPrimitive.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
11
83.33%
Maintainers
1
Weekly downloads
 
Created
Source

is-boxed-primitive Version Badge

dependency status dev dependency status License Downloads

npm badge

Polyfill/shim for node's util.isBoxedPrimitive()

Example

var isBoxedPrimitive = require('is-boxed-primitive');
var assert = require('assert');

[
	undefined,
	null,
	true,
	false,
	0,
	NaN,
	Infinity,
	0n,
	'',
	'foo',
	Symbol(),
	Symbol.iterator,
].forEach((v) => {
	assert(!isBoxedPrimitive(v)); // primitive form is not boxed
	if (v != null) {
		assert(isBoxedPrimitive(Object(v))); // object form is boxed
	}
});

Tests

Simply clone the repo, npm install, and run npm test

Keywords

util

FAQs

Package last updated on 15 Dec 2020

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