0.1.2 • Published 5 years ago

toobject v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

toObject.js

Convert Object-like JavaScript variables into true Objects.

Lets you use Object utilities like JSON.stringify with libraries that so sneakily give you Functions with properties instead of vanilla Objects... looking at you, jQuery and Express.

Install

via npm:

$ npm install --save toobject

via Bower:

$ bower install --save toobject

Use

First load the script - it supports CommonJS, AMD/Require.js, and will set a browser global.

Then it's simple...

var func = function () {};
func.hello = 'Hello';

toObject(func);
// => {hello: "Hello"}
0.1.2

5 years ago

0.1.1

10 years ago

0.1.0

10 years ago