We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 529e043 commit f8c83f0Copy full SHA for f8c83f0
1 file changed
lib/index.ts
@@ -36,13 +36,21 @@ interface Validator {
36
(input: string): boolean;
37
}
38
39
+/**
40
+ * @hidden
41
+ */
42
interface Parser {
43
/**
44
* @hidden
45
*/
46
(postcode: string): string | null;
47
48
49
50
+ * Represents a valid postcode
51
+ *
52
+ * Note that results will be normalised (i.e. correctly formatted), including `postcode`
53
54
type ValidPostcode = {
55
valid: true;
56
postcode: string;
@@ -297,6 +305,9 @@ export const parse = (postcode: string): ValidPostcode | InvalidPostcode => {
297
305
export const match = (corpus: string): string[] =>
298
306
corpus.match(POSTCODE_CORPUS_REGEX) || [];
299
307
308
309
310
300
311
interface ReplaceResult {
301
312
302
313
* List of matching postcodes found intext
0 commit comments