Skip to content

Commit

Permalink
refactor: remove unused code (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeVanti authored Dec 22, 2023
1 parent 1a749f6 commit 5f0c5b3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
2 changes: 0 additions & 2 deletions src/types/domain-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export type DomainName = Brand<string, "DomainName">;

const segmentRegex = /^(?!.*--|^-.*|.*-$)[a-zA-Z0-9-]+$/;

export const openUpmReverseDomainName = domainName("com.openupm");

function domainSegmentsIn(hostName: string): string[] {
return hostName.split(".");
}
Expand Down
6 changes: 0 additions & 6 deletions src/utils/error-type-guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,5 @@ export const isHttpError = (x: unknown): x is HttpErrorBase => {
return x instanceof Error && "statusCode" in x;
};

export const isConnectionError = (err: HttpErrorBase): boolean =>
err.code === "ENOTFOUND";

export const is404Error = (err: HttpErrorBase): boolean =>
err.statusCode === 404 || err.message.includes("404");

export const is503Error = (err: HttpErrorBase): boolean =>
err.statusCode === 503;
3 changes: 1 addition & 2 deletions test/mock-registry.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import nock from "nock";
import { SearchEndpointResult } from "./types";
import { domainName, isDomainName } from "../src/types/domain-name";
import { isDomainName } from "../src/types/domain-name";
import assert from "assert";
import { registryUrl } from "../src/types/registry-url";
import { PkgInfo } from "../src/types/pkg-info";

export const unityRegistryUrl = registryUrl("https://packages.unity.com");
export const exampleRegistryUrl = registryUrl("http://example.com");
export const exampleRegistryReverseDomain = domainName("com.example");

export function startMockRegistry() {
if (!nock.isActive()) nock.activate();
Expand Down

0 comments on commit 5f0c5b3

Please sign in to comment.