Comparing version 0.0.21 to 0.0.22
@@ -20,5 +20,9 @@ const path = require('path'); | ||
function isGlobalRef(refName) { | ||
return refName.startsWith('$') || refName.startsWith('global_'); | ||
} | ||
function hashRef(file, refName) { | ||
let strToHash; | ||
if (refName.startsWith('$') || refName.startsWith('global_')) { | ||
if (isGlobalRef(refName)) { | ||
strToHash = refName; | ||
@@ -913,5 +917,10 @@ } | ||
const str = [...matchedRefs].map((key) => { | ||
const val = refs[key]; | ||
let val = refs[key]; | ||
if (!val) { | ||
throw new Error(`ref ${key} not found in ${options.file} but referenced in JS`); | ||
if (isGlobalRef(key)) { | ||
val = addRef([], key); | ||
} | ||
else { | ||
throw new Error(`ref ${key} not found in ${options.file} but referenced in JS`); | ||
} | ||
} | ||
@@ -928,5 +937,10 @@ return `${key}: $selectByClass('${val}')`; | ||
.replace(/\bref:([a-zA-Z0-9$_]+)\b/g, (match, g1) => { | ||
const val = refs[g1]; | ||
let val = refs[g1]; | ||
if (!val) { | ||
throw new Error(`ref ${g1} not found in ${options.file} but referenced in CSS`); | ||
if (isGlobalRef(g1)) { | ||
val = addRef([], g1); | ||
} | ||
else { | ||
throw new Error(`ref ${g1} not found in ${options.file} but referenced in CSS`); | ||
} | ||
} | ||
@@ -933,0 +947,0 @@ return `.${val}`; |
{ | ||
"name": "nixy", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "HTML templating framework focused on SSR and performance", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53364
1870