Comparing version 1.0.0 to 1.0.1
@@ -5,2 +5,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
function ConvertCssToTs(stringifiedCss, variableName, headerComment, varType = contracts_1.VarType.Const) { | ||
const newLineSplitterLength = os_1.EOL.length; | ||
const newLineLastAppearance = stringifiedCss.lastIndexOf(os_1.EOL); | ||
const endsWithNewLine = (newLineLastAppearance + newLineSplitterLength) === stringifiedCss.length; | ||
const cssContent = endsWithNewLine ? stringifiedCss.slice(0, newLineLastAppearance) : stringifiedCss; | ||
let content = ""; | ||
@@ -10,5 +14,5 @@ if (headerComment) { | ||
} | ||
content += `export ${varType} ${variableName} = \`${stringifiedCss}\`;${os_1.EOL}`; | ||
content += `export ${varType} ${variableName}: string = \`${cssContent}\`;${os_1.EOL}`; | ||
return content; | ||
} | ||
exports.ConvertCssToTs = ConvertCssToTs; |
{ | ||
"name": "css-to-ts", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "css-to-ts takes a css file and outputs a TypeScript file with an exported string containing a content of your css file.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
26320
418