--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
24
node_modules/less/lib/less-browser/utils.js
generated
vendored
Normal file
24
node_modules/less/lib/less-browser/utils.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
module.exports = {
|
||||
extractId: function(href) {
|
||||
return href.replace(/^[a-z-]+:\/+?[^\/]+/, '') // Remove protocol & domain
|
||||
.replace(/[\?\&]livereload=\w+/, '') // Remove LiveReload cachebuster
|
||||
.replace(/^\//, '') // Remove root /
|
||||
.replace(/\.[a-zA-Z]+$/, '') // Remove simple extension
|
||||
.replace(/[^\.\w-]+/g, '-') // Replace illegal characters
|
||||
.replace(/\./g, ':'); // Replace dots with colons(for valid id)
|
||||
},
|
||||
addDataAttr: function(options, tag) {
|
||||
for (var opt in tag.dataset) {
|
||||
if (tag.dataset.hasOwnProperty(opt)) {
|
||||
if (opt === "env" || opt === "dumpLineNumbers" || opt === "rootpath" || opt === "errorReporting") {
|
||||
options[opt] = tag.dataset[opt];
|
||||
} else {
|
||||
try {
|
||||
options[opt] = JSON.parse(tag.dataset[opt]);
|
||||
}
|
||||
catch(_) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Reference in a new issue