Skip to content

Commit

Permalink
drop old internal-package logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeVanti committed Jun 25, 2024
1 parent d9a0004 commit 0d07555
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
15 changes: 0 additions & 15 deletions src/domain/domain-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 1 addition & 21 deletions test/domain/domain-name.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down Expand Up @@ -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();
});
});
});

0 comments on commit 0d07555

Please sign in to comment.