@poprank/rankings
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -90,6 +90,14 @@ "use strict"; | ||
nfts.forEach(function (nft) { | ||
// there will always be a 'Trait Count' trait | ||
var numTraits; | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
var traitCountTrait = nft.traits.find(function (t) { return t.category === 'Meta' && t.value === rarity_meta_1.TRAIT_COUNT; }); | ||
maxTraitsNum = Math.max(maxTraitsNum, +traitCountTrait.value); | ||
var traitCountTrait = nft.traits.find(function (t) { return t.category === 'Meta' && t.typeValue === rarity_meta_1.TRAIT_COUNT; }); | ||
// If we have a "Trait Count" trait, use that, otherwise naively filter out "none" and use the remaining | ||
// traits' length | ||
if (traitCountTrait) { | ||
numTraits = +traitCountTrait.value; | ||
} | ||
else { | ||
numTraits = nft.traits.filter(function (t) { return t.value.toLowerCase() !== rarity_meta_1.NONE_TRAIT.toLowerCase(); }).length; | ||
} | ||
maxTraitsNum = Math.max(maxTraitsNum, numTraits); | ||
}); | ||
@@ -96,0 +104,0 @@ // For each NFT, go through every trait it has / doesn't have, summing the rarity of each individual trait |
{ | ||
"name": "@poprank/rankings", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
32131
427
0