mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-06 19:16:03 -06:00
clerical: import/doc/format fixes
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
@@ -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<{
|
||||
|
||||
@@ -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<LookupInputProps> = ({
|
||||
const { register, handleSubmit, getValues } = useForm<SubmitProps>({
|
||||
defaultValues: {
|
||||
target: "",
|
||||
// Not used at this time.
|
||||
followReferral: false,
|
||||
requestJSContact: false,
|
||||
},
|
||||
|
||||
10
src/rdap.ts
10
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<TargetType, Error> {
|
||||
for (const [pattern, type] of URIPatterns) {
|
||||
if (pattern.test(value)) return Result.ok(type);
|
||||
|
||||
Reference in New Issue
Block a user