0.1.1 • Published 4 years ago

null-class v0.1.1

Weekly downloads
6
License
ISC
Repository
github
Last release
4 years ago

null class

Build Status Coverage Status

A Null class to simplify Object.create(null) and class extends null {} patterns.

This module exports nothing else than:

function Null(){}

Before being exported though, such Null "class" is modified as such:

Object.setPrototypeOf(Null, null);
Null.prototype = Object.create(null);

The Null class can be used to extend, as in class extends Null {}, or to create, faster than Object.create(null), dictionaries of any kind, via new Null.

Compatibility

Every engine capable of Object.create(null). If the engine doesn't know Object.setPrototypeOf, the Null class will simply still be an instance of Function, but it can still be extended, or used to create null dictionaries via new Null.