@stackend/api
Version:
JS bindings to api.stackend.com
20 lines • 453 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCountryCode = void 0;
/**
* Get country code by locale
*/
function getCountryCode(locale) {
if (!locale) {
return null;
}
var v = locale.split('[-_]');
// de
if (v.length == 1) {
return null;
}
// en_US
return v[1].toUpperCase();
}
exports.getCountryCode = getCountryCode;
//# sourceMappingURL=getCountryCode.js.map