Skip to content

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

License

Notifications You must be signed in to change notification settings

WebReflection/null-class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published