Reference · Parsing, formatting and shared types
CleanAddressTestCasetype
A cleaning case in the package's JSON test files: an address and the tidied text expected.
Import it
import type { CleanAddressTestCase } from "@johnmorrisdotca/address-plus";
Definition
interface CleanAddressTestCase extends TestCaseBase {
input: string;
expected: {
cleaned: string;
changes?: string[];
[key: string]: unknown;
};
options?: {
format?: string;
abbreviate?: boolean;
[key: string]: unknown;
};
}
Members
| Name | Type | Description |
|---|---|---|
input | string | |
expected | { [key: string]: unknown; cleaned: string; changes?: string[]; } | |
options (optional) | { [key: string]: unknown; format?: string; abbreviate?: boolean; } | undefined | |
name (optional) | string | undefined | |
description (optional) | string | undefined |
Examples
import type { CleanAddressTestCase } from "@johnmorrisdotca/address-plus";
console.log(({ input: "123 MAIN ST", expected: "123 Main St" }).expected);
// → "123 Main St"123 Main StWhat it prints (run when this page was built)