• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

decentraland / marketplace / 9604252205

20 Jun 2024 08:55PM UTC coverage: 66.593% (+0.09%) from 66.499%
9604252205

push

github

web-flow
fix location error (#2263)

2606 of 5072 branches covered (51.38%)

Branch coverage included in aggregate %.

30 of 40 new or added lines in 7 files covered. (75.0%)

1 existing line in 1 file now uncovered.

7606 of 10263 relevant lines covered (74.11%)

77.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.68
/webapp/src/modules/routing/selectors.ts
1
import { matchPath } from 'react-router'
33✔
2
import { getSearch as getRouterSearch, getLocation } from 'connected-react-router'
33✔
3
import { createSelector } from 'reselect'
33✔
4
import { EmotePlayMode, GenderFilterOption, Network, Rarity } from '@dcl/schemas'
33✔
5
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
33✔
6
import { isOfEnumType } from '../../utils/enums'
33✔
7
import { AssetStatusFilter } from '../../utils/filters'
33✔
8
import { getAddress as getAccountAddress } from '../account/selectors'
33✔
9
import { AssetType } from '../asset/types'
33✔
10
import { RootState } from '../reducer'
11
import { getView } from '../ui/browse/selectors'
33✔
12
import { View } from '../ui/types'
13
import { isLandSection, isListsSection } from '../ui/utils'
33✔
14
import { Section, Sections } from '../vendor/routing/types'
33✔
15
import { VendorName } from '../vendor/types'
33✔
16
import { isVendor } from '../vendor/utils'
33✔
17
import { getAddress as getWalletAddress } from '../wallet/selectors'
33✔
18
import { locations } from './locations'
33✔
19
import { getDefaultOptionsByView, getURLParamArray, getURLParam, getURLParamArrayNonStandard, SEARCH_ARRAY_PARAM_SEPARATOR } from './search'
33✔
20
import { BrowseOptions, PageName, SortBy, SortByOption } from './types'
33✔
21

22
const getPathName = createSelector<RootState, ReturnType<typeof getLocation>, string>(getLocation, location => location.pathname)
33✔
23

24
export const getVendor = createSelector<RootState, string, VendorName>(getRouterSearch, search => {
33✔
25
  const vendor = getURLParam<VendorName>(search, 'vendor')
1✔
26
  if (vendor && isVendor(vendor)) {
1!
27
    return vendor
×
28
  }
29
  return VendorName.DECENTRALAND
1✔
30
})
31

32
export const getSection = createSelector<RootState, string, ReturnType<typeof getPathName>, VendorName, Section>(
34✔
33
  getRouterSearch,
34
  getPathName,
35
  getVendor,
36
  (search, pathname, vendor) => {
37
    const section = getURLParam<string>(search, 'section') ?? ''
7✔
38
    if (!section && pathname === locations.lands()) {
7✔
39
      return Sections.decentraland.LAND
1✔
40
    }
41

42
    if (
6✔
43
      (!section || (isOfEnumType(section, Sections[vendor]) && section === Sections[vendor].ALL)) &&
19✔
44
      pathname === locations.browse() &&
45
      vendor === VendorName.DECENTRALAND
46
    ) {
47
      return Sections.decentraland.WEARABLES
2✔
48
    }
49

50
    if (!section || !(section.toUpperCase() in Sections[vendor])) {
4✔
51
      return Sections[vendor].ALL
2✔
52
    }
53

54
    return section as Section
2✔
55
  }
56
)
57

58
export const getPageNumber = createSelector<RootState, string, number>(getRouterSearch, search => {
33✔
59
  const page = getURLParam(search, 'page')
×
60
  return page === null || isNaN(+page) ? 1 : +page
×
61
})
62

63
export const getSortBy = createSelector<RootState, string, View | undefined, Section, SortBy | undefined>(
33✔
64
  getRouterSearch,
65
  getView,
66
  getSection,
67
  (search, view, section) => {
68
    return getURLParam<SortBy>(search, 'sortBy') || getDefaultOptionsByView(view, section).sortBy
7✔
69
  }
70
)
71

72
export const getOnlyOnSale = createSelector<RootState, string, View | undefined, Section | undefined, boolean | undefined>(
33✔
73
  getRouterSearch,
74
  getView,
75
  getSection,
76
  (search, view, section) => {
77
    const onlyOnSale = getURLParam(search, 'onlyOnSale')
1✔
78
    switch (onlyOnSale) {
1!
79
      case 'true':
80
        return true
×
81
      case 'false':
82
        return false
×
83
      default:
84
        return isLandSection(section) ? undefined : getDefaultOptionsByView(view, section).onlyOnSale!
1!
85
    }
86
  }
87
)
88

89
export const getOnlyOnRent = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search => {
33✔
90
  const onlyOnRent = getURLParam(search, 'onlyOnRent')
4✔
91
  switch (onlyOnRent) {
4✔
92
    case 'true':
93
      return true
1✔
94
    case 'false':
95
      return false
1✔
96
    default:
97
      return undefined
2✔
98
  }
99
})
100

101
export const getAllSortByOptions = () => ({
33✔
102
  [SortBy.NEWEST]: { value: SortBy.NEWEST, text: t('filters.newest') },
103
  [SortBy.NAME]: { value: SortBy.NAME, text: t('filters.name') },
104
  [SortBy.RECENTLY_SOLD]: {
105
    value: SortBy.RECENTLY_SOLD,
106
    text: t('filters.recently_sold')
107
  },
108
  [SortBy.CHEAPEST]: {
109
    value: SortBy.CHEAPEST,
110
    text: t('filters.cheapest')
111
  },
112
  [SortBy.MOST_EXPENSIVE]: {
113
    value: SortBy.MOST_EXPENSIVE,
114
    text: t('filters.most_expensive')
115
  },
116
  [SortBy.MAX_RENTAL_PRICE]: {
117
    value: SortBy.MAX_RENTAL_PRICE,
118
    text: t('filters.cheapest')
119
  },
120
  [SortBy.RECENTLY_LISTED]: {
121
    value: SortBy.RECENTLY_LISTED,
122
    text: t('filters.recently_listed')
123
  },
124
  [SortBy.RENTAL_LISTING_DATE]: {
125
    value: SortBy.RENTAL_LISTING_DATE,
126
    text: t('filters.recently_listed_for_rent')
127
  }
128
})
129

130
export const getStatus = createSelector<RootState, string, AssetStatusFilter>(
33✔
131
  getRouterSearch,
132
  search => getURLParamArray<AssetStatusFilter>(search, 'status', Object.values(AssetStatusFilter))[0]
1✔
133
)
134

135
export const getSortByOptions = createSelector<RootState, boolean | undefined, boolean | undefined, string, SortByOption[]>(
33✔
136
  getOnlyOnRent,
137
  getOnlyOnSale,
138
  getStatus,
139
  (onlyOnRent, onlyOnSale, status) => {
140
    const SORT_BY_MAP = getAllSortByOptions()
6✔
141
    let orderByDropdownOptions: SortByOption[] = []
6✔
142
    if (status && isOfEnumType(status, AssetStatusFilter)) {
6✔
143
      const baseFilters = [
4✔
144
        SORT_BY_MAP[SortBy.NEWEST],
145
        SORT_BY_MAP[SortBy.RECENTLY_LISTED],
146
        SORT_BY_MAP[SortBy.RECENTLY_SOLD],
147
        SORT_BY_MAP[SortBy.CHEAPEST],
148
        SORT_BY_MAP[SortBy.MOST_EXPENSIVE]
149
      ]
150
      switch (status) {
4✔
151
        case AssetStatusFilter.ON_SALE:
152
        case AssetStatusFilter.ONLY_MINTING:
153
        case AssetStatusFilter.ONLY_LISTING:
154
          orderByDropdownOptions = baseFilters
3✔
155
          break
3✔
156
        case AssetStatusFilter.NOT_FOR_SALE:
157
          orderByDropdownOptions = [SORT_BY_MAP[SortBy.NEWEST]]
1✔
158
          break
1✔
159
      }
160
      return orderByDropdownOptions
4✔
161
    }
162
    if (onlyOnRent) {
2✔
163
      orderByDropdownOptions = [
1✔
164
        {
165
          value: SortBy.RENTAL_LISTING_DATE,
166
          text: t('filters.recently_listed_for_rent')
167
        },
168
        { value: SortBy.NAME, text: t('filters.name') },
169
        { value: SortBy.NEWEST, text: t('filters.newest') },
170
        { value: SortBy.MAX_RENTAL_PRICE, text: t('filters.cheapest') }
171
      ]
172
    } else {
173
      orderByDropdownOptions = [
1✔
174
        { value: SortBy.NEWEST, text: t('filters.newest') },
175
        { value: SortBy.NAME, text: t('filters.name') }
176
      ]
177
    }
178

179
    if (onlyOnSale) {
2✔
180
      orderByDropdownOptions = [
1✔
181
        {
182
          value: SortBy.RECENTLY_LISTED,
183
          text: t('filters.recently_listed')
184
        },
185
        {
186
          value: SortBy.RECENTLY_SOLD,
187
          text: t('filters.recently_sold')
188
        },
189
        {
190
          value: SortBy.CHEAPEST,
191
          text: t('filters.cheapest')
192
        },
193
        ...orderByDropdownOptions
194
      ]
195
    }
196

197
    return orderByDropdownOptions
2✔
198
  }
199
)
200

201
export const getIsSoldOut = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search => {
33✔
202
  const isSoldOut = getURLParam(search, 'isSoldOut')
×
203
  return isSoldOut === 'true'
×
204
})
205

206
export const getIsMap = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search => {
33✔
207
  const isMap = getURLParam(search, 'isMap')
7✔
208
  return isMap === null ? undefined : isMap === 'true'
7✔
209
})
210

211
export const getItemId = createSelector<RootState, string, string | undefined>(getRouterSearch, search => {
33✔
212
  const itemId = getURLParam(search, 'itemId')
×
213
  return itemId ? itemId : undefined
×
214
})
215

216
export const getIsFullscreen = createSelector<RootState, string, boolean | undefined, boolean | undefined>(
97✔
217
  getRouterSearch,
218
  getIsMap,
219
  (search, isMap) => {
220
    const isFullscreen = getURLParam(search, 'isFullscreen')
4✔
221
    return isFullscreen === null ? undefined : isMap && isFullscreen === 'true'
4!
222
  }
223
)
224

225
export const getRarities = createSelector<RootState, string, Rarity[]>(getRouterSearch, search =>
33✔
226
  getURLParamArrayNonStandard<Rarity>(search, 'rarities', Object.values(Rarity).filter(value => typeof value === 'string') as string[])
14✔
227
)
228

229
export const getWearableGenders = createSelector<RootState, string, GenderFilterOption[]>(getRouterSearch, search =>
33✔
230
  getURLParamArrayNonStandard<GenderFilterOption>(search, 'genders', Object.values(GenderFilterOption))
1✔
231
)
232

233
export const getContracts = createSelector<RootState, string, string[]>(
33✔
234
  getRouterSearch,
235
  search => getURLParam<string>(search, 'contracts')?.split(SEARCH_ARRAY_PARAM_SEPARATOR) || []
2✔
236
)
237

238
export const getCreators = createSelector<RootState, string, string[]>(getRouterSearch, search =>
33✔
239
  getURLParamArray<string>(search, 'creators')
2✔
240
)
241

242
export const getSearch = createSelector<RootState, string, string>(getRouterSearch, search => getURLParam(search, 'search') || '')
33!
243

244
export const getNetwork = createSelector<RootState, string, Network | undefined>(
33✔
245
  getRouterSearch,
246
  search => (getURLParam(search, 'network') as Network) || undefined
1✔
247
)
248

249
export const getAssetType = createSelector<RootState, string, string, VendorName, AssetType>(
33✔
250
  getRouterSearch,
251
  getPathName,
252
  getVendor,
253
  (search, pathname, vendor) => {
254
    const assetTypeParam = getURLParam(search, 'assetType') ?? ''
5✔
255

256
    if (!assetTypeParam || !(assetTypeParam.toUpperCase() in AssetType)) {
5✔
257
      if (vendor === VendorName.DECENTRALAND && pathname === locations.browse()) {
4✔
258
        return AssetType.ITEM
2✔
259
      }
260

261
      return AssetType.NFT
2✔
262
    }
263
    return assetTypeParam as AssetType
1✔
264
  }
265
)
266

267
export const getEmotePlayMode = createSelector<RootState, string, EmotePlayMode[] | undefined>(
33✔
268
  getRouterSearch,
269
  search => getURLParamArray<EmotePlayMode>(search, 'emotePlayMode') || undefined
1!
270
)
271

272
export const getViewAsGuest = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search =>
33✔
273
  getURLParam(search, 'viewAsGuest') ? getURLParam(search, 'viewAsGuest') === 'true' : undefined
3✔
274
)
275
export const getOnlySmart = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search =>
33✔
276
  getURLParam(search, 'onlySmart') ? getURLParam(search, 'onlySmart') === 'true' : undefined
4✔
277
)
278

279
export const getMinPrice = createSelector<RootState, string, string>(
33✔
280
  getRouterSearch,
281
  search => (getURLParam(search, 'minPrice') as string) || ''
1!
282
)
283

284
export const getMaxPrice = createSelector<RootState, string, string>(
33✔
285
  getRouterSearch,
286
  search => (getURLParam(search, 'maxPrice') as string) || ''
1!
287
)
288

289
export const getMinEstateSize = createSelector<RootState, string, string>(
33✔
290
  getRouterSearch,
291
  search => (getURLParam(search, 'minEstateSize') as string) || ''
2✔
292
)
293

294
export const getMaxEstateSize = createSelector<RootState, string, string>(
33✔
295
  getRouterSearch,
296
  search => (getURLParam(search, 'maxEstateSize') as string) || ''
2✔
297
)
298

299
export const getRentalDays = createSelector<RootState, string, number[]>(getRouterSearch, search =>
33✔
300
  getURLParamArray(search, 'rentalDays').map(value => Number.parseInt(value))
1✔
301
)
302

303
export const getMinDistanceToPlaza = createSelector<RootState, string, string>(
33✔
304
  getRouterSearch,
305
  search => (getURLParam(search, 'minDistanceToPlaza') as string) || ''
1✔
306
)
307

308
export const getMaxDistanceToPlaza = createSelector<RootState, string, string>(
33✔
309
  getRouterSearch,
310
  search => (getURLParam(search, 'maxDistanceToPlaza') as string) || ''
1✔
311
)
312

313
export const getAdjacentToRoad = createSelector<RootState, string, boolean>(
33✔
314
  getRouterSearch,
315
  search => getURLParam(search, 'adjacentToRoad') === 'true'
1✔
316
)
317

318
export const getEmoteHasSound = createSelector<RootState, string, boolean>(
33✔
319
  getRouterSearch,
320
  search => getURLParam(search, 'emoteHasSound') === 'true'
1✔
321
)
322

323
export const getEmoteHasGeometry = createSelector<RootState, string, boolean>(
33✔
324
  getRouterSearch,
325
  search => getURLParam(search, 'emoteHasGeometry') === 'true'
1✔
326
)
327

328
export const getCurrentLocationAddress = createSelector<RootState, string, string | undefined, string | undefined, string | undefined>(
33✔
329
  getPathName,
330
  getWalletAddress,
331
  getAccountAddress,
332
  (pathname, walletAddress, accountAddress) => {
333
    let address: string | undefined
334

335
    if (pathname === locations.currentAccount()) {
×
336
      address = walletAddress
×
337
    } else {
NEW
338
      address = accountAddress
×
339
    }
340

341
    return address ? address.toLowerCase() : undefined
×
342
  }
343
)
344

345
export const getPaginationUrlParams = createSelector(getPageNumber, getSortBy, getSearch, (page, sortBy, search) => ({
33✔
346
  page,
347
  sortBy,
348
  search
349
}))
350

351
export const getAssetsUrlParams = createSelector(
33✔
352
  getOnlyOnSale,
353
  getOnlySmart,
354
  getIsSoldOut,
355
  getItemId,
356
  getContracts,
357
  getCreators,
358
  getSearch,
359
  (onlyOnSale, onlySmart, isSoldOut, itemId, contracts, creators, search) => ({
×
360
    onlyOnSale,
361
    onlySmart,
362
    isSoldOut,
363
    itemId,
364
    contracts,
365
    creators,
366
    search
367
  })
368
)
369

370
export const getLandsUrlParams = createSelector(
33✔
371
  getIsMap,
372
  getIsFullscreen,
373
  getMinEstateSize,
374
  getMaxEstateSize,
375
  getMinDistanceToPlaza,
376
  getMaxDistanceToPlaza,
377
  getAdjacentToRoad,
378
  getRentalDays,
379
  (isMap, isFullscreen, minEstateSize, maxEstateSize, minDistanceToPlaza, maxDistanceToPlaza, adjacentToRoad, rentalDays) => ({
×
380
    isMap,
381
    isFullscreen,
382
    minEstateSize,
383
    maxEstateSize,
384
    minDistanceToPlaza,
385
    maxDistanceToPlaza,
386
    adjacentToRoad,
387
    rentalDays
388
  })
389
)
390

391
export const getWearablesUrlParams = createSelector(
33✔
392
  getRarities,
393
  getWearableGenders,
394
  getView,
395
  getViewAsGuest,
396
  getMinPrice,
397
  getMaxPrice,
398
  getStatus,
399
  (rarities, wearableGenders, view, viewAsGuest, minPrice, maxPrice, status) => ({
×
400
    rarities,
401
    wearableGenders,
402
    view,
403
    viewAsGuest,
404
    minPrice,
405
    maxPrice,
406
    status
407
  })
408
)
409

410
export const getEmoteUrlParams = createSelector(
33✔
411
  [getEmotePlayMode, getEmoteHasGeometry, getEmoteHasSound],
412
  (emotePlayMode, emoteHasGeometry, emoteHasSound) => ({
×
413
    emotePlayMode,
414
    emoteHasGeometry,
415
    emoteHasSound
416
  })
417
)
418

419
export const getCurrentBrowseOptions = createSelector(
62✔
420
  [
421
    getAssetType,
422
    getCurrentLocationAddress,
423
    getVendor,
424
    getSection,
425
    getNetwork,
426
    getPaginationUrlParams,
427
    getAssetsUrlParams,
428
    getLandsUrlParams,
429
    getWearablesUrlParams,
430
    getOnlyOnRent,
431
    getOnlyOnSale,
432
    getEmoteUrlParams
433
  ],
434
  (
435
    assetType,
436
    address,
437
    vendor,
438
    section,
439
    network,
440
    paginationUrlParams,
441
    AssetsUrlParams,
442
    landsUrlParams,
443
    wearablesUrlParams,
444
    onlyOnRent,
445
    onlyOnSale,
446
    emoteUrlParams
447
  ) =>
448
    ({
×
449
      assetType,
450
      address,
451
      vendor,
452
      section,
453
      network,
454
      ...emoteUrlParams,
455
      ...AssetsUrlParams,
456
      ...paginationUrlParams,
457
      ...landsUrlParams,
458
      ...wearablesUrlParams,
459
      onlyOnRent,
460
      onlyOnSale
461
    }) as BrowseOptions
462
)
463

464
export const getCurrentSearch = createSelector([getAssetsUrlParams], AssetsUrlParams => {
33✔
465
  const { search } = AssetsUrlParams
×
466
  return search
×
467
})
468

469
export const hasFiltersEnabled = createSelector<RootState, BrowseOptions, boolean>(getCurrentBrowseOptions, browseOptions => {
33✔
470
  const {
471
    network,
472
    wearableGenders,
473
    rarities,
474
    contracts,
475
    emotePlayMode,
476
    onlyOnRent,
477
    onlyOnSale,
478
    minPrice,
479
    maxPrice,
480
    minEstateSize,
481
    maxEstateSize,
482
    section,
483
    minDistanceToPlaza,
484
    maxDistanceToPlaza,
485
    adjacentToRoad,
486
    creators,
487
    rentalDays,
488
    status,
489
    onlySmart,
490
    emoteHasGeometry,
491
    emoteHasSound
492
  } = browseOptions
17✔
493
  const isLand = isLandSection(section as Section)
17✔
494

495
  if (isListsSection(section as Section)) return false
17✔
496

497
  if (isLand) {
16✔
498
    const hasOnSaleFilter = onlyOnSale === true
2✔
499
    const hasOnRentFilter = onlyOnRent === true
2✔
500
    return (
2✔
501
      (hasOnSaleFilter && !hasOnRentFilter) ||
11!
502
      (hasOnRentFilter && !hasOnSaleFilter) ||
503
      !!minPrice ||
504
      !!maxPrice ||
505
      !!minEstateSize ||
506
      !!maxEstateSize ||
507
      !!minDistanceToPlaza ||
508
      !!maxDistanceToPlaza ||
509
      !!adjacentToRoad ||
510
      !!rentalDays?.length
511
    )
512
  }
513

514
  const hasNetworkFilter = network !== undefined
14✔
515
  const hasGenderFilter = wearableGenders && wearableGenders.length > 0
14✔
516
  const hasRarityFilter = rarities && rarities.length > 0
14✔
517
  const hasContractsFilter = contracts && contracts.length > 0
14✔
518
  const hasCreatorFilter = creators && creators.length > 0
14✔
519
  const hasEmotePlayModeFilter = emotePlayMode && emotePlayMode.length > 0
14✔
520
  const hasNotOnSaleFilter = onlyOnSale === false
14✔
521

522
  return (
14✔
523
    hasNetworkFilter ||
124✔
524
    hasGenderFilter ||
525
    onlySmart ||
526
    hasRarityFilter ||
527
    hasContractsFilter ||
528
    hasCreatorFilter ||
529
    hasEmotePlayModeFilter ||
530
    !!minPrice ||
531
    !!maxPrice ||
532
    hasNotOnSaleFilter ||
533
    emoteHasSound ||
534
    emoteHasGeometry ||
535
    (!!status && status !== AssetStatusFilter.ON_SALE)
536
  )
537
})
538

539
export const getIsBuyWithCardPage = createSelector<RootState, string, boolean>(getRouterSearch, search => {
33✔
540
  const withCard = getURLParam(search, 'withCard')
×
541
  return withCard !== null && withCard === 'true'
×
542
})
543

544
const buildExactMatchProps = (path: string) => {
33✔
545
  return { path, exact: true }
43✔
546
}
547

548
export const getPageName = createSelector<RootState, string, PageName>(getPathName, pathname => {
33✔
549
  if (pathname === '/') {
23✔
550
    return PageName.HOME
1✔
551
  } else if (matchPath(pathname, buildExactMatchProps(locations.manage('anAddress', 'anId')))) {
22✔
552
    return PageName.MANAGE_NFT
1✔
553
  } else if (matchPath(pathname, buildExactMatchProps(locations.buyStatusPage(AssetType.NFT)))) {
21✔
554
    return PageName.BUY_NFT_STATUS
1✔
555
  } else if (matchPath(pathname, locations.buyStatusPage(AssetType.ITEM))) {
20✔
556
    return PageName.BUY_ITEM_STATUS
1✔
557
  } else if (matchPath(pathname, locations.cancel())) {
19✔
558
    return PageName.CANCEL_NFT_SALE
1✔
559
  } else if (matchPath(pathname, locations.transfer())) {
18✔
560
    return PageName.TRANSFER_NFT
1✔
561
  } else if (matchPath(pathname, locations.bid())) {
17✔
562
    return PageName.BID_NFT
1✔
563
  } else if (matchPath(pathname, locations.signIn())) {
16✔
564
    return PageName.SIGN_IN
1✔
565
  } else if (matchPath(pathname, locations.settings())) {
15✔
566
    return PageName.SETTINGS
1✔
567
  } else if (matchPath(pathname, locations.lands())) {
14✔
568
    return PageName.LANDS
1✔
569
  } else if (matchPath(pathname, locations.names())) {
13!
570
    return PageName.NAMES
×
571
  } else if (matchPath(pathname, locations.collection())) {
13✔
572
    return PageName.COLLECTION
1✔
573
  } else if (matchPath(pathname, locations.browse())) {
12✔
574
    return PageName.BROWSE
1✔
575
  } else if (matchPath(pathname, locations.campaign())) {
11✔
576
    return PageName.CAMPAIGN
1✔
577
  } else if (matchPath(pathname, locations.currentAccount())) {
10✔
578
    return PageName.ACCOUNT
1✔
579
  } else if (matchPath(pathname, locations.list())) {
9✔
580
    return PageName.LIST
1✔
581
  } else if (matchPath(pathname, locations.lists())) {
8✔
582
    return PageName.LISTS
1✔
583
  } else if (matchPath(pathname, locations.account())) {
7✔
584
    return PageName.ACCOUNTS
1✔
585
  } else if (matchPath(pathname, locations.nft())) {
6✔
586
    return PageName.NFT_DETAIL
1✔
587
  } else if (matchPath(pathname, locations.item())) {
5✔
588
    return PageName.ITEM_DETAIL
1✔
589
  } else if (matchPath(pathname, locations.parcel())) {
4✔
590
    return PageName.PARCEL_DETAIL
1✔
591
  } else if (matchPath(pathname, locations.estate())) {
3✔
592
    return PageName.ESTATE_DETAIL
1✔
593
  } else if (matchPath(pathname, locations.activity())) {
2✔
594
    return PageName.ACTIVITY
1✔
595
  }
596
  throw new Error('Unknown page')
1✔
597
})
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc