Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@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.2 to 1.0.3

19

lib/rarity.js

@@ -51,4 +51,4 @@ "use strict";

nfts.forEach(function (nft) {
nft.traits.forEach(function (n) {
pushTraitToCollectionTraits(collectionTraitsNoRarity, n);
nft.traits.forEach(function (t) {
pushTraitToCollectionTraits(collectionTraitsNoRarity, t);
});

@@ -121,11 +121,12 @@ });

var trait = (_a = traitValuesOfThisType.find(function (t) { return t.typeValue === traitType; })) !== null && _a !== void 0 ? _a : traitValuesOfThisType.find(function (t) { return t.category === 'None'; });
if (trait.value === 'none')
// Temporarily disable this ahead of reworking our trait calculation
if (trait.category === 'None')
return;
var currTraitValue = trait.value;
var value = trait.value, typeValue = trait.typeValue;
var currTraitValueCount = trait.traitCount;
var collectionTraitValueCountPairs = collectionTraitsNoRarity[trait.typeValue];
var collectionTraitValueCountPairs = collectionTraitsNoRarity[typeValue];
var traitTypeCount = collectionTraitValueCountPairs.length;
var currTraitRarity = (0, exports.traitRarityTraitSum)(currTraitValueCount, nfts.length, traitTypeCount);
var currTraitSum = 0;
if (trait.typeValue === rarity_meta_1.TRAIT_COUNT) {
if (typeValue === rarity_meta_1.TRAIT_COUNT) {
currTraitSum = currTraitRarity * (maxTraitsNum - nft.traits.length);

@@ -137,4 +138,6 @@ }

currTraitSum = +currTraitSum.toFixed(3);
if (!collectionTraits[trait.typeValue].find(function (t) { return t.value === currTraitValue; }))
collectionTraits[trait.typeValue].push((__assign(__assign({}, trait), { traitCount: currTraitValueCount, rarityTraitSum: currTraitSum })));
if (!collectionTraits[typeValue])
collectionTraits[typeValue] = [];
if (!collectionTraits[typeValue].find(function (t) { return t.value === value; }))
collectionTraits[typeValue].push((__assign(__assign({}, trait), { traitCount: currTraitValueCount, rarityTraitSum: currTraitSum })));
rarityTraitSum += currTraitSum;

@@ -141,0 +144,0 @@ nftTraitsWithRarity.push(__assign(__assign({}, trait), { traitCount: 1, rarityTraitSum: currTraitSum }));

{
"name": "@poprank/rankings",
"version": "1.0.2",
"version": "1.0.3",
"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