From ab69c9e47bf38fbc8a41ae046e7f53415a4dc352 Mon Sep 17 00:00:00 2001 From: Ivan Shmidt Date: Fri, 10 Jul 2020 09:29:26 +0200 Subject: [PATCH] feat(catalog): allow using different branches --- .../register-component/src/util/validate.test.ts | 14 -------------- plugins/register-component/src/util/validate.ts | 3 --- 2 files changed, 17 deletions(-) diff --git a/plugins/register-component/src/util/validate.test.ts b/plugins/register-component/src/util/validate.test.ts index 43e05a4671..d062655bd2 100644 --- a/plugins/register-component/src/util/validate.test.ts +++ b/plugins/register-component/src/util/validate.test.ts @@ -30,20 +30,6 @@ describe('ComponentIdValidators', () => { expect(ComponentIdValidators.httpsValidator(arg)).toBe(expected); }); }); - describe('masterValidator', () => { - const errorMessage = 'Must reference a file on the master branch.'; - test.each([ - [true, '/blob/master/'], - [true, 'http://example.com/blob/master/'], - [errorMessage, 'blob/master/'], - [errorMessage, '/blob/master'], - [errorMessage, '/master/'], - [errorMessage, ''], - [errorMessage, undefined], - ])('should return %p for %s', (expected: string | boolean, arg: any) => { - expect(ComponentIdValidators.masterValidator(arg)).toBe(expected); - }); - }); describe('yamlValidator', () => { const errorMessage = "Must end with '.yaml'."; test.each([ diff --git a/plugins/register-component/src/util/validate.ts b/plugins/register-component/src/util/validate.ts index 175d9378df..78d20995f5 100644 --- a/plugins/register-component/src/util/validate.ts +++ b/plugins/register-component/src/util/validate.ts @@ -18,9 +18,6 @@ export const ComponentIdValidators = { httpsValidator: (value: any) => (typeof value === 'string' && value.match(/^https:\/\//) !== null) || 'Must start with https://.', - masterValidator: (value: any) => - (typeof value === 'string' && value.match(/\/blob\/master\//) !== null) || - 'Must reference a file on the master branch.', yamlValidator: (value: any) => (typeof value === 'string' && value.match(/.yaml$/) !== null) || "Must end with '.yaml'.",