Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inspect-js/is-boxed-primitive
Polyfill/shim for node's `util.types.isBoxedPrimitive()`
https://github.com/inspect-js/is-boxed-primitive
boxed is javascript primitive
Last synced: about 2 months ago
JSON representation
Polyfill/shim for node's `util.types.isBoxedPrimitive()`
- Host: GitHub
- URL: https://github.com/inspect-js/is-boxed-primitive
- Owner: inspect-js
- License: mit
- Created: 2018-09-20T23:17:46.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-11-01T22:00:12.000Z (about 2 years ago)
- Last Synced: 2024-10-04T08:08:17.369Z (3 months ago)
- Topics: boxed, is, javascript, primitive
- Language: JavaScript
- Homepage:
- Size: 58.6 KB
- Stars: 7
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# is-boxed-primitive [![Version Badge][npm-version-svg]][package-url]
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url][![npm badge][npm-badge-png]][package-url]
Polyfill/shim for node's `util.isBoxedPrimitive()`
## Example
```js
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`[package-url]: https://npmjs.org/package/is-boxed-primitive
[npm-version-svg]: https://versionbadg.es/inspect-js/is-boxed-primitive.svg
[deps-svg]: https://david-dm.org/inspect-js/is-boxed-primitive.svg
[deps-url]: https://david-dm.org/inspect-js/is-boxed-primitive
[dev-deps-svg]: https://david-dm.org/inspect-js/is-boxed-primitive/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/is-boxed-primitive#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/is-boxed-primitive.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-boxed-primitive.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-boxed-primitive.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-boxed-primitive
[codecov-image]: https://codecov.io/gh/inspect-js/is-boxed-primitive/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-boxed-primitive/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-boxed-primitive
[actions-url]: https://github.com/inspect-js/is-boxed-primitive/actions