bhall2001 / fastjson

A Livecode library for JSON encoding and decoding to and from Arrays.
MIT License
17 stars 11 forks source link

Don't think your isNumericalArray() function does what you want. #10

Closed bhall2001 closed 8 years ago

bhall2001 commented 8 years ago

From forums.livecode.com

It looks like you're just checking the first char of each key. So keys like

0ThisIsZero 1001Nights

would return true.

A better filter might be

CODE: SELECT ALL filter pArray with "[A-Za-z]"

which will return tArray not empty for any non-numeric keys.

bhall2001 commented 8 years ago

Confirmed this is a bug.

The correct regex is ^[0-9]+$.

Look for the fix in 0.3.0

bhall2001 commented 8 years ago

Well, looks like filter does not use regix. I really would like to find a way to check for only numbers before going with a character based solution.

bhall2001 commented 8 years ago

This has been fixed. Closed based on my testing and lack of further reports the issue still exists.