@poprank/rankings
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -18,4 +18,5 @@ import { NftInit, NftWithRank, TraitBase, TraitPreDb } from './types'; | ||
* @param collection | ||
* @param addMeta whether to add all non Trait Count meta traits. Trait Count is always added | ||
* @returns | ||
*/ | ||
export declare const calcMetaTraits: (nftTraits: TraitBase[], collection: string) => TraitBase[]; | ||
export declare const calcMetaTraits: (nftTraits: TraitBase[], collection: string, addMeta?: boolean | undefined) => TraitBase[]; |
@@ -162,6 +162,16 @@ "use strict"; | ||
* @param collection | ||
* @param addMeta whether to add all non Trait Count meta traits. Trait Count is always added | ||
* @returns | ||
*/ | ||
var calcMetaTraits = function (nftTraits, collection) { | ||
var calcMetaTraits = function (nftTraits, collection, addMeta) { | ||
var metaTraits = []; | ||
// Add the trait count | ||
metaTraits.push({ | ||
typeValue: rarity_meta_1.TRAIT_COUNT, | ||
value: "".concat(nftTraits.filter(function (t) { return t.value.toLowerCase() !== rarity_meta_1.NONE_TRAIT.toLowerCase(); }).length), | ||
category: 'Meta', | ||
displayType: null, | ||
}); | ||
if (!addMeta) | ||
return metaTraits; | ||
// Call all the functions that calculate meta traits for this collection | ||
@@ -168,0 +178,0 @@ rarity_meta_1.collectionNameMetaFunctionPairs.forEach(function (colMetaFuncPair) { |
{ | ||
"name": "@poprank/rankings", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
33406
441