Closed
Description
Currently the function excludes any elements in the form that contain a dash in the name attribute, however using dashes are completely valid according the the W3C spec.
To include elements with dashed names in the returned object, I just updated the patterns.validate
, patterns.key
, and patterns.named
regular expressions to include a dash in their character sets resulting in the following:
patterns = {
validate: /^[a-zA-Z][a-zA-Z0-9_-]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,
key: /[a-zA-Z0-9_-]+|(?=\[\])/g,
push: /^$/,
fixed: /^\d+$/,
named: /^[a-zA-Z0-9_-]+$/
};