* Build(deps-dev): bump eslint-plugin-import from 2.17.3 to 2.18.0 Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.17.3 to 2.18.0. - [Release notes](https://github.com/benmosher/eslint-plugin-import/releases) - [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md) - [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.17.3...v2.18.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Autofixes
33 lines
739 B
JavaScript
33 lines
739 B
JavaScript
'use strict'
|
|
|
|
const Joi = require('@hapi/joi')
|
|
const { nonNegativeInteger } = require('../validators')
|
|
const { BaseJsonService } = require('..')
|
|
|
|
const condaSchema = Joi.object({
|
|
latest_version: Joi.string().required(),
|
|
conda_platforms: Joi.array()
|
|
.items(Joi.string())
|
|
.required(),
|
|
files: Joi.array()
|
|
.items(
|
|
Joi.object({
|
|
ndownloads: nonNegativeInteger,
|
|
})
|
|
)
|
|
.required(),
|
|
}).required()
|
|
|
|
module.exports = class BaseCondaService extends BaseJsonService {
|
|
static get defaultBadgeData() {
|
|
return { label: 'conda' }
|
|
}
|
|
|
|
async fetch({ channel, pkg }) {
|
|
return this._requestJson({
|
|
schema: condaSchema,
|
|
url: `https://api.anaconda.org/package/${channel}/${pkg}`,
|
|
})
|
|
}
|
|
}
|