{"action":"opened","issue":{"url":"https://api.github.com/repos/kmalakoff/json-serialize/issues/1","labels_url":"https://api.github.com/repos/kmalakoff/json-serialize/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/kmalakoff/json-serialize/issues/1/comments","events_url":"https://api.github.com/repos/kmalakoff/json-serialize/issues/1/events","html_url":"https://github.com/kmalakoff/json-serialize/issues/1","id":119749422,"number":1,"title":"problem with empty array","user":{"login":"luctorQ","id":468877,"avatar_url":"https://avatars.githubusercontent.com/u/468877?v=3","gravatar_id":"","url":"https://api.github.com/users/luctorQ","html_url":"https://github.com/luctorQ","followers_url":"https://api.github.com/users/luctorQ/followers","following_url":"https://api.github.com/users/luctorQ/following{/other_user}","gists_url":"https://api.github.com/users/luctorQ/gists{/gist_id}","starred_url":"https://api.github.com/users/luctorQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luctorQ/subscriptions","organizations_url":"https://api.github.com/users/luctorQ/orgs","repos_url":"https://api.github.com/users/luctorQ/repos","events_url":"https://api.github.com/users/luctorQ/events{/privacy}","received_events_url":"https://api.github.com/users/luctorQ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-01T16:06:06Z","updated_at":"2015-12-01T16:06:06Z","closed_at":null,"body":"Hi \r\nI found one problem with lib when I serialize object with empty array ex.\r\n```javascript\r\nvar testObj={\r\n    empty_arr:[],\r\n    null_arr:null,\r\n    arr:[new Date()]\r\n}\r\nconsole.log(JSON.serialize(testObj));\r\n```\r\nThe result is \r\n```\r\n{ empty_arr: null,\r\n  null_arr: null,\r\n  arr: [ '2015-12-01T15:57:51.499Z' ] }\r\n\r\n//should be\r\n{ empty_arr: [],\r\n  null_arr: null,\r\n  arr: [ '2015-12-01T15:57:51.499Z' ] }\r\n\r\n```\r\nis it intentional or maybe You'd like to fix it and publish new ver I see last commit is years ago ?\r\n\r\nfor my purpose I changed condition in serialize like this:\r\n```javascript\r\nJSONS.serialize = function(obj, options) {\r\n  var key, result, value, _i, _len;\r\n//...\r\n  if (!isArray(obj) && isEmpty(obj)) { //before was only isEmpty check\r\n    return null;\r\n  }\r\n//...\r\n}\r\n```\r\n\r\n"}}