mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-10 14:06:30 +00:00
refactor(typescript): Refactor more files (#12696)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
This commit is contained in:
parent
e95fcb17d8
commit
a7792bc5b4
5 changed files with 12 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages';
|
||||
|
||||
export class ExternalHostError extends Error {
|
||||
hostType: string;
|
||||
hostType: string | undefined;
|
||||
|
||||
err: Error;
|
||||
|
||||
|
|
|
@ -2,7 +2,8 @@ import { maskToken } from './mask';
|
|||
|
||||
describe('util/mask', () => {
|
||||
describe('.maskToken', () => {
|
||||
it('returns value if passed value is falsy', () => {
|
||||
it('returns empty string if passed value is falsy', () => {
|
||||
expect(maskToken()).toBe('');
|
||||
expect(maskToken('')).toBe('');
|
||||
});
|
||||
|
||||
|
|
|
@ -5,5 +5,5 @@ export function maskToken(str?: string): string {
|
|||
new Array(str.length - 3).join('*'),
|
||||
str.slice(-2),
|
||||
].join('')
|
||||
: str;
|
||||
: '';
|
||||
}
|
||||
|
|
|
@ -37,11 +37,13 @@ type Variables = Record<string, string>;
|
|||
interface SelectionSet {
|
||||
__vars?: Variables;
|
||||
__args?: Arguments;
|
||||
[key: string]: null | SelectionSet | Arguments;
|
||||
[key: string]: undefined | null | SelectionSet | Arguments;
|
||||
}
|
||||
|
||||
interface GraphqlSnapshot {
|
||||
query?: SelectionSet;
|
||||
mutation?: SelectionSet;
|
||||
subscription?: SelectionSet;
|
||||
variables?: Record<string, string>;
|
||||
}
|
||||
|
||||
|
@ -81,7 +83,7 @@ function getArguments(key: string, val: ValueNode): Arguments {
|
|||
}
|
||||
|
||||
function simplifyArguments(
|
||||
argNodes: ReadonlyArray<ArgumentNode>
|
||||
argNodes?: ReadonlyArray<ArgumentNode>
|
||||
): Arguments | null {
|
||||
if (argNodes) {
|
||||
let result: Arguments = {};
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
"./lib/platform/utils/pr-body.ts",
|
||||
"./lib/proxy.ts",
|
||||
"./lib/types/branch-status.ts",
|
||||
"./lib/types/errors/external-host-error.ts",
|
||||
"./lib/types/git.ts",
|
||||
"./lib/types/host-rules.ts",
|
||||
"./lib/types/later.d.ts",
|
||||
|
@ -108,12 +109,15 @@
|
|||
"./lib/util/http/types.ts",
|
||||
"./lib/util/index.ts",
|
||||
"./lib/util/json-writer/indentation-type.ts",
|
||||
"./lib/util/mask.spec.ts",
|
||||
"./lib/util/mask.ts",
|
||||
"./lib/util/object.ts",
|
||||
"./lib/util/sanitize.ts",
|
||||
"./lib/util/split.ts",
|
||||
"./lib/workers/pr/changelog/hbs-template.ts",
|
||||
"./lib/workers/pr/changelog/types.ts",
|
||||
"./lib/workers/repository/init/types.ts",
|
||||
"./test/graphql-snapshot.ts",
|
||||
"./test/json-schema.ts",
|
||||
"./test/newline-snapshot-serializer.ts",
|
||||
"./test/static-files.spec.ts",
|
||||
|
|
Loading…
Reference in a new issue