2022-02-27 02:06:33 +00:00
|
|
|
"use strict";
|
|
|
|
|
2022-03-10 23:58:12 +00:00
|
|
|
export default function(def, fixed_width=true) {
|
2022-02-27 02:06:33 +00:00
|
|
|
if(typeof def === "string")
|
2022-03-10 23:58:12 +00:00
|
|
|
return `span[class="fa fa-${def}${fixed_width?` fa-fw`:``}"]`;
|
2022-02-27 02:06:33 +00:00
|
|
|
if(def instanceof Array)
|
2022-03-10 23:58:12 +00:00
|
|
|
return `(span[class="fa-stack${fixed_width?` fa-fw`:``}"]>${def.map((el, i) => `span[class="fa fa-${el} fa-stack-${def.length-i}x${fixed_width?` fa-fw`:``}"]`).join(`+`)})`;
|
2022-02-27 02:06:33 +00:00
|
|
|
|
|
|
|
throw new Error(`Error: Expected def of type string or Array, but got variable of type ${typeof def}`);
|
|
|
|
}
|