Skip to content

Commit 72bb799

Browse files
Decio Ferreirarupertlssmith
Decio Ferreira
authored andcommitted
fixes elm#22
Make HTMLCollection and NodeList valid array types
1 parent 063aaf0 commit 72bb799

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Elm/Kernel/Json.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ function _Json_runArrayDecoder(decoder, value, toElmValue)
328328

329329
function _Json_isArray(value)
330330
{
331-
return Array.isArray(value) || (typeof FileList !== 'undefined' && value instanceof FileList);
331+
return Array.isArray(value)
332+
|| (typeof FileList !== 'undefined' && value instanceof FileList)
333+
|| (typeof HTMLCollection !== 'undefined' && value instanceof HTMLCollection)
334+
|| (typeof NodeList !== 'undefined' && value instanceof NodeList);
332335
}
333336

334337
function _Json_toElmArray(array)

0 commit comments

Comments
 (0)