mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
6cbc408102
Three small logic bugs in the shared helpers, each verified with a standalone Lua
run.
isArray returned true for sparse tables like {[1]=1,[3]=3}: the in-loop
`count > maxIndex` check can never fire (with positive integer keys count is always
<= maxIndex), so it was dead code. Dropped it and return `count == maxIndex`, which
is false for gaps and still true for a dense sequence or an empty table.
toPascal lowercased the letters after an underscore: `[%w_]*` swallowed the
underscore and the next word into the part that gets lowercased, so "hello_world"
became "Helloworld". Excluding the underscore from that class leaves each word to be
capitalised, then the trailing gsub removes the underscores -> "HelloWorld".
replace escaped the pattern but not the replacement, so a "%" in the replacement
raised "invalid use of '%' in replacement string" and "%1" style sequences expanded
captures. Escape "%" in a string replacement; a function or table replacement is
left untouched.