append-field

WebJar for append-field

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

append-field
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

append-field
WebJar for append-field
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/LinusU/node-append-field

Download append-field

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/append-field/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>append-field</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/append-field/
implementation 'org.webjars.npm:append-field:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/append-field/
implementation ("org.webjars.npm:append-field:1.0.0")
'org.webjars.npm:append-field:jar:1.0.0'
<dependency org="org.webjars.npm" name="append-field" rev="1.0.0">
  <artifact name="append-field" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='append-field', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "append-field" % "1.0.0"
[org.webjars.npm/append-field "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

append-field

A W3C HTML JSON forms spec compliant field appender (for lack of a better name). Useful for people implementing application/x-www-form-urlencoded and multipart/form-data parsers.

It works best on objects created with Object.create(null). Otherwise it might conflict with variables from the prototype (e.g. hasOwnProperty).

Installation

npm install --save append-field

Usage

var appendField = require('append-field')
var obj = Object.create(null)

appendField(obj, 'pets[0][species]', 'Dahut')
appendField(obj, 'pets[0][name]', 'Hypatia')
appendField(obj, 'pets[1][species]', 'Felis Stultus')
appendField(obj, 'pets[1][name]', 'Billie')

console.log(obj)
{ pets:
   [ { species: 'Dahut', name: 'Hypatia' },
     { species: 'Felis Stultus', name: 'Billie' } ] }

API

appendField(store, key, value)

Adds the field named key with the value value to the object store.

License

MIT

Versions

Version
1.0.0