Giter Site home page Giter Site logo

js-form-parser's People

Contributors

jalik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

webappallenkuo

js-form-parser's Issues

Failed to parse source map (missing)

After upgrading to 3.1.0 we're getting a missing source map warning when running our React app.

image

It seems to be pulling from the correct CJS source.

image

The parser works as expected, with the exception of this warning. Is this a package issue or an issue on our end?

Boolean Data Type not enforced

When parsing a checkbox with the data-type property set to boolean, my expectation is that a parsed form will either result in a true or false value for that field; with true indicating a checked state, and false being unchecked. This is not the case.

e.g.

<input name="abc" type="checkbox" data-type="boolean" value="true" checked>
console.log(parseForm(form, { nullify: false }));

Outputs:

{abc: null}

or

{abc: true}

When the checkbox is unchecked vs. checked, respectively. Per the docs,

Note: The boolean data-type will convert "1" and "true" to true, all other values are false.

We should be seeing either true or false, never null.

Is this expected functionality and is there a way to force an actual boolean result?

Parsed form data ends up containing a huge (mostly empty) array

Given a single form element like:

<input name="contactNumbers[blocks][864536][fields][number]" type="text" value="[val]">

The parsed data ends up like:

{
    ...
    contactNumbers: {
        blocks: <Array with 864537 elements>
    }
    ...
}

In the above example, the contactNumbers.blocks array with a length of 864537 - almost all values are null. The array index 864536 contains the correctly parsed object: fields.number with a value in this case of "[val]".

When this object is converted to JSON with JSON.stringify() for submission to the server, it ends up at approximately 4.3Mb.

Using version 2.0.5.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.