feat(isISO6391): add isISO6391() functionality#1103
feat(isISO6391): add isISO6391() functionality#1103ezkemboi wants to merge 1 commit intovalidatorjs:masterfrom
Conversation
ezkemboi
commented
Sep 9, 2019
- closes Add isISO6391() method #989
|
@tux-tn, good suggestion. Let me check how long is the list of the codes. |
|
@tux-tn let me work on this today evening or tomorrow and update it. |
I think this will help. Thanks. |
|
@ezkemboi take your time! Thank you for working on this |
598d6bc to
9ef2dfb
Compare
|
@tux-tn, I have fixed the code, though after running the test, it has changed many more files. |
|
Ping @profnandaa @tux-tn |
profnandaa
left a comment
There was a problem hiding this comment.
See my minor suggestion, and also remove the unrelated changes.
src/lib/isISO6391.js
Outdated
There was a problem hiding this comment.
Instead of a regex, could we just use a set instead? Listing the items on each line for better readability:
const isoSet = new Set([
'aa',
'ab',
//...
]);and return isoSet.has(str).
There was a problem hiding this comment.
Alright, thanks, looking at making the requested changes.
|
@profnandaa I have tried to fix them. |
|
@ezkemboi -- make sure you rebase with the latest |
|
@ezkemboi -- could you also check my comments here, let's check if there's any demand for this... The idea here to try as much as possible (unless compelled by demand), to have the checking-against-db-ish sort of features, and strictly stick to regex. I'd prefer that we put this PR on hold until a sizable number of vote is met; like what I saw with -na |
|
That is awesome @profnandaa. |