@vendit-dev/thirdparty-adapters 0.7.18 → 0.7.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -181,6 +181,15 @@ exports.formattedPaxCountText = formattedPaxCountText;
|
|
|
181
181
|
function formatPhoneNumber(text) {
|
|
182
182
|
var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[^0-9]/g, '');
|
|
183
183
|
var safeNumberRegex = /^050{1}[0-9]{9}$/;
|
|
184
|
+
// +로 시작하는 경우 처리
|
|
185
|
+
if (text === null || text === void 0 ? void 0 : text.startsWith('+')) {
|
|
186
|
+
// +82로 시작하는 경우
|
|
187
|
+
if (text.startsWith('+82')) {
|
|
188
|
+
return onlyNumberText ? "0".concat(onlyNumberText.slice(3)) : '';
|
|
189
|
+
}
|
|
190
|
+
// 그 외 국제번호의 경우
|
|
191
|
+
return text.replace(/[+\s]/g, '');
|
|
192
|
+
}
|
|
184
193
|
if (safeNumberRegex.test(onlyNumberText || '')) {
|
|
185
194
|
return onlyNumberText;
|
|
186
195
|
}
|