shakilsiraj / json-object-mapper

A TypeScript library to serialize and deserialize object graph from/to JSON in a fast and non-recursive way
MIT License
58 stars 18 forks source link

deserializeArray returns undefined when called on an empty array #10

Open jongunter opened 7 years ago

jongunter commented 7 years ago

Hi, is this intended behavior?

  class Example {
      hello = null;
      world = null;
    }
    const helloJson = []
    const result = ObjectMapper.deserializeArray(Order, helloJson);

    // expected []
    // was undefined
    console.log(result);

If not, it should be fixed. If so, it should be documented, as it seems like it could cause confusion.

devpreview commented 7 years ago

@jongunter see pull request #19

shakilsiraj commented 7 years ago

Can you please try 1.5.0?