From 0d0755506e9fcc5f091df92b4ef37d6f236142fb Mon Sep 17 00:00:00 2001 From: Ramon Brullo Date: Tue, 25 Jun 2024 09:57:36 +0200 Subject: [PATCH] drop old internal-package logic --- src/domain/domain-name.ts | 15 --------------- test/domain/domain-name.test.ts | 22 +--------------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/domain/domain-name.ts b/src/domain/domain-name.ts index f8d0a0d5..56abff32 100644 --- a/src/domain/domain-name.ts +++ b/src/domain/domain-name.ts @@ -25,21 +25,6 @@ export function isDomainName(s: string): s is DomainName { return segments.every((segment) => segmentRegex.test(segment)); } -/** - * Detect if the given package name is an internal package. - * @param name The name of the package. - */ -export const isInternalPackage = (name: DomainName): boolean => { - const internals = [ - "com.unity.ugui", - "com.unity.2d.sprite", - "com.unity.2d.tilemap", - "com.unity.package-manager-ui", - "com.unity.ugui", - ]; - return /com.unity.modules/i.test(name) || internals.includes(name); -}; - /** * Constructs a domain-name from a string. * @param s The string. diff --git a/test/domain/domain-name.test.ts b/test/domain/domain-name.test.ts index 49844e53..979d9ab5 100644 --- a/test/domain/domain-name.test.ts +++ b/test/domain/domain-name.test.ts @@ -1,8 +1,4 @@ -import { - isDomainName, - isInternalPackage, - makeDomainName, -} from "../../src/domain/domain-name"; +import { isDomainName } from "../../src/domain/domain-name"; describe("domain-name", () => { describe("validation", () => { @@ -31,20 +27,4 @@ describe("domain-name", () => { expect(isDomainName(s)).toBeFalsy(); }); }); - - describe("internal package", () => { - it("test com.otherorg.software", () => { - expect( - isInternalPackage(makeDomainName("com.otherorg.software")) - ).not.toBeTruthy(); - }); - it("test com.unity.ugui", () => { - expect(isInternalPackage(makeDomainName("com.unity.ugui"))).toBeTruthy(); - }); - it("test com.unity.modules.tilemap", () => { - expect( - isInternalPackage(makeDomainName("com.unity.modules.tilemap")) - ).toBeTruthy(); - }); - }); });