Deploy via committed dist: local Nest build, server runs with .env
Build on the developer machine without Docker, commit dist/, and run on the server with Dockerfile.dist plus compose env_file. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.normalizePhone = normalizePhone;
|
||||
exports.isValidPhone = isValidPhone;
|
||||
exports.toEnglishDigits = toEnglishDigits;
|
||||
function normalizePhone(raw) {
|
||||
let digits = raw.replace(/\D/g, '');
|
||||
if (digits.startsWith('98') && digits.length === 12) {
|
||||
digits = `0${digits.slice(2)}`;
|
||||
}
|
||||
if (digits.length === 10 && digits.startsWith('9')) {
|
||||
digits = `0${digits}`;
|
||||
}
|
||||
return digits;
|
||||
}
|
||||
function isValidPhone(phone) {
|
||||
return /^09\d{9}$/.test(phone);
|
||||
}
|
||||
function toEnglishDigits(value) {
|
||||
return value
|
||||
.replace(/[۰-۹]/g, (d) => String('۰۱۲۳۴۵۶۷۸۹'.indexOf(d)))
|
||||
.replace(/[٠-٩]/g, (d) => String('٠١٢٣٤٥٦٧٨٩'.indexOf(d)));
|
||||
}
|
||||
//# sourceMappingURL=phone.js.map
|
||||
Reference in New Issue
Block a user