Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Latest commit

 

History

History
29 lines (19 loc) · 663 Bytes

Readme.md

File metadata and controls

29 lines (19 loc) · 663 Bytes

opts

Some librarys that don't use configurable require you to supply a large object for "options". you can use this tiny function to generate those objects nicely and supply them to the lib.

Installation

$ component install yields/opts

API

opts(obj)

The function will return a new Function that accepts a key + val.

var opts = require('opts');
var maps = opts({});
maps('center', new google.mapsLatLng(-34.397, 150.644));
maps('zoom', 8);
maps('mapsTypeId', google.maps.MapTypeId.ROADMAP);
maps('zoom');
// > 8
var map = new google.maps.Map(document.getElementById('map_canvas'), maps());

License

MIT