You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
370 B
JavaScript
12 lines
370 B
JavaScript
"use strict";
|
|
|
|
const { validateValue } = require("@validatem/core");
|
|
const isCountryCode2 = require("./");
|
|
|
|
console.log(validateValue("NL", [ isCountryCode2 ])); // NL
|
|
|
|
console.log(validateValue("NLD", [ isCountryCode2 ])); /*
|
|
AggregrateValidationError: One or more validation errors occurred:
|
|
- At (root): Must be an ISO-3166-1 alpha-2 (2 character) country code
|
|
*/
|