has-private-fields

1.1.0 • Public • Published

has-private-fields Version Badge

dependency status dev dependency status License Downloads

npm badge

Determine if the JS environment has private fields (class { #x; }) support.

Example

const assert = require('assert');
const hasPrivateFields = require('has-private-fields');

assert.equal(hasPrivateFields(), true); // if the environment has native class private fields support

const { hasPrivateAccessors, hasPrivateMethods } = hasPrivateFields;

assert.equal(hasPrivateAccessors(), true); // if the environment has native class private accessors support
assert.equal(hasPrivateMethods(), true); // if the environment has native class private methods support

Tests

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

Package Sidebar

Install

npm i has-private-fields

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

9.06 kB

Total Files

10

Last publish

Collaborators

  • ljharb