UNPKG

exexcepturi

Version:

css-to-ts takes css file and outputs TypeScript file with an exported string containing content of your css file.

12 lines (11 loc) 431 B
Object.defineProperty(exports, "__esModule", { value: true }); const os_1 = require("os"); function ConvertCssToTs(stringifiedCss, variableName, headerComment) { let tsContent = ""; if (headerComment) { tsContent += `// ${headerComment}${os_1.EOL}`; } tsContent += `export var ${variableName} = \`${stringifiedCss}\`;${os_1.EOL}`; return tsContent; } exports.ConvertCssToTs = ConvertCssToTs;