Documentation v2.0.3

Map and Form Data Extensions

Chainable Map helpers and the $map/$json converters for FormData and <form> elements.

Map

Source: src/prototype/Map.ts

Method / Property Description
map.length this.size
map.$keys / map.$values Iterators over keys / values
map.$json Object.fromEntries(this)
map._(key, value?) Chainable set(key, value)
map.$(key?) get(key)
map.$_(key?) Chainable delete(key)
map.$$(key?) has(key) if given, else this.size > 0

FormData

Source: src/prototype/FormData.ts

Method / Property Description
formData.$map Entries as a Map
formData.$json Entries as a plain object

HTMLFormElement

Source: src/prototype/HTMLFormElement.ts

Method / Property Description
form.$map Form fields as a Map (via an internal FormData wrapper)
form.$json Form fields as a plain object
中文