Skip to content

Commit

Permalink
Use types over records
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Jun 27, 2023
1 parent 87e4d0b commit 21ec151
Showing 1 changed file with 16 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,22 @@ export type ScaledScore = [total: number, possible: number]
export const SKIP: ScaledScore = [0, 0]
export type Score = ScaledScore | PassFailScore

const attributesScoringCriteria = {
Attributes: true,
}

const metadataScoringCriteria = {
'Animation URL': true,
'Background Color': true,
Description: true,
'External Url': true,
Image: true,
'Image Data': true,
Name: true,
'YouTube URL': true,
...attributesScoringCriteria,
}

export const scoringCriteria = {
'Contract Address': true,
Supply: true,
'Token Id': true,
Type: true,
...metadataScoringCriteria,
}

type ScoringCriteriaKey = keyof typeof scoringCriteria & PropertyKey
export type AttributesScoringCriteria = 'Attributes'

export type MetadataScoringCriteria =
| 'Animation URL'
| 'Background Color'
| 'Description'
| 'External Url'
| 'Image'
| 'Image Data'
| 'Name'
| 'YouTube URL'
| AttributesScoringCriteria

export type ScoringCriteria = 'Contract Address' | 'Supply' | 'Token Id' | 'Type' | MetadataScoringCriteria

export type ScoringCriteriaKey = ScoringCriteria & PropertyKey

export type NftAnalysis = {
[key in ScoringCriteriaKey]: Score
Expand Down

0 comments on commit 21ec151

Please sign in to comment.