Socket
Socket
Sign inDemoInstall

@poprank/rankings

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poprank/rankings - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

14

lib/rarity.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc