remove logoWidth param (#10878)

* remove `logoWidth` param
Fixes #10285

* remove `logoWidth` param
Fixes #10285

* fix: add `logoWidth` parameter to BaseService test
This commit is contained in:
jNullj
2025-03-02 13:16:02 +02:00
committed by GitHub
parent 779f8ae61c
commit 42e78083ab
7 changed files with 6 additions and 43 deletions

View File

@@ -36,7 +36,6 @@ const endpointSchema = Joi.object({
logoSvg: Joi.string(),
logoColor: optionalStringWhenNamedLogoPresent,
logoSize: optionalStringWhenNamedLogoPresent,
logoWidth: optionalNumberWhenAnyLogoPresent,
style: Joi.string(),
cacheSeconds: Joi.number().integer().min(0),
/*
@@ -45,6 +44,7 @@ const endpointSchema = Joi.object({
passing it should not throw an error
*/
logoPosition: optionalNumberWhenAnyLogoPresent,
logoWidth: optionalNumberWhenAnyLogoPresent,
})
// `namedLogo` or `logoSvg`; not both.
.oxor('namedLogo', 'logoSvg')

View File

@@ -101,13 +101,6 @@ The endpoint badge takes a single required query param: <code>url</code>, which
Supported for simple-icons logos only.
</td>
</tr>
<tr>
<td><code>logoWidth</code></td>
<td>
Default: none. Same meaning as the query string. Can be overridden by
the query string.
</td>
</tr>
<tr>
<td><code>style</code></td>
<td>
@@ -156,7 +149,6 @@ export default class Endpoint extends BaseJsonService {
logoSvg,
logoColor,
logoSize,
logoWidth,
style,
cacheSeconds,
}) {
@@ -170,7 +162,6 @@ export default class Endpoint extends BaseJsonService {
logoSvg,
logoColor,
logoSize,
logoWidth,
style,
// don't allow the user to set cacheSeconds any shorter than this._cacheLength
cacheSeconds: Math.max(

View File

@@ -118,6 +118,8 @@ t.create('custom svg logo')
expect(body).to.include(getSimpleIcon({ name: 'npm' }))
})
// The logoWidth param was removed, but passing it should not
// throw a validation error. It should just do nothing.
t.create('logoWidth')
.get('.json?url=https://example.com/badge')
.intercept(nock =>
@@ -132,7 +134,6 @@ t.create('logoWidth')
.expectBadge({
label: 'hey',
message: 'yo',
logoWidth: 30,
})
// The logoPosition param was removed, but passing it should not