Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getType = (type, $) => {
const result = []
// If TV has been selected, filter New from Continuing.
const typeString = matchSorter(possibleTypes, type)[0]
let classToSearch = `.js-seasonal-anime-list-key-${type2Class[typeString]} .seasonal-anime.js-seasonal-anime`
const typeClass = `.js-seasonal-anime-list-key-${type2Class[typeString]}`
// If TVNew or TVCon are selected, filter them out to the specific elements on page
if (typeString.substr(0, 2) === 'TV' && typeString !== 'TV') {
const tvType = matchSorter(possibleTV, typeString)[0]
$(typeClass).children('.anime-header').each(function () {
if ($(this).text() === tvType) {
classToSearch = $(this).parent().children()
}
})
}
$(classToSearch).each(function () {
if (!$(this).hasClass('kids') && !$(this).hasClass('r18')) {
.then(async (items) => {
if (!items.length) {
resolve(null)
return
}
try {
const bestMacth = getBestMatch
? match(items, name, { keys: ['name'] })[0]
: items[0]
const url = bestMacth ? bestMacth.url : items[0].url
const data = await getInfoFromURL(url)
data.url = url
resolve(data)
} catch (e) {
/* istanbul ignore next */
reject(e)
}
})
.catch(/* istanbul ignore next */(err) => reject(err))
const getType = (type, $) => {
const result = []
// If TV has been selected, filter New from Continuing.
const typeString = matchSorter(possibleTypes, type)[0]
let classToSearch = `.js-seasonal-anime-list-key-${type2Class[typeString]} .seasonal-anime.js-seasonal-anime`
const typeClass = `.js-seasonal-anime-list-key-${type2Class[typeString]}`
// If TVNew or TVCon are selected, filter them out to the specific elements on page
if (typeString.substr(0, 2) === 'TV' && typeString !== 'TV') {
const tvType = matchSorter(possibleTV, typeString)[0]
$(typeClass).children('.anime-header').each(function () {
if ($(this).text() === tvType) {
classToSearch = $(this).parent().children()
}
})
}
$(classToSearch).each(function () {
if (!$(this).hasClass('kids') && !$(this).hasClass('r18')) {
const general = $(this).find('div:nth-child(1)')
const picture = $(this).find('.image').find('img')
const prod = $(this).find('.prodsrc')
const info = $(this).find('.information')
const synopsis = $(this).find('.synopsis')
result.push({