fix: 修复 password 为数字时的 bug

This commit is contained in:
xream
2024-09-16 01:43:16 +08:00
parent de2813b035
commit cc556b641d
3 changed files with 12 additions and 1 deletions

View File

@@ -111,6 +111,12 @@ function getRandomPort(portString) {
}
}
function numberToString(value) {
return Number.isSafeInteger(value)
? String(value)
: BigInt(value).toString();
}
export {
ipAddress,
isIPv4,
@@ -123,4 +129,5 @@ export {
// utf8ArrayToStr,
getPolicyDescriptor,
getRandomPort,
numberToString,
};