isValidBrazilianPostcode関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Whether a CEP follows the Correios' shape: eight digits, with a hyphen after the fifth or none.
インポート
import { isValidBrazilianPostcode } from "@johnmorrisdotca/address-plus/br";
定義
function isValidBrazilianPostcode(postcode: string): boolean
引数
| 名前 | 型 | 説明 |
|---|---|---|
postcode | string | The CEP. |
戻り値
boolean
true when it has the shape.
例
import { isValidBrazilianPostcode } from "@johnmorrisdotca/address-plus/br";
console.log(["01310-200", "01310200", "01310-20", "1310-200"].map(isValidBrazilianPostcode));
// → [true,true,false,false][ true, true, false, false ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。