Skip to content

Fix: Check if is_numeric before casting - #3

Open
Traineau wants to merge 2 commits into
eoko:masterfrom
Traineau:fx-languageSkillCode-parsing
Open

Fix: Check if is_numeric before casting#3
Traineau wants to merge 2 commits into
eoko:masterfrom
Traineau:fx-languageSkillCode-parsing

Conversation

@Traineau

@TraineauTraineau commented Mar 14, 2024

Copy link
Copy Markdown

Specific keys like languageSkillCode are parsed as a INT, even though it is supposed to be a string (ISO CODE like "FR", "EN" etc...).

The problem resulting is that every languageSkillCode are casted to int because of the /Code$/i regex, and so the parseElement returns "0" every time.

To avoid this we can check if the value is numeric in addition to the /Code$/i regex.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Traineau