{"action":"closed","issue":{"url":"https://api.github.com/repos/phretaddin/schemapack/issues/18","repository_url":"https://api.github.com/repos/phretaddin/schemapack","labels_url":"https://api.github.com/repos/phretaddin/schemapack/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/phretaddin/schemapack/issues/18/comments","events_url":"https://api.github.com/repos/phretaddin/schemapack/issues/18/events","html_url":"https://github.com/phretaddin/schemapack/issues/18","id":171472969,"number":18,"title":"NodeJS 6.4.0 Empty String Range Error","user":{"login":"jannicars","id":3849161,"avatar_url":"https://avatars.githubusercontent.com/u/3849161?v=3","gravatar_id":"","url":"https://api.github.com/users/jannicars","html_url":"https://github.com/jannicars","followers_url":"https://api.github.com/users/jannicars/followers","following_url":"https://api.github.com/users/jannicars/following{/other_user}","gists_url":"https://api.github.com/users/jannicars/gists{/gist_id}","starred_url":"https://api.github.com/users/jannicars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jannicars/subscriptions","organizations_url":"https://api.github.com/users/jannicars/orgs","repos_url":"https://api.github.com/users/jannicars/repos","events_url":"https://api.github.com/users/jannicars/events{/privacy}","received_events_url":"https://api.github.com/users/jannicars/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-16T17:31:09Z","updated_at":"2016-08-18T13:29:52Z","closed_at":"2016-08-18T13:29:52Z","body":"Hello,\r\n\r\nOnly affects latest NodeJS (6.4.0) Version. 6.3.1 worked fine.\r\n\r\n```javascript\r\nvar sp = require('../schemapack')\r\n\r\nvar stringSchema = sp.build('string')\r\n\r\nvar data = stringSchema.encode('')\r\nvar decoded = stringSchema.decode(data)\r\n\r\nconsole.log(decoded)\r\n```\r\n\r\nOutput:\r\n```buffer.js:761\r\n        return this.utf8Write(string, offset, length);\r\n                    ^\r\n\r\nRangeError: Offset is out of bounds\r\n    at RangeError (native)\r\n    at Buffer.write (buffer.js:761:21)\r\n    at Object.writeString (D:\\Projects\\schemapack\\schemapack.js:67:29)\r\n    at eval (eval at getCompiledSchema (D:\\Projects\\schemapack\\schemapack.js:374:24), <anonymous>:3:209)\r\n    at Object.encode (D:\\Projects\\schemapack\\schemapack.js:389:14)\r\n    at Object.<anonymous> (D:\\Projects\\schempack_test\\test.js:5:25)\r\n    at Module._compile (module.js:556:32)\r\n    at Object.Module._extensions..js (module.js:565:10)\r\n    at Module.load (module.js:473:32)\r\n    at tryModuleLoad (module.js:432:12)```"}}
{"actor":{"display_login":"phretaddin"}}