nappup 1.3.0 → 1.3.1
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/package.json +1 -1
- package/src/index.js +21 -14
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -344,16 +344,17 @@ async function maybeUploadStall ({
|
|
|
344
344
|
|
|
345
345
|
if (!previous) {
|
|
346
346
|
const tags = [
|
|
347
|
-
['d', dTag]
|
|
348
|
-
['c', '*']
|
|
347
|
+
['d', dTag]
|
|
349
348
|
]
|
|
350
349
|
|
|
351
|
-
if (
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
350
|
+
if (countries && countries.length > 0) {
|
|
351
|
+
countries.forEach(c => tags.push(['c', c]))
|
|
352
|
+
} else {
|
|
353
|
+
tags.push(['c', '*'])
|
|
355
354
|
}
|
|
356
355
|
|
|
356
|
+
if (self) tags.push(['self', self])
|
|
357
|
+
|
|
357
358
|
if (categories) {
|
|
358
359
|
let count = 0
|
|
359
360
|
for (const [cat, subcats] of categories) {
|
|
@@ -444,8 +445,12 @@ async function maybeUploadStall ({
|
|
|
444
445
|
|
|
445
446
|
// Update countries
|
|
446
447
|
if (countries) {
|
|
447
|
-
removeTags('
|
|
448
|
-
countries.
|
|
448
|
+
removeTags('c')
|
|
449
|
+
if (countries.length === 0) {
|
|
450
|
+
tags.push(['c', '*'])
|
|
451
|
+
} else {
|
|
452
|
+
countries.forEach(c => tags.push(['c', c]))
|
|
453
|
+
}
|
|
449
454
|
changed = true
|
|
450
455
|
}
|
|
451
456
|
|
|
@@ -503,12 +508,14 @@ async function maybeUploadStall ({
|
|
|
503
508
|
return ['d', dTag]
|
|
504
509
|
})
|
|
505
510
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
511
|
+
if (!countries) {
|
|
512
|
+
ensureTagValue('c', (existing) => {
|
|
513
|
+
if (!existing) return ['c', '*']
|
|
514
|
+
const currentValue = typeof existing[1] === 'string' ? existing[1].trim() : ''
|
|
515
|
+
if (currentValue === '') return ['c', '*']
|
|
516
|
+
return existing
|
|
517
|
+
})
|
|
518
|
+
}
|
|
512
519
|
|
|
513
520
|
const hasAuto = (field) => tags.some(tag => Array.isArray(tag) && tag[0] === 'auto' && tag[1] === field)
|
|
514
521
|
const removeAuto = (field) => {
|