Socket
Book a DemoInstallSign in
Socket

has-private-fields

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has-private-fields

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

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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

Keywords

ecmascript

FAQs

Package last updated on 14 Feb 2021

Did you know?

Socket

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.

Install

Related posts