@stylin/msa-loader
Advanced tools
Comparing version 0.4.0 to 0.4.1
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -29,3 +33,3 @@ if (k2 === undefined) k2 = k; | ||
Handlebars.registerHelper(`json`, JSON.stringify); | ||
const template = fs_1.readFileSync(path_1.join(__dirname, `template.hbs`), `utf8`); | ||
const template = (0, fs_1.readFileSync)((0, path_1.join)(__dirname, `template.hbs`), `utf8`); | ||
const toDTS = Handlebars.compile(template, { noEscape: true }); | ||
@@ -46,7 +50,7 @@ const toCamelCase = R.replace(/(^\w|[-_][a-z])/g, R.pipe(R.toUpper, R.replace(`-`, ``), R.replace(`_`, ``))); | ||
const raw = pickRawValues(matches); | ||
const parsedVariable = parser_1.parseVariable(raw); | ||
const parsedVariable = (0, parser_1.parseVariable)(raw); | ||
if (parsedVariable) { | ||
return R.over(R.lensProp(`variables`), R.assoc(raw.defValue, parsedVariable), match(re)); | ||
} | ||
const parsedProperty = parser_1.parseProperty(raw); | ||
const parsedProperty = (0, parser_1.parseProperty)(raw); | ||
if (parsedProperty) { | ||
@@ -92,3 +96,3 @@ return R.over(R.lensProp(`properties`), R.assoc(raw.defValue, parsedProperty), match(re)); | ||
const onComplete = this.async(); | ||
fs_1.readFile(this.resource, `utf8`, (error, data) => { | ||
(0, fs_1.readFile)(this.resource, `utf8`, (error, data) => { | ||
sharedData.msa = parseComments(data); | ||
@@ -95,0 +99,0 @@ onComplete(error); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -30,3 +34,6 @@ if (k2 === undefined) k2 = k; | ||
const isMapped = R.both(R.is(String), R.includes(`{`)); | ||
const parseMapped = (initValue) => R.pipe(R.match(/(?![\s])([\w-]+)[\s:]+([\w-]+)/g), R.map(R.split(`:`)), R.reduce((acc, [property, css]) => R.assoc(property, css.trim(), acc), initValue)); | ||
const parseMapped = (initValue) => R.pipe(R.match(/(?![\s])([\w-]+)[\s:]+([\w-]+)/g), R.map(value => { | ||
const [a, b] = value === null || value === void 0 ? void 0 : value.split(`:`); | ||
return [a, b]; | ||
}), R.reduce((acc, [property, css]) => R.assoc(property, css.trim(), acc), initValue)); | ||
const parseMappedValues = ({ value, isOptional }) => (isMapped(value) && | ||
@@ -33,0 +40,0 @@ parseMapped({ '@isOptional': isOptional })(value)); |
{ | ||
"name": "@stylin/msa-loader", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Stylin loader module for webpack", | ||
@@ -28,13 +28,13 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^14.14.31", | ||
"@types/ramda": "^0.27.38", | ||
"@typescript-eslint/eslint-plugin": "^4.15.0", | ||
"@typescript-eslint/parser": "^4.15.0", | ||
"eslint": "^7.19.0", | ||
"eslint-plugin-react": "^7.22.0", | ||
"typescript": "^4.1.3" | ||
"@types/node": "^17.0.23", | ||
"@types/ramda": "^0.28.3", | ||
"@typescript-eslint/eslint-plugin": "^5.16.0", | ||
"@typescript-eslint/parser": "^5.16.0", | ||
"eslint": "^8.12.0", | ||
"eslint-plugin-react": "^7.29.4", | ||
"typescript": "^4.6.3" | ||
}, | ||
"dependencies": { | ||
"handlebars": "^4.7.7", | ||
"ramda": "^0.27.1" | ||
"ramda": "^0.28.0" | ||
}, | ||
@@ -44,3 +44,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "39d0d9f6cbb2ec1af40cd2410604e5aa42d3762f" | ||
"gitHead": "6b0226e8080d0c6b74361234b1641cccb1bb9d54" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21034
10
225
+ Addedramda@0.28.0(transitive)
- Removedramda@0.27.2(transitive)
Updatedramda@^0.28.0