diff options
| author | Li Zhineng <[email protected]> | 2025-07-15 20:53:42 +0800 |
|---|---|---|
| committer | Li Zhineng <[email protected]> | 2025-07-15 20:53:42 +0800 |
| commit | ae5a816156ed554cb94a251088ce1b5005d5112e (patch) | |
| tree | 03773f9fd706f2477fea3f0e6c735a068d3efae8 /main.mjs | |
| parent | 399a1cbf1674a729106fb4b24d7cac5cd363c077 (diff) | |
| download | setup-ae5a816156ed554cb94a251088ce1b5005d5112e.tar.gz setup-ae5a816156ed554cb94a251088ce1b5005d5112e.zip | |
add doc
Diffstat (limited to 'main.mjs')
| -rw-r--r-- | main.mjs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -509,11 +509,18 @@ class WifiCredentialsForm extends ProgressibleForm { } } + /** + * Validate with the IEEE 802.11 standard. + * + * @param {string} ssid - The Wi-Fi name + * @param {string} password - The Password (WPA/WPA2-PSK) + */ validate(ssid, password) { if (ssid === '' ) { throw new Error('SSID cannot be empty.') } + // The SSID is up to 32 characters if (ssid.length > 32) { throw new Error('SSID cannot be longer than 32 characters.') } @@ -522,6 +529,7 @@ class WifiCredentialsForm extends ProgressibleForm { throw new Error('Password cannot be empty.') } + // The password is between 8 and 63 characters if (password.length < 8 || password.length > 63) { throw new Error('Password must be between 8 and 63 characters long.') } |
