| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
test const isLiteralSymbol = (char) => {
const code = char.charCodeAt(0);
if (code > 127) {
return true;
}
if (char >= '0' && char <= 9) {
return false;
}
if (code === 35) {
return false;
}
return true;
}output isLiteralSymbol('أهلا')
true |
Sorry, something went wrong.
|
@anonrig I applied the changes, thank you very much for the review 🚀 |
Sorry, something went wrong.
There was a problem hiding this comment.
the change LGTM, but this seems to break quite a few tests
Sorry, something went wrong.
There was a problem hiding this comment.
Could you:
Sorry, something went wrong.
There was a problem hiding this comment.
@manekinekko thank you so much i will fly here 🚀
Sorry, something went wrong.
There was a problem hiding this comment.
@manekinekko would that be healthy
{
const literals = ['A', 'a', '-', '+', 'أ', 'ت', 'ث', '讲', '演', '講'];
const nonLiterals = ['0', '#', '\\', '+', '-'];
literals.forEach((literal) => {
assert.strictEqual(isLiteralSymbol(literal), true);
});
nonLiterals.forEach((nonLiteral) => {
assert.strictEqual(isLiteralSymbol(nonLiteral), false);
});
}
Sorry, something went wrong.
|
I'm so sorry I triggered you all to review, sorry for the extra notifications :/ |
Sorry, something went wrong.
|
@manekinekko I sent the edits thank you very much |
Sorry, something went wrong.
There was a problem hiding this comment.
Should we really accept zero width characters as acceptable input? I would skip all of them. We also already have a function to check for these:
node/lib/internal/util/inspect.js
Lines 2388 to 2398 in ab064d1
Sorry, something went wrong.
|
I didn't accept zero-width characters @BridgeAR i will update the code like this if (typeof char !== 'string' || util.inspect.isZeroWidthCodePoint(char)) {
return false;
}can I do it like this? |
Sorry, something went wrong.
|
@mertcanaltin I think that would be ok. |
Sorry, something went wrong.
|
CC @nodejs/test_runner @manekinekko additional reviews will be appreciated |
Sorry, something went wrong.
|
@anonrig can you please dismiss your review/approve? |
Sorry, something went wrong.
Sorry, something went wrong.
|
🎉 |
Sorry, something went wrong.
PR-URL: #45736 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: #45736 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: nodejs#45736 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
| Back | FazBrowse Home | New Git URL |
Fixes #45706
Fixes #46508