naked-objects
Shorthand notation for Object.create(null) via node module hook
Last updated 7 years ago by bahmutov .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install naked-objects 
SYNC missed versions from official npm registry.

naked-objects

Shorthand notation for Object.create(null) via node module hook

NPM

Build status dependencies devdependencies

endorse

naked-objects installs a Node loader hook that transforms each loaded JavaScript file and expands <> syntax into Object.create(null)

var foo = <>;
foo.bar = 'bar'; // use just like normal objects

Because naked objects do not inherit from Object, there are no weird cases like

{} + {}     // NaN
var foo = <>;
foo + foo   // TypeError: Cannot convert object to primitive value

why?

Sweet naked objects

Small print

Author: Gleb Bahmutov © 2014

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

Current Tags

  • 0.1.1                                ...           latest (7 years ago)

2 Versions

  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |