aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/plugins/sanitize-scripts-import-webpack-plugin.js
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-08 18:51:39 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-08 18:51:39 +0530
commit915947e3e7ab7c1fa07596ab4b13bf6e1cc50b76 (patch)
tree8e8a7137d2177dc52da83a5af9e8f7b442ed4a71 /config/webpack/plugins/sanitize-scripts-import-webpack-plugin.js
parent4993aaf41e132dd0805bf6c487901d9f2aecfcfe (diff)
downloadbanglar-bhumi-utils-915947e3e7ab7c1fa07596ab4b13bf6e1cc50b76.tar.gz
banglar-bhumi-utils-915947e3e7ab7c1fa07596ab4b13bf6e1cc50b76.zip
Cleaned code.
Diffstat (limited to 'config/webpack/plugins/sanitize-scripts-import-webpack-plugin.js')
-rw-r--r--config/webpack/plugins/sanitize-scripts-import-webpack-plugin.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/config/webpack/plugins/sanitize-scripts-import-webpack-plugin.js b/config/webpack/plugins/sanitize-scripts-import-webpack-plugin.js
index 61ce804..37c2cf4 100644
--- a/config/webpack/plugins/sanitize-scripts-import-webpack-plugin.js
+++ b/config/webpack/plugins/sanitize-scripts-import-webpack-plugin.js
@@ -1,15 +1,13 @@
const { sources } = require("webpack");
-const propectualIndexOf = (string, characterList, start) => {
+const perpectualIndexOf = (string, characterList, start) => {
if (start > 0) {
- let i = 0;
let x = start;
- while (i < characterList.length) {
+ for (let i = 0; i < characterList.length; i++) {
x = string.indexOf(characterList[i], x + 1);
if (x < 0) {
return -1;
}
- i++;
}
return x;
} else {
@@ -33,8 +31,8 @@ class SanitizeScriptsImportPlugin {
let previouslyEnded = 0;
let code = "";
while (true) {
- const start = propectualIndexOf(currentAssetContent, ["\n/***/", "\n/***/", "\n"], previouslyEnded + 1);
- previouslyEnded = propectualIndexOf(currentAssetContent, ["\n/***/"], start + 1);
+ const start = perpectualIndexOf(currentAssetContent, ["\n/***/", "\n/***/", "\n"], previouslyEnded + 1);
+ previouslyEnded = perpectualIndexOf(currentAssetContent, ["\n/***/"], start + 1);
if (previouslyEnded < 0) {
break;
} else {