Skip to the content

address-plusアドレスプラス

Parse, validate, format and compare addresses locally, add country modules and mount an optional native form field.

address-plus extends the parse-address style with typed results, validation, formatting and country modules. About the name

Contents

Reference · /br

isKnownBrazilianPostcodefunction

Whether a CEP is in a range the Correios gave a state: it has the shape and its first five digits fall in a state's range. This says nothing of whether the CEP itself is in use; there is no list of them here.

Import it

import { isKnownBrazilianPostcode } from "@johnmorrisdotca/address-plus/br";

Definition

function isKnownBrazilianPostcode(postcode: string): boolean

Parameters

NameTypeDescription
postcodestring

The CEP.

Returns

boolean

true when a state's range holds it.

Examples

import { isKnownBrazilianPostcode } from "@johnmorrisdotca/address-plus/br";

console.log(["01310-200", "00999-000", "01310"].map(isKnownBrazilianPostcode));
// → [true,false,false]
[ true, false, false ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/address-plus 1.10.2.