sales-frontend-utils 0.0.58 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1185,8 +1185,19 @@ var getGenderName = (genderCode) => {
1185
1185
  return genderCode ? GENDER_LABEL_MAP[genderCode] : "";
1186
1186
  };
1187
1187
 
1188
+ // src/duplicate.ts
1189
+ var filterNameCookieKey = "dsp-debug-mode-filter-name";
1190
+ function isDebugByFilterName(name) {
1191
+ const filterNames = getCookie(filterNameCookieKey)?.split(",");
1192
+ return filterNames?.includes(name) || false;
1193
+ }
1194
+ var isDownloaderFilter = () => isDebugByFilterName("downloader");
1195
+
1188
1196
  // src/utils/download-utils.ts
1189
1197
  var getBlobUrl = async (url) => {
1198
+ if (isDownloaderFilter()) {
1199
+ alert(`[debug filter:downloader] getBlobUrl \uD638\uCD9C- ${url}`);
1200
+ }
1190
1201
  let downloadUrl = "";
1191
1202
  if (url.startsWith("http")) {
1192
1203
  const response = await fetch(url);
@@ -1208,6 +1219,9 @@ var downloadFromNewWindow = async (url, fileName) => {
1208
1219
  try {
1209
1220
  const aTag = document.createElement("a");
1210
1221
  const downloadUrl = await getBlobUrl(url);
1222
+ if (isDownloaderFilter()) {
1223
+ alert(`[debug filter:downloader] downloadFromNewWindow \uD638\uCD9C- ${downloadUrl}`);
1224
+ }
1211
1225
  aTag.href = downloadUrl;
1212
1226
  aTag.download = fileName;
1213
1227
  const newWin = window.open();
@@ -1224,6 +1238,9 @@ var downloadFromCurrentWindow = async (url, fileName) => {
1224
1238
  try {
1225
1239
  const a = document.createElement("a");
1226
1240
  const downloadUrl = await getBlobUrl(url);
1241
+ if (isDownloaderFilter()) {
1242
+ alert(`[debug filter:downloader] downloadFromCurrentWindow \uD638\uCD9C- ${downloadUrl}`);
1243
+ }
1227
1244
  a.href = downloadUrl;
1228
1245
  a.download = fileName;
1229
1246
  document.body.appendChild(a);