Skip to content

Commit f424b92

Browse files
refactor: url in lowercase
1 parent fdfdc17 commit f424b92

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/plugin.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,33 +116,33 @@ module.exports = postcss.plugin(pluginName, function(options) {
116116
return;
117117
}
118118

119-
const URLNode = node.nodes[0];
120-
const URL = URLNode.value.trim().replace(/\\[\r\n]/g, "");
119+
const urlNode = node.nodes[0];
120+
const url = urlNode.value.trim().replace(/\\[\r\n]/g, "");
121121

122122
// Skip empty URLs
123123
// Empty URL function equals request to current stylesheet where it is declared
124-
if (URL.length === 0) {
124+
if (url.length === 0) {
125125
return;
126126
}
127127

128-
if (!loaderUtils.isUrlRequest(URL)) {
128+
if (!loaderUtils.isUrlRequest(url)) {
129129
return;
130130
}
131131

132132
// Remove spaces before and after
133133
node.before = "";
134134
node.after = "";
135135

136-
const splittedURL = URL.split(/(\?)?#/);
136+
const splittedURL = url.split(/(\?)?#/);
137137
const normalizedURL = splittedURL[0];
138138

139139
const requestedURL = loaderUtils.urlToRequest(normalizedURL);
140140
const placeholder =
141141
"___CSS_LOADER_IMPORT_URL_PLACEHOLDER___" + index + "___";
142142

143-
URLNode.value = placeholder;
143+
urlNode.value = placeholder;
144144
// Strip quotes, they will be re-added if the module needs them
145-
URLNode.quote = "";
145+
urlNode.quote = "";
146146

147147
let hasURLEscapeRuntimeCode = false;
148148

0 commit comments

Comments
 (0)