包详细信息

is-boxed-primitive

ljharb123MIT1.0.1

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

util, primitive, boxed, autobox

自述文件

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

更新日志

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.1 - 2020-12-14

Commits

  • [Tests] migrate tests to Github Actions 25ab78d
  • [meta] add auto-changelog 3cd85fc
  • [meta] use in-publish on prepublish script 195e2d1
  • [Tests] up to node v12.8, v11.15, v10.16, v8.16, v6.17 ea12122
  • [readme] add docs, fix URLs 6d537dd
  • [Tests] run nyc on all tests; use tape runner 5b94f98
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, object-inspect, tape 0cb4cc2
  • [Refactor] use which-boxed-primitive instead of individual predicates f0c35be
  • [actions] add automatic rebasing / merge commit blocking 2c12869
  • [actions] add "Allow Edits" workflow a3cf2b0
  • [meta] add FUNDING.yml eeeba66
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest, object-inspect, has-symbols dd86fe3
  • [Dev Deps] update auto-changelog, in-publish, tape 1dbfbd6
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape e8c6f09
  • [Tests] update eslint, @ljharb/eslint-config, tape e010b93
  • [actions] switch Automatic Rebase workflow to pull_request_target event b405e1a
  • [Dev Deps] update auto-changelog; add aud 355c2a4
  • [meta] add funding field 87a0528
  • [Tests] use npx aud in posttest 1456bee
  • [Deps] update which-boxed-primitive 7ca7659
  • [Tests] only audit prod deps 3d26532
  • [Deps] update which-boxed-primitive 4e960ce

v1.0.0 - 2018-09-20

Commits