Skip to content

Commit

Permalink
refactor getNewToken
Browse files Browse the repository at this point in the history
  • Loading branch information
mul53 committed Jul 25, 2024
1 parent 777d6bd commit b14da1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 1 addition & 12 deletions scripts/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@ const isNameValid = require('./helpers/isNameValid')
const isSymbolValid = require('./helpers/isSymbolValid')
const getNewTokenList = require('./helpers/getNewTokenList')
const getCurrentTokenList = require('./helpers/getCurrentTokenList')

async function getNewToken(newTokenList, currentTokenList) {
const currentIds = new Set(
currentTokenList.tokens.map((token) => token.address),
)

const newTokens = newTokenList.tokens.filter(
(token) => !currentIds.has(token.address),
)

return newTokens[0]
}
const getNewToken = require('./helpers/getNewToken')

async function analyze() {
const errors = []
Expand Down
11 changes: 11 additions & 0 deletions scripts/helpers/getNewToken.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = async function getNewToken(newTokenList, currentTokenList) {
const currentIds = new Set(
currentTokenList.tokens.map((token) => token.address),
)

const newTokens = newTokenList.tokens.filter(
(token) => !currentIds.has(token.address),
)

return newTokens[0]
}

0 comments on commit b14da1c

Please sign in to comment.