You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
consider the code below.
As you can see, altering the disableLanguages array (removing an item) the patch method breaks the disableLanguages array
NOTE
the input is a part of a longer config file but, consider that I have checked the issue on the whole file. I also tried to change the spacing between elements in the disableLanguages array (["he", "hu", "zh", "nb", "da", "ro", "fi"], ['he', 'hu', 'zh', 'nb', 'da', 'ro', 'fi'], ["he","hu","zh","nb","da","ro","fi"], ['he','hu','zh','nb','da','ro','fi'], ... and so on ) with the same result
let tomlFileContent= 'baseUrl = "https://example.com/"
languageCode = "en-us"
languageLang = "en"
title = "this is the title"
DefaultContentLanguage = "en"
disableLanguages = ["he", "hu", "zh", "nb", "da", "ro", "fi"]'
value= parse(tomlFileContent)
console.log (value.disableLanguages)
## output [ "he", "hu", "zh", "nb", "da", "ro", "fi" ]
for (var i = 0; i < value.disableLanguages.length; i++) {
if (value.disableLanguages[i] === 'he') {
value.disableLanguages.splice(i, 1);
i--;
}
}
console.log (value.disableLanguages)
## output ["hu", "zh", "nb", "da", "ro", "fi"]
console.log (patch(tomlFileContent, value))
### output
baseUrl = "https://example.com/"
languageCode = "en-us"
languageLang = "en"
title = "this is the title"
DefaultContentLanguage = "en"
disableLanguages = ["he", "hu", "zh", "nb", "da", "ro", "fi" <---- BROKEN !!!!
The text was updated successfully, but these errors were encountered:
Hi,
consider the code below.
As you can see, altering the
disableLanguages
array (removing an item) thepatch
method breaks thedisableLanguages
arrayNOTE
the input is a part of a longer config file but, consider that I have checked the issue on the whole file. I also tried to change the spacing between elements in the disableLanguages array (
["he", "hu", "zh", "nb", "da", "ro", "fi"]
,['he', 'hu', 'zh', 'nb', 'da', 'ro', 'fi']
,["he","hu","zh","nb","da","ro","fi"]
,['he','hu','zh','nb','da','ro','fi']
, ... and so on ) with the same resultThe text was updated successfully, but these errors were encountered: