11 lines
323 B
JavaScript
11 lines
323 B
JavaScript
|
"use strict";
|
||
|
|
||
|
export default function(def) {
|
||
|
if(typeof def === "string")
|
||
|
return `span.fa.fa-${def}`;
|
||
|
if(def instanceof Array)
|
||
|
return def.map(el, i => `span.fa.fa-${el}.fa-stack-${def.length-i}x`).join(`+`);
|
||
|
|
||
|
throw new Error(`Error: Expected def of type string or Array, but got variable of type ${typeof def}`);
|
||
|
}
|