Closed brecert closed 3 years ago
Hi Bree! Nice catch, that makes sense. Maybe you can tell I haven't ran a lot of Haptic's code yet 😅 This is was adapted from https://github.com/luwes/sinuous/blob/master/packages/sinuous/h/src/h.js and I set out to remove its nested item()
function, but clearly I never ended up testing it - I'll be putting some time into #3 soon.
I'll leave some comments in the PR.
https://github.com/heyheyhello/haptic/blob/main/src/dom/h.ts#L38
Arrays are considered to be an
object
bytypeof
,typeof arg
is being checked before first checking if it's an array, leading to all arrays being treated as an object.A simple fix is to move the array check to be before the object check.