Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 17, 2024 via pnpm

unbox-primitive 1.0.2

Unbox a boxed JS primitive value.
Package summary
Share
0
issues
1
license
21
MIT
Package created
11 Aug 2019
Version published
25 Apr 2022
Maintainers
1
Total deps
21
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
21 Packages, Including:
call-bind@1.0.7
define-data-property@1.1.4
es-define-property@1.0.0
es-errors@1.3.0
function-bind@1.1.2
get-intrinsic@1.2.4
gopd@1.0.1
has-bigints@1.0.2
has-property-descriptors@1.0.2
has-proto@1.0.3
has-symbols@1.0.3
has-tostringtag@1.0.2
hasown@2.0.2
is-bigint@1.0.4
is-boolean-object@1.1.2
is-number-object@1.0.7
is-string@1.0.7
is-symbol@1.0.4
set-function-length@1.2.2
unbox-primitive@1.0.2
which-boxed-primitive@1.0.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of unbox-primitive 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
call-bind1.0.721.6 kBMIT
prod
has-bigints1.0.24.93 kBMIT
prod
has-symbols1.0.36.9 kBMIT
prod
which-boxed-primitive1.0.25.54 kBMIT
prod

Visualizations

Frequently Asked Questions

What does unbox-primitive do?

Unbox-primitive is a JavaScript utility module that helps in unboxing a boxed JS primitive value. It proves to be beneficial as it can work cross-realms/iframe. The module doesn't depend on instanceof or any mutable properties and can operate effectively despite ES6 Symbol.toStringTag.

How do you use unbox-primitive?

To use the unbox-primitive package, you first need to install it via npm. You can do so using the command npm install unbox-primitive. Once it is installed, you can require it in your JavaScript file and use its functionality. Here is an example of how you can use this package:

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

In the above code snippet, the unboxPrimitive function is used to convert boxed JS primitive values to actual primitive values.

Where are the unbox-primitive docs?

The documentation for the unbox-primitive package can be found on the package's page on npm (unbox-primitive npm page) and on the GitHub page for the module (unbox-primitive GitHub page). The README in the GitHub repository includes a thorough description of the utility along with examples of its usage. For comprehensive understanding, users are encouraged to refer to these resources.

All Versions