diff --git a/src/components/common/AbstractCard.tsx b/src/components/common/AbstractCard.tsx index 8bbe247..dc32712 100644 --- a/src/components/common/AbstractCard.tsx +++ b/src/components/common/AbstractCard.tsx @@ -1,4 +1,5 @@ -import React, { FunctionComponent, ReactNode } from "react"; +import type { FunctionComponent, ReactNode } from "react"; +import React from "react"; import { useBoolean } from "usehooks-ts"; import { CodeBracketIcon } from "@heroicons/react/24/solid"; diff --git a/src/components/common/PropertyList.tsx b/src/components/common/PropertyList.tsx index 96b37c7..3fc08d3 100644 --- a/src/components/common/PropertyList.tsx +++ b/src/components/common/PropertyList.tsx @@ -1,4 +1,5 @@ -import React, { FunctionComponent, ReactNode } from "react"; +import type { FunctionComponent, ReactNode } from "react"; +import React from "react"; import Property from "@/components/common/Property"; const PropertyListItem: FunctionComponent<{ diff --git a/src/components/form/LookupInput.tsx b/src/components/form/LookupInput.tsx index d64fe65..b2938e5 100644 --- a/src/components/form/LookupInput.tsx +++ b/src/components/form/LookupInput.tsx @@ -12,7 +12,7 @@ import { } from "@heroicons/react/20/solid"; import { Listbox, Transition } from "@headlessui/react"; import clsx from "clsx"; -import { Maybe } from "true-myth"; +import type { Maybe } from "true-myth"; /** * Props for the LookupInput component. @@ -52,6 +52,7 @@ const LookupInput: FunctionComponent = ({ const { register, handleSubmit, getValues } = useForm({ defaultValues: { target: "", + // Not used at this time. followReferral: false, requestJSContact: false, }, diff --git a/src/rdap.ts b/src/rdap.ts index e8dacb6..5401280 100644 --- a/src/rdap.ts +++ b/src/rdap.ts @@ -1,9 +1,6 @@ import type { TargetType } from "@/types"; import { Result } from "true-myth"; -// keeps track of the elements we've created so we can assign a unique ID -// let elementCounter = 123456; - const cardTitles = { domain: "Domain Name", "ip network": "IP Network", @@ -774,6 +771,13 @@ const URIPatterns: [RegExp, TargetType][] = [ ], ]; +/** + * Retrieves the type of a given value based on matching patterns. + * + * @param value - The value to determine the type for. + * @returns A `Result` object containing the determined `TargetType` if a match is found, + * otherwise an `Error` object. + */ export function getType(value: string): Result { for (const [pattern, type] of URIPatterns) { if (pattern.test(value)) return Result.ok(type);