New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

enum-bug

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enum-bug

Enumerate bugged properties that will not enumerate in older browsers.

latest
npmnpm
Version
1.11.1
Version published
Maintainers
1
Created
Source

Enum Bug

Enumerate properties that will not enumerate in older browsers (i.e. IE 8 and below).

license bundlephobia minzip npm dependents downloads Coverage Status Known Vulnerabilities

Installation

npm install enum-bug

Note: use add --save if you are using npm < 5.0.0

Usage

import enumBug from 'enum-bug';

const obj = {
  hello: 'not a bugged property',
  constructor: 'bugged property',
  hasOwnProperty: 'bugged property',
  isPrototypeOf: 'bugged property',
  propertyIsEnumerable: 'bugged property',
  toLocaleString: 'bugged property',
  toString: 'bugged property',
  valueOf: 'bugged property',
  goodbye: 'another normally enumerated property',
};

enumBug(obj, prop => {
  console.log(`${prop} is bugged.`);
});

By executing the code in an environment that contains an object enumeration bug (i.e. Internet Explorer 8 and below), the result will be

// console
 => constructor is bugged
 => hasOwnProperty is bugged
 => isPrototypeOf is bugged
 => propertyIsEnumerable is bugged
 => toLocaleString is bugged
 => toString is bugged
 => valueOf is bugged

Note

The bugged properties are:

  • constructor
  • hasOwnProperty
  • isPrototypeOf
  • propertyIsEnumerable
  • toLocaleString
  • toString
  • valueOf

This module will only enumerate over bugged properties in environments where they would not otherwise be enumerated over.

If the environment supports object property enumeration, no properties are enumerated.

FAQs

Package last updated on 08 May 2019

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