pjs-form-factor-mapper
v0.1.0
Published
Take a form factor string and map into an object with property names.
Downloads
3
Readme
Form Factor Mapper
FormFactorMapper.map
- take a hash map of input, and return a map of the form factor values mapped to those values.
var myMap = FormFactorMapper.map("6:1,2",{"6":name:"share",value:["facebook","twitter","embed"]});
// myMap.share = ["twitter","embed"];
var myMap = FormFactorMapper.map("10:1",{"10":name:"fullEpisode",value:[false,true]});
// myMap.fullEpisode = true;
var myMap = FormFactorMapper.map("",{"10":name:"fullEpisode",value:[false,true],defaultValue:false});
// myMap.fullEpisode = false;