Reference · Parsing, formatting and shared types
AddressComparisonTestCasetype
A comparison case in the package's JSON test files: two addresses and the match expected.
Import it
import type { AddressComparisonTestCase } from "@johnmorrisdotca/address-plus";
Definition
interface AddressComparisonTestCase extends TestCaseBase {
input: {
address1: string;
address2: string;
};
expected: {
isSame?: boolean;
similarity?: number;
differences?: string[];
[key: string]: unknown;
};
}
Members
| Name | Type | Description |
|---|---|---|
input | { address1: string; address2: string; } | |
expected | { [key: string]: unknown; isSame?: boolean; similarity?: number; differences?: string[]; } | |
name (optional) | string | undefined | |
description (optional) | string | undefined | |
options (optional) | Record<string, unknown> | undefined |
Examples
import type { AddressComparisonTestCase } from "@johnmorrisdotca/address-plus";
console.log(({ input: ["123 Main St", "123 Main Street"], expected: { isSame: true } }).expected.isSame);
// → truetrueWhat it prints (run when this page was built)