mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
alphanumeric.js: improve namiug a bit
This commit is contained in:
@@ -30,14 +30,14 @@ const is_almost_alphanumeric = function (str) {
|
||||
for (let c of str) {
|
||||
if (
|
||||
!char_is_alphanumeric(c) &&
|
||||
!is_almost_alphanumeric.almost_chars.has(c)
|
||||
!is_almost_alphanumeric.chars.has(c)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
is_almost_alphanumeric.almost_chars = new Set(['-', '_']);
|
||||
is_almost_alphanumeric.chars = new Set(['-', '_']);
|
||||
|
||||
assert( is_alphanumeric('aB0'));
|
||||
assert(!is_alphanumeric('aB0_-'));
|
||||
|
||||
Reference in New Issue
Block a user