UNPKG

@jeli/compiler-cli

Version:

jeli compiler for frontend development

16 lines (14 loc) 352 B
let indexes = new Map(); let inc = 1000; exports.getIndex = name => indexes.get(name); exports.setIndex = name => { if (Array.isArray(name)){ name.forEach(n => { if (!indexes.has(n)){ indexes.set(n, inc++); } }); } else if(!indexes.has(name)){ indexes.set(name, inc++); } }