@bprotsyk/aso-core 2.1.67 → 2.1.68
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.
|
@@ -287,16 +287,29 @@ async function cloneDirectCampaign(app, platform) {
|
|
|
287
287
|
let allCampaigns = await getAllCampaigns();
|
|
288
288
|
let matchingCampaign = [];
|
|
289
289
|
if (platform && platform !== app_1.EPlatform.GENERAL) {
|
|
290
|
-
//
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
290
|
+
// Для конкретної платформи
|
|
291
|
+
const platformName = (0, app_1.getPlatformName)(platform);
|
|
292
|
+
matchingCampaign = allCampaigns.filter((c) => {
|
|
293
|
+
// Перевіряємо наявність ID в будь-якому місці
|
|
294
|
+
const hasId = c.name.includes(app.id.toString());
|
|
295
|
+
// Перевіряємо наявність стрілки
|
|
296
|
+
const hasArrow = c.name.includes('➥');
|
|
297
|
+
// Перевіряємо наявність платформи в дужках
|
|
298
|
+
const hasPlatform = c.name.includes(`(${platformName})`);
|
|
299
|
+
return hasId && hasArrow && hasPlatform;
|
|
300
|
+
});
|
|
294
301
|
}
|
|
295
302
|
else {
|
|
296
|
-
//
|
|
297
|
-
matchingCampaign = allCampaigns.filter((c) =>
|
|
298
|
-
|
|
299
|
-
|
|
303
|
+
// Для General платформи
|
|
304
|
+
matchingCampaign = allCampaigns.filter((c) => {
|
|
305
|
+
// Перевіряємо наявність ID в будь-якому місці
|
|
306
|
+
const hasId = c.name.includes(app.id.toString());
|
|
307
|
+
// Перевіряємо наявність стрілки
|
|
308
|
+
const hasArrow = c.name.includes('➥');
|
|
309
|
+
// Перевіряємо відсутність дужок з платформою
|
|
310
|
+
const hasNoPlatform = !/\([^)]+\)/.test(c.name);
|
|
311
|
+
return hasId && hasArrow && hasNoPlatform;
|
|
312
|
+
});
|
|
300
313
|
}
|
|
301
314
|
if (matchingCampaign.length > 0)
|
|
302
315
|
return matchingCampaign[0];
|
package/package.json
CHANGED
|
@@ -354,23 +354,31 @@ async function cloneDirectCampaign(app: IApp, platform?: EPlatform): Promise<IKe
|
|
|
354
354
|
};
|
|
355
355
|
|
|
356
356
|
let allCampaigns = await getAllCampaigns();
|
|
357
|
-
|
|
358
357
|
let matchingCampaign: IKeitaroCampaign[] = [];
|
|
359
358
|
|
|
360
359
|
if (platform && platform !== EPlatform.GENERAL) {
|
|
361
|
-
//
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
c.name.includes(
|
|
366
|
-
|
|
360
|
+
// Для конкретної платформи
|
|
361
|
+
const platformName = getPlatformName(platform);
|
|
362
|
+
matchingCampaign = allCampaigns.filter((c) => {
|
|
363
|
+
// Перевіряємо наявність ID в будь-якому місці
|
|
364
|
+
const hasId = c.name.includes(app.id.toString());
|
|
365
|
+
// Перевіряємо наявність стрілки
|
|
366
|
+
const hasArrow = c.name.includes('➥');
|
|
367
|
+
// Перевіряємо наявність платформи в дужках
|
|
368
|
+
const hasPlatform = c.name.includes(`(${platformName})`);
|
|
369
|
+
return hasId && hasArrow && hasPlatform;
|
|
370
|
+
});
|
|
367
371
|
} else {
|
|
368
|
-
//
|
|
369
|
-
matchingCampaign = allCampaigns.filter((c) =>
|
|
370
|
-
|
|
371
|
-
c.name.includes(
|
|
372
|
-
|
|
373
|
-
|
|
372
|
+
// Для General платформи
|
|
373
|
+
matchingCampaign = allCampaigns.filter((c) => {
|
|
374
|
+
// Перевіряємо наявність ID в будь-якому місці
|
|
375
|
+
const hasId = c.name.includes(app.id.toString());
|
|
376
|
+
// Перевіряємо наявність стрілки
|
|
377
|
+
const hasArrow = c.name.includes('➥');
|
|
378
|
+
// Перевіряємо відсутність дужок з платформою
|
|
379
|
+
const hasNoPlatform = !/\([^)]+\)/.test(c.name);
|
|
380
|
+
return hasId && hasArrow && hasNoPlatform;
|
|
381
|
+
});
|
|
374
382
|
}
|
|
375
383
|
|
|
376
384
|
if (matchingCampaign.length > 0) return matchingCampaign[0];
|