Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
unbox-primitive
Advanced tools
Changelog
v1.0.1 - 2021-03-25
f977e5f
b89def6
325d1f1
810cd70
nyc
on all tests; use tape
runner 2f5fb08
auto-changelog
03ed375
6dec48d
eslint
, @ljharb/eslint-config
, aud
, object-inspect
, object-is
, tape
528ed88
5095b29
5aa26d7
eslint
, @ljharb/eslint-config
, object-inspect
, object-is
, safe-publish-latest
, tape
afc18c6
a025899
auto-changelog
9219a32
73f5a33
@ljharb/eslint-config
, tape
e450acc
has-bigints
, has-symbols
, which-boxed-primitive
a4279b5
auto-changelog
, in-publish
, tape
b351548
pull_request_target
event f600382
4d02fa9
auto-changelog
; add aud
07e74a3
funding
field 7ca4bd7
47d8d5f
has-symbols
c70c15e
Readme
Unbox a boxed JS primitive value. This module works cross-realm/iframe, does not depend on instanceof
or mutable properties, and works despite ES6 Symbol.toStringTag.
var unboxPrimitive = require('unbox-primitive');
var assert = require('assert');
assert.equal(unboxPrimitive(new Boolean(false)), false);
assert.equal(unboxPrimitive(new String('f')), 'f');
assert.equal(unboxPrimitive(new Number(42)), 42);
const s = Symbol();
assert.equal(unboxPrimitive(Object(s)), s);
assert.equal(unboxPrimitive(new BigInt(42)), 42n);
// any primitive, or non-boxed-primitive object, will throw
Simply clone the repo, npm install
, and run npm test
FAQs
Unbox a boxed JS primitive value.
The npm package unbox-primitive receives a total of 23,016,073 weekly downloads. As such, unbox-primitive popularity was classified as popular.
We found that unbox-primitive 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.